Definite integral involving trigonometric functions and absolute values Solve the following integral: 
$$
\int_{0}^{4\pi}\frac{x|\sin x|dx}{1 + |\cos x|}
$$
I tried variable substitution, but nothing seemed to work. Could you give me some clues?
 A: Let 
$$I = \int_0^{\pi} dx \frac{x \sin{x}}{1+|\cos{x}|}$$
and 
$$J = \int_0^{\pi} dx \frac{\sin{x}}{1+|\cos{x}|}$$
From a substitution of $x \mapsto \pi-x$, one may deduce that $I = (\pi/2) J$.  
Now break up the interval $[0,4 \pi]$ into 4 equal pieces.  In the $k$th interval, we have
$$\int_{(k-1) \pi}^{k \pi} dx \frac{x |\sin{x}|}{1+|\cos{x}|}$$
There, make the sub $x=(k-1) \pi+y$, and see that this integral is merely $I + (k-1) \pi J$.  Thus the original integral is the sum of these integrals from $k=1$ to $4$, or $4 I + 6 \pi J = 8 \pi J$.  Thus, the problem reduces to evaluating $J$.
$$J = \int_0^{\pi} dx \frac{\sin{x}}{1+|\cos{x}|} = 2 \int_0^{\pi/2} dx \frac{\sin{x}}{1+\cos{x}} = 2 \log{2}$$
Thus,
$$\int_0^{4 \pi} dx \frac{x |\sin{x}|}{1+|\cos{x}|} = 16 \pi \log{2}$$
A: HINT:
First use $$\text{If }I=\int_a^b f(x)dx, I=\int_a^b f(a+b-x)dx$$
and subsequently, $$I+I=\int_a^b f(x)dx+\int_a^b f(a+b-x)dx=\int_a^b[f(x)dx+f(a+b-x)]dx$$  $$\text{which here should be }4\pi\int_0^{4\pi}\frac{|\sin x|}{1+|\cos x|}dx$$
$$\text{Now, }\int_0^{4\pi}\frac{|\sin x|}{1+|\cos x|}dx$$
$$=\int_0^{\pi}\frac{|\sin x|}{1+|\cos x|}dx+\int_\pi^{2\pi}\frac{|\sin x|}{1+|\cos x|}dx+\int_{2\pi}^{3\pi}\frac{|\sin x|}{1+|\cos x|}dx+\int_{3\pi}^{4\pi}\frac{|\sin x|}{1+|\cos x|}dx$$
Now as $|\sin(x-n\pi)|=|\sin x|$ for integer $n,$ and same for the cosine,
set $x-\pi=u$ in the second integral, $x-2\pi=v$ in the third and $x-3\pi=w$ in the fourth integral
Then we know  $\displaystyle|y|= \begin{cases} y &\mbox{if } y\ge 0 \\ -y  & \mbox{if } y<0\end{cases} $ 
and for $0\le x\le\pi,\sin x\ge0$  and
$\cos x \begin{cases} \ge0 &\mbox{if } 0\le x\le\frac\pi2 \\ <0  & \mbox{if } \frac\pi2<x<\pi\end{cases}$ 
