I need to calculate this integral:
$\int_0^\pi\frac {dx}{1+\sin^2x}$
I know how to solve $\int\frac {dx}{1+\sin^2x}$, I did it by substitute $t=\operatorname{cot}(x)$. But here in order to do the substitution I need to calculate the new limits by $t=\operatorname{cot}(0), t=\operatorname{cot}(\pi)$, but $\operatorname{cot}$ is not defined in $0$ and $\pi$ so I don't know how to find the new limits.
Any help will be appreciated!
The integral can still be evaluated with the substitution $x\mapsto\cot x$. First, multiply the numerator and denominator by $\csc^2x$ to get$$I=\int\limits_0^{\pi}dx\,\frac {\csc^2x}{\csc^2x+1}=\int\limits_0^{\pi}dx\,\frac {\csc^2x}{\cot^2x+2}$$Now substitute $x\mapsto\cot x$. The lower limit becomes $+\infty$ while the upper limit becomes $-\infty$. Hence$$\begin{align*}I & =-\int\limits_{\infty}^{-\infty}dx\,\frac 1{x^2+2}=\int\limits_0^{\infty}dx\,\frac 1{\left(\frac x{\sqrt2}\right)^2+1}\end{align*}$$The remaining integral can be evaluated in terms of the inverse tangent function, and the final answer comes out to be