I have the following task:
On an interval $[0,a]$ one can use the substitution $y=a-x$ to try and exploit symmetry about the midpoint $a/2$
1) Evaluate $\int^{\pi}_0\frac{x\sin(x)}{1+\cos^2(x)}dx$
Where it is recommended to try the substitution $x=\pi-y$.
I tried using the substitution but I get nowhere with it:
$$\int^{\pi}_0\frac{x\sin(x)}{1+\cos^2(x)}dx$$
Substitution $u=\pi-x \Rightarrow du=-dx\Rightarrow$
$$-\int^0_{\pi}\frac{(\pi-u)\sin(\pi-u)}{1+\cos^2(\pi-u}du=\int^{\pi}_0\frac{(\pi-u)\sin(\pi-u)}{1+\cos^2(\pi-u)}du=$$
$$\int^{\pi}_0\frac{\pi \sin(\pi-u)}{1+\cos^2(\pi-u)}du-\int^{\pi}_0\frac{u\sin(\pi-u)}{1+\cos^2(\pi-u)}=$$
$$\int^{\pi}_0\frac{\pi \sin(u)}{1+\cos^2(u)}-\int^{\pi}_0\frac{u\sin(u)}{1+\cos^2(u)}$$
Well, I don't know what to do. I have been trying to tackle this integral with other different strategies but to no avail. Any help hinting how can I use the "midpoint" thing that the exercise mentions in the beginning?
$$\small I=\int_0^\pi\frac{x\sin x}{1+\cos^2x}{\rm d}x\stackrel{x\mapsto\pi-x}=\int_0^\pi\frac{(\pi-x)\sin(\pi-x)}{1+\cos^2(\pi-x)}{\rm d}x=\int_0^\pi\frac{(\pi-x)\sin x}{1+\cos^2x}{\rm d}x=\int_0^\pi\frac{\pi\sin x}{1+\cos^2x}-I$$ $$\therefore I=\frac\pi2\int_0^\pi\frac{\sin x}{1+\cos^2x}\stackrel{\cos x\mapsto x}=\frac\pi2\int_{-1}^1\frac{{\rm d}x}{1+x^2}=\frac\pi2\left[\arctan x\right]_{-1}^1=\frac{\pi^2}4$$
The key is to recognize the expression after the substitution $x\mapsto\pi-x$ as an elementary integral (doable via the substitution $\cos x\mapsto x$) minus the original integral $I$. From here we can obtain by solving the equation.