I was trying to calculate this integral in Mathematica 9:
2/π Integrate[ Cosh[a x] Cos[n x], {x, 0, π}, Assumptions -> n ∈ Integers]
I got as a result :
$$\frac{2 (a \sinh (\pi a) \cos (\pi n)+n \cosh (\pi a) \sin (\pi n))}{\pi \left(a^2+n^2\right)}$$
That's the same result I obtained manually, but how can I force Mathematica to change $\sin(n \pi)$ into $0$ and $\cos(n \pi)$ into $(-1)^n$ ?
Assuming[Element[n, Integers], 2/Pi Integrate[Cosh[a x] Cos[n x], {x, 0, Pi}]]? – J. M.'s missing motivation Jun 22 '13 at 09:34Assumptions -> ...) Maybe you could post this as an answer so I can award you the points – Cydonia7 Jun 22 '13 at 09:35Simplify[2/Pi Integrate[Cosh[a x] Cos[n x], {x, 0, Pi}], Element[n, Integers]], it should work in more general cases than your original problem. – Artes Jun 22 '13 at 09:41