I'm calculating coefficients of a Fourier Series. I'm seeing a solved problem and I don't understand the following equality
$\int_{0}^{\pi} \sin(x)\cos(nx) dx = \frac{1+(-1)^n}{1-n^2}$
I tried to compute the integral but I'm not getting there. Can someone give a hint on how to proceed. Thanks!
HINT:
$$\sin(x)\cos(nx)=\frac{\sin((n+1)x)-\sin((n-1)x)}{2}$$