TITLE: Finding $\int_{0}^{\pi/2} \frac{\tan x}{1+m^2\tan^2{x}} \mathrm{d}x$
QUESTION [12 upvotes]: How do we prove that $$I(m)=\int_{0}^{\pi/2} \frac{\tan x}{1+m^2\tan^2{x}} \mathrm{d}x=\frac{\log{m}}{m^2-1}$$
I see that $$I(m)=\frac{\partial}{\partial m} \int_{0}^{\pi/2} \arctan({m\tan x}) \ \mathrm{d}x$$
But I don't see how to use this fact. Can we? Please help me out, and if possible please post a solution using differentiation under the integral sign.

REPLY [10 votes]: Assume $m\gt0$ (since the integral is even in $m$) and substitute $t=\tan(x)$ and $u=t^2$:
$$
\begin{align}
\int_0^{\pi/2}\frac{\tan(x)}{1+m^2\tan^2(x)}\mathrm{d}x
&=\int_0^\infty\frac{t}{1+m^2t^2}\frac{\mathrm{d}t}{1+t^2}\\
&=\frac12\int_0^\infty\frac{\mathrm{d}u}{(1+m^2u)(1+u)}\\
&=\frac1{2(m^2-1)}\lim_{L\to\infty}\int_0^L\left(\frac{m^2}{1+m^2u}-\frac1{1+u}\right)\mathrm{d}u\\
&=\frac1{2(m^2-1)}\lim_{L\to\infty}\left[\int_0^{m^2L}\frac{\mathrm{d}u}{1+u}-\int_0^L\frac{\mathrm{d}u}{1+u}\right]\\
&=\frac1{2(m^2-1)}\lim_{L\to\infty}\int_L^{m^2L}\frac{\mathrm{d}u}{1+u}\\
&=\frac1{2(m^2-1)}\lim_{L\to\infty}\log\left(\frac{1+m^2L}{1+L}\right)\\
&=\frac{\log(m)}{m^2-1}
\end{align}
$$