Integrate $\int_{0}^{\pi}{\frac{x\cos{x}}{1+\sin^{2}{x}}dx}$ Integrate
$$\displaystyle \int_{0}^{\pi}{\frac{x\cos{x}}{1+\sin^{2}{x}}dx}$$
 A: Here's a more elementary way:$$J=\int_0^\pi\frac{x \cos(x) dx}{1+\sin^2(x)}= \int_0^\frac{\pi}{2} \frac{x \cos(x)dx}{1+\sin^2(x)}+\int_0^\frac{\pi}{2} \frac{-x \sin(x)dx}{1+\cos^2(x)}-\frac{\pi}{2} \int_\frac{\pi}{2}^0 \frac{- \sin (x) dx}{1+\cos^2(x)}$$
$$J=I_1-I_2-\frac{\pi^2}{8}$$

$$I_1=\int_0^\frac{\pi}{2} \frac{ x\cos(x) dx}{1+\sin^2(x)}= \sum_{k \ge 0}(-1)^k \int_0^\frac{\pi}{2} x \cos(x) \sin^{2k}(x)dx$$
$$= \sum_{k \ge 0}(-1)^k \left( \frac{\pi}{2}\frac{1}{2k+1}- \frac{1}{2k+1}\int_0^\frac{\pi}{2} \sin^{2k+1}(x) dx \right)$$
, using the beta function,
$$= \sum_{k \ge 0}(-1)^k \left( \frac{\pi}{2}\frac{1}{2k+1}- \frac{1}{2k+1}\frac{\Gamma(k+1)\sqrt{\pi}}{\Gamma(k+1+\frac{1}{2})} \right)$$
, and the Legendre duplication formula,
$$= \sum_{k \ge 0}(-1)^k \left( \frac{\pi}{2}\frac{1}{2k+1}- \frac{1}{2k+1}\frac{\Gamma(k+1)^22^{2k+1}}{\Gamma(2k+2)} \right)$$
$$= \sum_{k \ge 0}(-1)^k \left( \frac{\pi}{2}\frac{1}{2k+1}- \frac{1}{(2k+1)^2}\frac{2^{2k+1}}{\binom{2k}{k}} \right)$$
$$= \frac{\pi}{2}\arctan(1)-\sum_{k \ge 0}(-1)^k  \frac{1}{(2k+1)^2}\frac{2^{2k+1}}{\binom{2k}{k}} $$
$$\stackrel{\text{Mathematica}}{=} \frac{\pi^2}{8}-\frac{\pi^2}{8}+ \frac{1}{2}\sinh^{-1}(1)^2 $$
$$I_1= \frac{1}{2}\sinh^{-1}(1)^2 $$

$$I_2=\int_0^\frac{\pi}{2} \frac{ x\sin(x) dx}{1+\cos^2(x)}= \sum_{k \ge 0}(-1)^k \int_0^\frac{\pi}{2} x \sin(x) \cos^{2k}(x)dx$$
$$= \sum_{k \ge 0}(-1)^k \frac{1}{2k+1}\int_0^\frac{\pi}{2}   \cos^{2k+1}(x)dx$$
$$= \sum_{k \ge 0}(-1)^k \frac{1}{2k+1}\int_0^\frac{\pi}{2}   \sin^{2k+1}(x)dx$$
$$I_2=\frac{\pi^2}{8}- \frac{1}{2} \sinh^{-1}(1)^2$$

Thus 
$$J=\sinh^{-1}(1)^2- \frac{\pi^2}{4}.$$
A: With some calculations, we obtain
$$ \int_{0}^{\pi} \frac{x \cos x}{1+\sin^2 x} \, dx = 4 \chi_{2}(1-\sqrt{2})$$
where
$$ \chi_{2}(z) = \sum_{n=0}^{\infty} \frac{z^{2n+1}}{(2n+1)^2} $$
is the Legendre chi function of order 2. By exploiting some identities involving dilogarithm, we find that 
$$ \chi_{2}(1-\sqrt{2}) = \frac{1}{4} \log^2 (1+\sqrt{2}) - \frac{3}{8}\zeta(2). $$
This gives the answer 
$$\int_{0}^{\pi} \frac{x \cos x}{1+\sin^2 x} \, dx = \log^2(1+\sqrt{2}) - \frac{\pi^2}{4}. $$
Some detailed calculations, though written in Korean, can be found in my blog posting.
