Hello! I am trying to expand the function $\displaystyle f(x)=sin|x|$ as Fourier series on the interval $\displaystyle |x|<\pi$

Since the function is even we can write

$\displaystyle a_{n}=\frac{2}{\pi}\int_{0}^{\pi}sinxcosnxdx$

but here my problem starts. I try to solve this integral as indefinite integral first but I am going in circles....

$\displaystyle \int sinxcosnxdx=\{u=cosnx,\ dv=sinx\}=\

-cosxcosnx-\frac{1}{n}\int sinnxcosxdx=\{u=sinnx,\ dv=cosx\}=

-cosxcosnx-\frac{1}{n}[sinnxsinx-\frac{1}{n}\int cosnxcosx]=.......$

Could someone show me how to compute this integral?