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!

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.
