How can I show that $ \int_0^\pi \frac{x\,dx}{1+\cos^2(x)} = \frac{\pi^2}{2\sqrt{2}} $ Show that $$ \int_0^\pi  \frac{x\,dx}{1+\cos^2(x)} = \frac{\pi^2}{2\sqrt{2}}  $$
I tried using change of variable $x = \pi-y$ and then ended up with integral $\int_0^\pi \frac{1}{1+\cos^2(y)}dy$ which I think doesn't make thing easier.  I am wondering if there is any other clever change of variable or some trick to compute this original integral. 
 A: I think your start is good. I add that part for completeness.
$$
\begin{align}
I & =\int_0^{\pi}\frac{x}{1+\cos^2x}\,dx=[y=\pi-x]\\
&=\int_0^\pi\frac{\pi-y}{1+\cos^2y}\,dy\\
&=\pi\int_0^\pi\frac{1}{1+\cos^2y}\,dy-I,
\end{align}
$$
and so
$$
I=\frac{\pi}{2}\int_0^\pi \frac{1}{1+\cos^2y}\,dy.
$$
This way we got rid of the $x$ in the numerator. 
Then, let us use this trick:
$$
\frac{1}{1+\cos^2y}=\frac{1}{\sin^2y+2\cos^2y}=\frac{1}{\sin^2y}\frac{1}{1+2\cot^2y}.
$$
Let $u=\cot y$. This leads to
$$
\int_{-\infty}^{+\infty}\frac{1}{1+2u^2}\,du,
$$
which I'm sure you can calculate.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{\int_{0}^{\pi}\frac{x\,\dd x}{1 + \cos^{2}\pars{x}}
     =\frac{\pi^{2}}{2\root{2}}:\ {\large ?}}$.
\begin{align}&\color{#66f}{\large%
\int_{0}^{\pi}\frac{x\,\dd x}{1 + \cos^{2}\pars{x}}}
=\int_{-\pi/2}^{\pi/2}\frac{x + \pi/2}{1 + \sin^{2}\pars{x}}\,\dd x
=\pi\int_{0}^{\pi/2}\frac{\dd x}{1 + \sin^{2}\pars{x}}
=\pi\int_{0}^{\pi/2}\frac{\dd x}{2 - \cos^{2}\pars{x}}
\\[5mm]&=\pi\int_{0}^{\pi/2}\frac{\sec^{2}\pars{x}\,\dd x}{2\sec^{2}\pars{x} - 1}
={\pi \over \root{2}}\int_{0}^{\pi/2}
\frac{\root{2}\sec^{2}\pars{x}\,\dd x}{\bracks{\root{2}\tan\pars{x}}^{2} + 1}
={\pi \over \root{2}}\int_{0}^{\infty}\frac{\dd x}{x^{2} + 1}
\\[5mm]&={\pi \over \root{2}}\,{\pi \over 2}
=\color{#66f}{\large\frac{\pi^{2}}{2\root{2}}}
\end{align}
A: I think your change of variables is wrong, but anyway. Split into integral of $x$ and integral of $$x(\tan^2(x) +1)$$ then use the identity $$\frac{1}{\cos^2(x)}= \tan^2(x) + 1$$ First term you can compute and for the second term just use integration by parts noting that $\tan^2(x) + 1$ is the derivative of $\tan(x)$. 
