How to show that $\int_{0}^{\pi}(1+2x)\cdot{\sin^3(x)\over 1+\cos^2(x)}\mathrm dx=(\pi+1)(\pi-2)?$

Using the fact that $$ \int_0^\pi xf(\sin x)\,dx=\frac\pi2\int_0^\pi f(\sin x)\,dx $$ and that $\cos^2=1-\sin^2x$ (so that this applies), you get that your integral equals $$ (1+\pi)\int_0^\pi \frac{\sin^3 x}{1+\cos^2x}\,dx $$ Writing $$ \frac{\sin^3 x}{1+\cos^2x}=\frac{(1-\cos^2x)\sin x}{1+\cos^2x}=\frac{2}{1+\cos^2x}\sin x-\sin x $$ we find that your integral equals $$ (1+\pi)\bigl[-2\arctan(\cos x)+\cos x\bigr]_0^\pi=(1+\pi)(\pi-2). $$


I am not sure this is the easiest (but it is a viable approach). Note that the antiderivative of $v'=\sin^3 x/(1+\cos^2 x)$ is given by $v=\cos x -2 \arctan \cos x$. Thus, we can integrate the problem by parts and obtain $$I = (\cos x -2 \arctan \cos x)(1+2x)\Big|_{x=0}^\pi -2 \underbrace{\int_0^\pi(\cos x -2 \arctan \cos x)dx}_{=I_2}.$$

Now you can observe that $v=\cos x -2 \arctan \cos x$ is antisymmetric around $x=\pi/2$ (because $\cos$ is antisymmetric around $x=\pi/2$ and $\arctan$ is antisymmetric around $x=0$). Thus, the remaining integral vanishes $(I_2=0)$ and we obtain $$I = (\cos x -2 \arctan \cos x)(1+2x)\Big|_{x=0}^\pi= (\pi+1)(\pi-2).$$