i have a calculating question i want to calculate this integral $$\int_{-\pi}^{\pi} |\sin(x)|e^{-inx} \mathrm{d}x$$ i tried to use integration by parts but it just made it more complicated. i already have the answer (USING MAPLE)
but i would appreciate if someone could take the time to explain the steps to me.

Hint:$$\int_{-\pi}^\pi|\sin(x)|e^{-nix}\,\mathrm d x=2\int_0^\pi \sin(x)e^{-inx}\,\mathrm dx.$$
Use the fact that $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$, and conclude.