Trigonometric Substitution in $\int _0^{\pi/2}{\frac{ x\cos x}{ 1+\sin^2 x} dx }$ Evaluate $$ \int _{ 0 }^{ \pi /2 }{ \frac { x\cos { (x) } }{ 1+\sin ^{ 2 }{ x } } \ \mathrm{d}x } $$
$$$$
The solution was suggested like this:$$$$
SOLUTION:
First of all its, quite obvious to have substitution $ \sin(x) \rightarrow x $
$$ I = \int_{0}^{1} \frac{\arcsin(x)}{1+x^2} \ \mathrm{d}x$$
Now using integration by parts,
$$ I = \frac{\pi^2}{8} - \int_{0}^{1} \frac{\arctan(x)}{\sqrt{1-x^2}} \ \mathrm{d}x$$
Could someone please explain these two steps to me? For example, how do we get $\arcsin(x)$ in the numerator?
Thanks a lot!
 A: Since setting $\sin x=u$ gives you
$$x=\arcsin u,\ \ \ \mathrm{d}u=\cos x \ \mathrm{d}x,$$
you have
$$\begin{align}\int_{0}^{\pi/2}\frac{x\cos x}{1+\sin^2x}\ \mathrm{d}x&=\int_{0}^{1}\frac{\arcsin u}{1+u^2}\ \mathrm{d}u\\&=\int_{0}^{1}(\arctan u)'\arcsin u\ \ \mathrm{d}u\\&=[\arctan u\arcsin u]_{0}^{1}-\int_{0}^{1}\frac{\arctan u}{\sqrt{1-u^2}}\ \mathrm{d}u\\&=\frac{\pi^2}{8}-\int_{0}^{1}\frac{\arctan u}{\sqrt{1-u^2}}\ \mathrm{d}u\end{align}$$
A: It's a change of variables.
If $y=\sin(x)$, $x=\arcsin(y)$ and $dy=\cos(x)dx$, so $x\cos(x)dx=\arcsin(y)dy$. Then you also have to change the bounds of the integral.
Knowing that :


*

*the derivative of $x\mapsto \arcsin(x)$ is $x\mapsto\frac{1}{1-\sqrt{x^2}}$

*the derivative of $x\mapsto \arctan(x)$ is $x\mapsto\frac{1}{1+x^2}$
the second part is simple if you know how to integrate by parts.
A: You may obtain

$$
\int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx=\frac12 \log^2 (1+\sqrt{2}) . \tag1
$$

Proof. First observe that
$$\begin{align}
\int_0^\pi \frac{x\cos x}{1+\sin^2 x}\:dx &= \int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx + \int_{\pi/2}^{\pi} \frac{x\cos x}{1+\sin^2 x}\:dx \\ 
& = \int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx - \int_0^{\pi/2} \frac{(x+\pi/2)\sin x}{1+\cos^2 x}\:dx \\ 
&= 2\int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx - \pi\int_0^{\pi/2} \frac{\cos x}{1+\sin^2 x}\:dx  \\ 
&= 2\int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx - \pi \left[\arctan u\right]_0^1\\
&= 2\int_0^{\pi/2} \frac{x\cos x}{1+\sin^2 x}\:dx - \frac{\pi^2}{4}.
\end{align}
$$
Then evaluate
$$
\int_0^{\pi}\frac{x \cos{x}}{1+\sin^2{x}} {\rm d}x
$$
using for example this approach.
