# Finding $\int_{0}^{\pi/2} \frac{\tan x}{1+m^2\tan^2{x}} \mathrm{d}x$

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.

• the substitution $\arctan(y)=x$ simplifies the first integral a lot... – tired Nov 4 '14 at 15:44
• Indeed, the result is $${\ln\left(\,\left\vert\, m\,\right\vert\,\right) \over m^{2} - 1}$$ – Felix Marin Dec 5 '14 at 0:25

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}

$\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) $$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$$ 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 $$\artanh x=\sum_{n=0}\frac{x^{2n+1}}{2n+1}\qquad,\qquad\mbox{for}\,\, |x|<1$$ and identity $$\artanh x=\frac{1}{2}\ln\left(\frac{1+x}{1-x}\right)\qquad,\qquad\mbox{for}\,\, |x|<1$$

• interesting approach! – tired Nov 4 '14 at 17:02
• $${}(╥︣﹏᷅╥){}$$ – Anastasiya-Romanova 秀 Dec 8 '14 at 12:34

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$.

• Why do you complicate it with the additional parameter $b$? You could just say that $I(m) = \int_0^\infty \frac{y}{1+m^2y^2}\frac1{1+y^2}dy$ by substitution $x=\arctan y$, where $\arctan$ is the inverse of $\tan{\upharpoonright}_{(-\pi/2,\pi/2)}$. There's nothing wrong with this, as $\lim_{x\to0+}\tan x=0$ and $\lim_{x\to\pi/2-}\tan x=\infty$ – user2345215 Nov 4 '14 at 21:16
• thanks for your comment, but for me both explanations have the same order of complexity. But maybe that's a matter of taste – tired Nov 5 '14 at 12:49


\begin{align} {\rm I}\pars{m}& =\color{#66f}{\large\int_{0}^{\pi/2}{\sin\pars{x}\cos\pars{x}\over \cos^{2}\pars{x} + m^{2}\sin^{2}\pars{x}}\,\dd x} \\[5mm]&=\half\int_{0}^{\pi/2}{\sin\pars{2x}\over \bracks{1 + \cos\pars{2x}}/2 + m^{2}\bracks{1 - \cos\pars{2x}}/2}\,\dd x \\[5mm]&=\int_{0}^{\pi/2}{\sin\pars{2x}\over 1 + m^{2} + \pars{1 - m^{2}}\cos\pars{2x}}\,\dd x \\[5mm]&=\left.{\ln\pars{1 + m^{2} + \bracks{1 - m^{2}}\cos\pars{2x}}\over -2\pars{1 - m^{2}}} \right\vert_{\, x\ =\ 0}^{\, x\ =\ \pi/2} \\[5mm]&={\ln\pars{2m^{2}} - \ln\pars{2}\over 2\pars{m^{2} - 1}} =\color{#66f}{\large{\ln\pars{\verts{m}} \over m^{2} - 1}} \end{align}