TITLE: On the way of evaluate $\int_{0}^{\pi}\frac{dx}{1+2\sin^{2}x}$.
QUESTION [5 upvotes]: Evaluate
  $$\int_{0}^{\pi}\frac{dx}{1+2\sin^2x}$$

My approach
$$\Longrightarrow\int_{0}^{\pi}\frac{dx}{1+2\sin^{2}x}=2\int_{0}^{\frac{\pi}{2}}\frac{\sec^{2}x}{1+3\tan^{2}x}dx=\frac{2}{\sqrt{3}}\left[\tan^{-1}\left(\sqrt{3}\tan x\right)\right]_{0}^{\frac{\pi}{2}}$$
$\tan x$ is undefined at $\dfrac{\pi}{2}$.
So I need to solve $\lim_{x\rightarrow\frac{\pi}{2}}$$\left[\tan^{-1}\left(\sqrt{3}\tan x\right)\right]$. I don't know how to solve.

REPLY [4 votes]: Note that as $x \to \frac{\pi}{2}$, $\sqrt{3}\tan(x) \to \infty$, therefore $\tan^{-1}(\infty) = \frac{\pi}{2}$