$$ \int_{0}^{2\pi}\lvert\sin(x)\rvert\cos(nx)\,dx= -\frac{4\cos^2\bigl(\frac{\pi n}{2}\bigr)\cos(\pi n)}{n^2-1} $$
I'm not actually trying to solve this myself. The answer appears in my lecture notes without any explanation whatsoever. Apparently it depends on whether or not $n$ is odd or even, since the answer is $0$ when $n$ is odd, but I really don't understand how they've gotten the answer at all. Please help me to figure out what the heck is going on!
It might help to divide the integral into two, $\int_0^{\pi}$ and $\int_{\pi}^{2\pi}$. In the first one, $|\sin x|=\sin x$ and in the second one $|\sin x|=-\sin x$. Then one integrate by parts two times, or better, uses the formula $$ \sin x\cos nx=\frac{1}{2}(\sin(n+1)x-\sin(n-1)x). $$ It is a good exercise to do the calculations to see how it works (and what you get).