# Calculate Integral with cos [closed]

Integrate[ (Pi/4 - x/2)  cos (n *x), {x, 0, Pi}]


This doesnt give me desired results .n is natural 1,2,3,4,5...
I want to get something like $$\frac{1-(-1)^n}{2n^2}$$

-

## closed as off-topic by Yves Klett, Öskå, RunnyKine, ciao, Simon WoodsJun 11 '14 at 10:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Yves Klett, Öskå, RunnyKine, ciao, Simon Woods
If this question can be reworded to fit the rules in the help center, please edit the question.

How about putting your cursor on cos, pressing F1 and see that it says Cos[]? –  Öskå Jun 11 '14 at 10:10
Have a look at Basic syntax issues in the most common pitfalls thread. –  Yves Klett Jun 11 '14 at 10:11

FullSimplify[Integrate[(Pi/4 - x/2) Cos[n*x], {x, 0, Pi}], n \[Element] Integers]

(*
-((-1 + (-1)^n)/(2 n^2))
*)

-