Integrating by parts
$$\int\dfrac{x\cos x}{1+\sin^2 x} dx=x \tan ^{-1}(\sin (x))-\int\tan ^{-1}(\sin (x))\,dx$$ that is to say that
$$\int_{0}^{\frac{\pi}{2}}\dfrac{x\cos x}{1+\sin^2 x} dx=\frac{\pi ^2}{8}-\int_{0}^{\frac{\pi}{2}}\tan ^{-1}(\sin (x))\,dx$$
Now using
$$\tan ^{-1}(\sin (x))=\sum_{n=0}^\infty (-1)^n\frac{ \sin ^{2 n+1}(x)}{2 n+1}$$
$$\int_{0}^{\frac{\pi}{2}}\tan ^{-1}(\sin (x))\,dx=\sum_{n=0}^\infty \frac{(-1)^n }{2 n+1}\int_{0}^{\frac{\pi}{2}}\sin ^{2 n+1}(x)\,dx=\sum_{n=0}^\infty(-1)^n\frac{\sqrt{\pi } \,\Gamma (n+1)}{2 (2 n+1)\, \Gamma \left(n+\frac{3}{2}\right)}$$ and the summation is
$$\frac{\pi ^2}{8}-\frac{1}{2} \sinh ^{-1}(1)^2$$ So, for the integral, the result is just
$$\int_{0}^{\frac{\pi}{2}}\dfrac{x\cos x}{1+\sin^2 x} dx=\frac{1}{2} \sinh ^{-1}(1)^2=\frac{1}{2}\log^2(1+\sqrt{2})$$ already given by Sangchul Lee.