# Prove $\int_0^\infty \frac{\ln \tan^2 (ax)}{1+x^2}\,dx = \pi\ln \tanh(a)$

$$\mbox{How would I prove}\quad \int_{0}^{\infty} {\ln\left(\,\tan^{2}\left(\, ax\,\right)\,\right) \over 1 + x^{2}}\,{\rm d}x =\pi \ln\left(\,\tanh\left(\,\left\vert\, a\,\right\vert\,\right)\,\right)\,{\Large ?}. \qquad a \in {\mathbb R}\verb*\* \left\{\,0\,\right\}$$

-
Doesn't look like the indefinite integral has a elementary closed form. – Joe Jan 27 '13 at 3:27
See here: math.stackexchange.com/questions/285960/… (essentially the same thing, asked a few days ago) – L. F. Jan 27 '13 at 3:49
$\ln y^2=2\ln y$ – Lucian Nov 17 '13 at 23:26
@Ethan It should be $\displaystyle\large \pi\ln\left(\,\tanh\left(\,\left\vert\, a\,\right\vert\,\right)\,\right)\,,\quad a \not= 0$. – Felix Marin Nov 17 '14 at 5:02

Here is another solution:

We remark that

$$\log\tan^{2}\theta = -4 \sum_{n \ \mathrm{odd}}^{\infty}\frac{1}{n}\cos 2n\theta \tag{1}$$

and

$$\sum_{n \ \mathrm{odd}}^{\infty} \frac{1}{n} x^{n} = \frac{1}{2}\log\left(\frac{1+x}{1-x}\right). \tag{2}$$

Both are easily proved by using Euler's formula $e^{i\theta} = \cos\theta + i\sin\theta$ and the Taylor series of the logarithm. Also we note that

$$\int_{0}^{\infty} \frac{t \sin t}{a^2 + t^2} \, dt = \frac{\pi}{2} e^{-|a|}. \tag{3}$$

Then

\begin{align*} \int_{0}^{\infty} \frac{\log\tan^2(ax)}{1+x^2} \, dx &= \int_{0}^{\infty} \log\tan^2(ax) \left( \int_{0}^{\infty} \sin t \, e^{-xt} \, dt \right) \, dx \\ &= \int_{0}^{\infty} \sin t \int_{0}^{\infty} e^{-tx} \log\tan^2(ax) \, dxdt \\ &= -4 \int_{0}^{\infty} \sin t \int_{0}^{\infty} \sum_{n \ \mathrm{odd}}^{\infty}\frac{1}{n} e^{-tx} \cos (2nax) \, dxdt \\ &= -4 \int_{0}^{\infty} \sin t \sum_{n \ \mathrm{odd}}^{\infty}\frac{1}{n} \frac{t}{4a^{2}n^{2} + t^{2}} \, dt \\ &= -4 \sum_{n \ \mathrm{odd}}^{\infty} \frac{1}{n} \int_{0}^{\infty} \frac{t \sin t}{4a^{2}n^{2} + t^{2}} \, dt \\ &= -2\pi \sum_{n \ \mathrm{odd}}^{\infty} \frac{1}{n} e^{-2an} = \pi \log \left( \frac{1-e^{-2a}}{1+e^{-2a}} \right) \\ &= \pi \log (\tanh a). \end{align*}

-
Very nice. Where did you learn these techniques? I have seen you give similar impressive integral computations on many other questions. – Potato Jan 27 '13 at 4:02
@Potato, Actually I learned these techniques by myself. But I think that many other people are already aware of these. – Sangchul Lee Jan 27 '13 at 4:19
How did you learn them? Was there a book or paper that was especially useful? I've seen similar tricks ("backwards" conversion of terms to integrals, power series) used by a few physicists, so I wonder if these techniques are taught in books on mathematical methods for physics. – Potato Jan 27 '13 at 4:24
Thank You so much! – Integrals and Series Jan 27 '13 at 8:48
@sos440: this proof is good for a collection with very nice proofs (+1) :-) – I'm an artist Jan 27 '13 at 9:20

An idea with complex contour. Let us choose the path

$$C_R:=[-R,R]\cup\gamma_R:=\{z\in\Bbb C\;;\;z=Re^{it}\,\,,\,0\leq t\leq \pi\}\,\,,\,0<<R\in\Bbb R$$

Take the function

$$f(z):=\frac{\operatorname{Log}(\tan^2az)}{1+z^2}=2\frac{\operatorname{Log}(\tan az)}{1+z^2}$$

