calculate $\int_0^{\pi}\frac {x}{1+\cos^2x}dx$ Same to the tag
calculate $\int_0^{\pi}\frac {x}{1+\cos^2x}dx$.
Have no ideas on that.
Any suggestion?
Many thanks
 A: Using $\int_a^bf(x)\ dx=\int_a^bf(a+b-x)\ dx$
$$I=\int_0^\pi\dfrac x{1+\cos^2x}dx=\int_0^\pi\dfrac{\pi-x}{1+\cos^2(\pi-x)}dx$$
$$I+I=\pi\int_0^\pi\dfrac1{1+\cos^2x}dx$$
$$\int_0^\pi\dfrac1{1+\cos^2x}dx=\int_0^\pi\dfrac{\sec^2x}{2+\tan^2x}dx$$
Set $\tan x=u$
A: Ok i think i found a way which is quiet different from the approaches above. It is based on the residue theorem using an rectangle with vertices $(0,0),(\pi,0),(\pi,\pi+ i R),(0, i R)$
Defining
$$
f(z)=\frac{z}{1+\cos^2(z)}
$$
We obtain
$$
\oint dz f(z)=\underbrace{\int_0^{\pi}f(x)dx}_{I}+i\pi\underbrace{\int_0^{R}\frac{1}{1+\cosh^2(y)}dy}_{K}+\underbrace{i\int_0^{R}f(iy)dy+i\int_R^{0}f(iy)dy}_{=0}+\underbrace{\int_0^{\pi}f(iR+x)dx}_{J}
=2\pi i\sum_j\text{Res}(f(z),z=z_j)
$$
It is now easy to show that $J$ vanishs in the limit $R \rightarrow\infty$ and that $z_0=\arccos(-i)=\frac{\pi}{2}+i\log(1+\sqrt{2})$ is the only zero of the denominator of $f(z)$ inside the contour of integration. We are therefore down to
$$
I=2\pi i \text{Res}(f(z),z=z_0)-i\pi K
$$
the last integral can be computed by standard methods (Weierstrass subsitution)and yields $K=\frac{\text{arctanh}(\sqrt{2})}{\sqrt{2}}$. One may also show that $\text{Res}(f(z),z=z_0)=\frac{\log(1+\sqrt{2})}{2\sqrt{2}}-i \pi\frac{1}{4\sqrt{2}}$. Playling a little bit with the logarithmic representation of arctanh we find that the imaginary parts cancel (as they should) and we end up with

$$
I=\frac{\pi^2}{2\sqrt{2}} 
$$

This numerically agrees with WA!
