Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
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}$$

share|improve this question

closed as off-topic by Yves Klett, Öskå, RunnyKine, ciao, Simon Woods Jun 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

1 Answer 1

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

-((-1 + (-1)^n)/(2 n^2))
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.