Inside the domain enclosed by $\,C_R\,$ above, the function has the pole $\,z=i\,$ (note that at the poles of $\,\tan az\,$ the logarithmic function equals $\,0+\arg(\text{pole})\,$ , and since we're going to choose the branch along the cut from zero to $\,-i\infty \,$ , i.e. the negative y-axis all these give us zero, so we're left only with the zero of the denominator in the positive half complex plane:

$$Res_{z=i}(f)=2\lim_{z\to i}(z-i)\frac{\operatorname{Log}(\tan az)}{z^2+1}=2\frac{\operatorname{Log}(\tan ai)}{2i}=-i\log(\tanh a)$$

We also have that

$$\left|\int_{\gamma_R}2\frac{\operatorname{Log}(\tan az)}{1+z^2}dz\right|\leq2\frac{|\log|\tan az||}{1-R^2}R\pi\xrightarrow[R\to\infty]{}0$$

as using the form (with $\,z=x+yi\,\,,\,x,y\in\Bbb R\,\,,\,y>0\,$)

$$\tan az=\frac{e^{2aiz}-1}{e^{2aiz}+1}\Longrightarrow |\log|\tan az||\leq \left|\log\frac{1+e^{2iy}}{1-e^{2iy}}\right|\xrightarrow [y\to\infty]{}\log 1=0$$

Thus, we finally get by Cauchy's Theorem

$$2\pi i(-i\log(\tanh a))=2\pi\log(\tanh a)=\oint_{C_R} f(z)\,dz=$$

$$=\int\limits_{-R}^R\frac{\log(\tan^2 ax)}{1+x^2}dx+\int_{\gamma_R}f(z)\,dz\xrightarrow[R\to\infty]{}\int\limits_{-\infty}^\infty\frac{\log(\tan^2 x)}{1+x^2}dx$$

Now just divide by two the integral of the even function above and we're done.

-
"Infinitely many branch...*points*...? Along the real axis? No and no to both your questions. Read here in "branch cuts" and around: en.wikipedia.org/wiki/Complex_logarithm#Branch_cuts – DonAntonio Mar 13 '13 at 23:16
@RandomVariable, I think you don't quite know exactly what a branch cut is (not point). Google it, read it books, in the link I sent you...At the origin, $\log z\,$ isn't defined... but...that's not the matter: if you go "around" $\,z=0\,$ , the argument of complex numbers increases (or decreases, depending on the spinning direction) by an integer multiple of $\,2\pi\,$, and this makes the value of $\,\log z:= \log|z|+i\arg z\,$ multivalued, and from here that branch cutes are chosen to "prevent" that spinning and make $\,\log\,$ single valued...it's too messy to explain here. – DonAntonio Mar 14 '13 at 2:10

Denote the evaluated integral as $I$, then $I$ may be rewritten as $$I=\int_0^\infty \frac{\ln \sin^2 ax}{1+x^2}\,dx-\int_0^\infty \frac{\ln \cos^2 ax}{1+x^2}\,dx$$ Using Fourier series representations of $\ln \sin^2 \theta$ and $\ln \cos^2 \theta$, $$\ln \sin^2 \theta=-2\ln2-2\sum_{k=1}^\infty \frac{\cos2k\theta}{k}$$ and $$\ln \cos^2 \theta=-2\ln2+2\sum_{k=1}^\infty (-1)^{k+1}\frac{\cos2k\theta}{k}$$ also note that $$\int_0^\infty\frac{\cos bx}{1+x^2}\,dx=\frac{\pi e^{-b}}{2}$$ then \begin{align}I&=-2\sum_{k=1}^\infty \frac{1}{k}\int_0^\infty\frac{\cos2kax}{1+x^2}\,dx-2\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\int_0^\infty\frac{\cos2kax}{1+x^2}\,dx\\&=-\pi\sum_{k=1}^\infty \frac{e^{-2ak}}{k}-\pi\sum_{k=1}^\infty (-1)^{k+1}\frac{e^{-2ak}}{k}\\&=\pi\ln\left(1-e^{-2a}\right)-\pi\ln\left(1+e^{-2a}\right)\\&=\pi\ln\left(\frac{1-e^{-2a}}{1+e^{-2a}}\right)\\&=\pi\ln\left(\tanh a\right)\end{align}

-

By equating the real parts on both sides of the identity $$\sum_{k=1}^{\infty} \frac{(be^{i \theta })^{k}}{k} = -\log(1-be^{i \theta}) \ , \ |b| < 1,$$ one finds that $$\sum_{k=1}^{\infty} \frac{b^{k} \cos k\theta }{k} = - \frac{1}{2} \log \left(1-2b \cos \theta +b^{2} \right).$$

Then for $a >0$, \begin{align}\int_{0}^{\infty} \frac{\log(1-2b \cos 2ax +b^{2})}{1+x^{2}} \ dx &= -2\int_{0}^{\infty}\frac{1}{1+x^{2}}\sum_{k=1}^{\infty} \frac{b^{k} \cos (2akx)}{k} \\ &=-2 \sum_{k=1}^{\infty} \frac{b^{k}}{k}\int_{0}^{\infty} \frac{\cos (2ak x)}{1+x^{2}} \ dx \\ &=-\pi \sum_{k=1}^{\infty} \frac{(be^{-2a})^{k}}{k} \\ &= \pi \log(1-be^{-2a}). \end{align}

Letting $b \to 1^{-}$, $$\int_{0}^{\infty} \frac{\log (4 \sin^{2} ax)}{1+x^{2}} \ dx = \pi \log(1-e^{-2a}). \tag{1}$$

While letting $b \to -1^{+}$, $$\int_{0}^{\infty} \frac{\log(4 \cos^{2} ax)}{1+x^{2}} \ dx = \pi\log(1+e^{-2a}). \tag{2}$$

Then subtracting $(2)$ from $(1)$, $$\int_{0}^{\infty} \frac{\log (\tan^{2} ax)}{1+x^{2}} \ dx = \pi \log \left(\frac{1-e^{-2a}}{1+e^{-2a}} \right) =\pi \log( \tanh a) .$$

-