# $a_n=\frac{1}{\pi}\left[\int_{-\pi}^{-\frac{\pi}{2}}(\sin 2x)(\cos nx)dx+\int_{0}^{\pi}(\sin 2x)(\cos nx)dx\right]$

$$a_n=\frac{1}{\pi}\left[\int_{-\pi}^{-\frac{\pi}{2}}(\sin 2x)(\cos nx)dx+\int_{0}^{\pi}(\sin 2x)(\cos nx)dx\right];\ldots (A)$$

$$\frac{-2}{\pi}\frac{1+\cos(\frac{n\pi}{2})}{n^2-4}.$$

My attempt:

$\int(\sin 2x)(\cos nx)dx$

$=\frac{1}{2}\int[\sin(n+2)x-\sin(n-2)x]dx$

$=\frac{1}{2(n-2)}\cos(n-2)x-\frac{1}{2(n+2)}\cos(n+2)x$

S0,

$\int_{-\pi}^{-\frac{\pi}{2}}(\sin 2x)(\cos nx)dx$ $=\frac{1}{2(n-2)}\cos(n-2)(\frac{\pi}{2})-\frac{1}{2(n+2)}\cos(n+2)(\frac{\pi}{2})-\frac{1}{2(n-2)}\cos(n-2)(\pi)+\frac{1}{2(n+2)}\cos(n+2)(\pi)$

And

$\int_{0}^{\pi}(\sin 2x)(\cos nx)dx$ $=\frac{1}{2(n-2)}\cos(n-2)(\pi)-\frac{1}{2(n+2)}\cos(n+2)(\pi)-\frac{1}{2(n-2)}+\frac{1}{2(n+2)}$

form equation $(A)$,

$a_n=\frac{1}{\pi}[\frac{1}{2(n-2)}\cos(n-2)(\frac{\pi}{2})-\frac{1}{2(n+2)}\cos(n+2)(\frac{\pi}{2})-\frac{1}{2(n-2)}+\frac{1}{2(n+2)}]$

$\Rightarrow a_n=\frac{1}{\pi}[\frac{(n+2)\cos(n-2)(\frac{\pi}{2})-(n-2)\cos(n+2)(\frac{\pi}{2})-4}{2(n-2)(n+2)}]$

I couldn't come up with the result $\frac{-2}{\pi}\frac{1+\cos(\frac{n\pi}{2})}{n^2-4}$.

$\cos{a-b}=\cos a \cos b + \sin a \sin b$
$\cos{\frac{(n-2)\pi}2}=-\cos{\frac{n\pi}2}$ since $\sin \pi=0$ and $\cos \pi=-1$
$(n-2)(n+2)=n^2-4$.
• $\cos\frac{(n-2)\pi}{2}=\cos[\frac{n\pi}{2}-\pi]=-\cos\frac{n\pi}{2}$. But if $n$ is odd integer, doesn't $\cos$ changes to $\sin$? – ABC Jul 26 '13 at 10:47