Finding $\int_{0}^{\pi/2} \frac{\tan x}{1+m^2\tan^2{x}} \mathrm{d}x$
Solution 1:
$\def\artanh{{\rm{artanh}}\;}$Denote the evaluated integral as $I$ and rewrite it as follows \begin{align} I&=\frac{1}{2}\int_0^{\Large\frac{\pi}{2}}\frac{\sin2x}{\cos^2x+m^2\sin^2x}\,dx\\ &=\int_0^{\Large\frac{\pi}{2}}\frac{\sin2x}{m^2+1-(m^2-1)\cos2x}\,dx\\ &=\frac{1}{2}\int_0^{\large\pi}\frac{\sin x}{m^2+1-(m^2-1)\cos x}\,dx\\ \end{align}
where we use trigonometric identity $\sin^2\theta=\dfrac{1-\cos2\theta}{2}$ and $\cos^2\theta=\dfrac{1+\cos2\theta}{2}$ and map $2x\mapsto x$. Now, using identity (proof can be seen here) \begin{equation} 1+2\sum_{n=1}^\infty \left(\frac{b}{a}\right)^n\cos(n x)=\frac{a^2-b^2}{a^2+b^2-2ab\cos x}\qquad,\qquad\mbox{for}\, |b|<a \end{equation} and the correspondence values $a=\dfrac{m+1}{\sqrt{2}}$ and $b=\dfrac{m-1}{\sqrt{2}}$, one may find \begin{align} I&=\frac{1}{4m}\int_0^{\large\pi}\left[\sin x+2\sum_{n=1}^\infty \left(\frac{m-1}{m+1}\right)^n\cos(nx)\sin x\right]\,dx\\ &=\frac{1}{2m}+\frac{1}{2m}\sum_{n=2}^\infty \left(\frac{m-1}{m+1}\right)^n\int_0^{\large\pi}\cos(nx)\sin x\,dx\\ &=\frac{1}{2m}-\frac{1}{2m}\sum_{n=2}^\infty \left(\frac{m-1}{m+1}\right)^n\frac{\cos(n\pi)+1}{n^2-1}\\ &=\frac{1}{2m}-\frac{1}{m}\sum_{n=1}^\infty \left(\frac{m-1}{m+1}\right)^{2n}\frac{1}{4n^2-1}\\ &=\frac{1}{2m}-\frac{1}{2m}\left[1+\left(\frac{m-1}{m+1}\right)\artanh\left(\frac{m-1}{m+1}\right)-\left(\frac{m+1}{m-1}\right)\artanh\left(\frac{m-1}{m+1}\right)\right]\\ &=\frac{2}{m^2-1}\artanh\left(\frac{m-1}{m+1}\right)\\ &=\frac{\ln m}{m^2-1}\qquad\qquad\square \end{align} For the last step evaluation, we use Taylor series for $\artanh$function \begin{equation} \artanh x=\sum_{n=0}\frac{x^{2n+1}}{2n+1}\qquad,\qquad\mbox{for}\,\, |x|<1 \end{equation} and identity \begin{equation} \artanh x=\frac{1}{2}\ln\left(\frac{1+x}{1-x}\right)\qquad,\qquad\mbox{for}\,\, |x|<1 \end{equation}
Solution 2:
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} $$
Solution 3:
Using my hint from the comment above ($x=\arctan(y)$) and assuming that $m$ is real and finite gives us \begin{align} I(m)=\int_0^{b}\frac{dy}{1+y^2}\frac{y}{1+y^2m^2}\ \end{align}
Where $b=\lim_{y\to\pi/2}\tan(y)$ this limit has to be taken with some care because it diverges. Calculating the above Integral by standard methods (partial fractions works)gives us \begin{align} I(m)=\frac{1}{2}\dfrac{\log\left(\dfrac{1}{1+b^2}+\dfrac{m^2 b^2}{1+b^2}\right)}{m^2-1} \end{align}
Choosing the correct branch of $\tan(y)$ (so that our range of integration is continous) we get $b=+\infty$. This leads to
\begin{align} I(m)=\frac{1}{2}\frac{\log(m^2)}{m^2-1}=\frac{\log(m)}{m^2-1} \end{align}
Maybe one should add that $\lim_{m\to 1}I(m)=1/2$ and therefore is well defined.This can be seen by for example by Taylor expansion of $\log$ around $1$.