# Evaluate ${\int_0^\infty e^{-t} \log(\cos^2 t)}\,\mathrm dt$

$$\int_0^\infty e^{-t} \log(\cos^2 t)\, \mathrm dt$$

How to evaluate a closed form of this integral ? My bet is to use the Cauchy Integral Theorem of Residues or the Laplace Transform.

• Mathematica can't evaluate it, which isn't a good sign. Is there some reason to suspect that the integral has a closed-form expression? – Jim Belk Jun 25 '13 at 19:46
• Integrating by parts, Maple produces $$\lim _{x\rightarrow \infty }-{{\rm e}^{-x}}\ln \left( \left( \cos \left( x \right) \right) ^{2} \right) -1/2\,\Psi \left( 1-1/4\,i \right) +\Psi \left( 1/2-1/4\,i \right) +1/2\,{\frac {\pi }{\cosh \left( \left( 1/2+1/2\,i \right) \pi \right) }}-1/2\,\Psi \left( -1 /4\,i \right) -1/2\,{\frac {\pi }{\cosh \left( \left( 1/2-1/2\,i \right) \pi \right) }} .$$ The question arises:"What for to find a closed form?" – user64494 Jun 25 '13 at 20:02

According to Mathematica, the indefinite integral is $$I(t) = 2i e^{-t}F\left(\begin{array}{c}i/2,1\\1+i/2\end{array}\middle|-e^{2it}\right) + \frac{4-2i}{5}e^{2it-t}F\left(\begin{array}{c}1+i/2,1\\2+i/2\end{array}\middle|-e^{2it}\right) - e^{-t}\log\cos^2 t,$$ which is discontinuous at the points $t=\frac\pi2+\pi k$ ($k$ integer). Now, the first contribution to the infinite integral is $$\lim_{t\to0}-I(t) = 2i-\psi\left(i/4\right)+\psi\left(\frac{2+i}{4}\right).$$ Let $f(-e^{2it})$ be one the hypergeometric functions above (the coefficients multiplying $f$ are continuous with $t$, so we need only consider the discontinuity of $f$). The contribution to the integral from the discontinuity of $f$ at $t=\frac\pi2+\pi k$ will come from $$-\lim_{\epsilon\to0+} + \lim_{\epsilon\to0-} f(1+2i\epsilon) = f(1-i0)-f(1+i0),$$ where $-e^{2i(\frac\pi2 + k\pi+\epsilon)} = 1+2i\epsilon + O(\epsilon^2)$.

According to Mathematica, the discontinuity of the first hypergeometric function is $\frac\pi2$ and for the second it is $(\frac12-i)\pi$. So now we need to sum over all the discontinuities, $k\geq0$ (where $t=\frac\pi2+k\pi$): $$\sum_{k\geq0} \frac{e^{-t}}{5}(4-2i)e^{2it}\left(\frac12-i\right)\pi = \pi i \sum_{k\geq0}e^{-\frac\pi2-k\pi} = \frac{i\pi}{2\sinh\frac\pi2}$$ for the second and $$\sum_{k\geq0} 2ie^{-t}\frac\pi2 = \frac{i\pi}{2\sinh\frac\pi2}$$ for the first.

Finally, for the third term, $g(t)=e^{-t}\log\cos^2 t$, although it is singular at $t=\frac\pi2+\pi k$, the discontinuity $\lim_{\epsilon\to0+}g(t-\epsilon)-g(t+\epsilon)$ is zero.

So the integral equals $$2i-\psi\left(\frac i4\right)+\psi\left(\frac{2+i}{4}\right) + \frac{i\pi}{\sinh\frac\pi2} = -1.0322554358\ldots.$$

• Another nice answer (+1). – Mhenni Benghorbal Jun 25 '13 at 22:55

First let $a>0$ and consider the following (computable) integral: \begin{align} I(a)&=\int_0^1 \ln \frac{x^{a}+x^{-a}}{2}dx=\\ &=-a-\ln 2+\int_0^{1}\ln(1+x^{-2a})dx=\\ &=-a-\ln 2+\frac{1}{2a}\int_1^{\infty}y^{-\frac{1}{2a}-1}\ln(1+y)dy=\\ &=a+\frac{\pi}{\sin\frac{\pi}{2a}}+\frac{1}{2}\left[\psi\left(\frac12-\frac{1}{4a}\right)-\psi\left(-\frac{1}{4a}\right)\right], \end{align} where $\psi(z)$ denotes the digamma function. The integral we want to calculate (here comes a little handwaving) is given by continuation of $I(a)+I(\bar{a})$ to complex $a$ (think of the change of variables $e^{-t}=x$ in the initial integral), evaluated at $a=i$.

This gives \begin{align} I(i)+I(-i)&=\frac{1}{2}\left[\psi\left(\frac12+\frac{i}{4}\right)+\psi\left(\frac12-\frac{i}{4}\right)-\psi\left(\frac{i}{4}\right)-\psi\left(-\frac{i}{4}\right)\right]=\\ &=\mathrm{Re}\left[\psi\left(\frac12+\frac{i}{4}\right)-\psi\left(\frac{i}{4}\right)\right], \end{align} which reproduces the earlier answer by Kirill.

• @Kirill Thanks! I've just understood how to reduce the handwaving and edited my answer accordingly (considering $I(a)+I(\bar{a})$ we avoid the problems with branch points as the argument of the logarithm remains always real positive). – Start wearing purple Jun 25 '13 at 22:31
• @O.L. When you introduce $y=e^{-2a\log x}$, how do you deform the contour image of $[0,1]$ into $[1,\infty)$ when $a$ has a non-zero imaginary part? The contour is a kind of a spiral and crosses the branch cut of the logarithm $y<-1$ and doesn't just go to $\infty$. To do analytic continuation to $a=i$ is it really enough for the function to be defined only on $a>0$? Also, $I(a)+I(\bar a)$ is not analytic in $a$, so surely you can analytically continue $I(a)$ but not $2\Re I(a)$? – Kirill Jun 26 '13 at 2:35
• @Kirill To be honest I have not tried to understand well enough the analytic continuation. My argument is loosely the following: when I have $\ln \cosh at\cosh \bar{a}t$, singularities in the log do not appear when we gradually pass from real to complex $a$. This will not be the case for $I(a)$ (containing $\ln\cosh at$ only) where the singularity structure is complicated. Already the fact that $I(a)\neq I(-a)$ is somewhat surprising. – Start wearing purple Jun 26 '13 at 18:08
• I got $\mathrm{Re}\left[\psi\left(\frac12+\frac i4\right)-\psi\left(1+\frac i4\right)\right]$, which I thought was different, but then I noticed that the difference was $\mathrm{Re}\left(\frac i4\right)$ :-) – robjohn Jun 26 '13 at 21:11

Here is a partial attempt. Perhaps this may lead to a closed form.

Integrating by parts twice yields \begin{align} \int_0^\infty\sin^{2n}(t)e^{-t}\,\mathrm{d}t &=2n\int_0^\infty\sin^{2n-1}(t)\cos(t)\,e^{-t}\,\mathrm{d}t\\ &=2n\int_0^\infty\left((2n-1)\sin^{2n-2}(t)-2n\sin^{2n}(t)\right)\,e^{-t}\,\mathrm{d}t\\ (4n^2+1)\int_0^\infty \sin^{2n}(t)e^{-t}\,\mathrm{d}t &=(4n^2-2n)\int_0^\infty\sin^{2n-2}(t)\,e^{-t}\,\mathrm{d}t \end{align} Therefore, \begin{align} \int_0^\infty\sin^{2n}(t)e^{-t}\,\mathrm{d}t &=\prod_{k=1}^n\frac{2k(2k-1)}{4k^2+1}\\ &=\frac{(2n)!}{\prod\limits_{k=1}^n(4k^2+1)} \end{align} Now \begin{align} \int_0^\infty e^{-t}\log(\cos^2(t))\,\mathrm{d}t &=\int_0^\infty\log\left(1-\sin^2(t)\right)\,e^{-t}\,\mathrm{d}t\\ &=-\sum_{n=1}^\infty\int_0^\infty\frac1n\sin^{2n}(t)\,e^{-t}\,\mathrm{d}t\\ &=-2\sum_{n=1}^\infty\frac{(2n-1)!}{\prod\limits_{k=1}^n(4k^2+1)} \end{align} The terms of the last sum decay like $n^{-3/2}$, so the sum does converge, although slowly.

As derived in my other post, the integral is equal to the simpler looking sum $$\int_0^\infty e^{-t}\log(\cos^2(t))\,\mathrm{d}t=\sum_{k=1}^\infty(-1)^k\frac{8k}{4k^2+1}$$ At least $4k^2+1$ is still in the denominator.

• I got stuck at exactly the same spot. This last sum is really annoying to deal with. – Eric Naslund Jun 25 '13 at 20:32
• (+1) you can get a closed form for the sum in terms of the hypergemetric function $$-\frac{2}{5}\,{{_2F_{3}}(1,3/2;\,1/2,2+1/2\,i,2-1/2\,i;\,1/4)}$$ with infinite radius of convergence. – Mhenni Benghorbal Jun 25 '13 at 22:50
• @MhenniBenghorbal: thanks! I have added another approach that should match this hypergeometric one. – robjohn Jun 26 '13 at 21:07

Another approach

Using the formula $$\sum_{k=1}^\infty\left(\frac1k-\frac1{k+z}\right)=\psi(z+1)+\gamma\tag{1}$$ we get \begin{align} \sum_{k=1}^\infty(-1)^k\frac1{k+z} &=\sum_{k=1}^\infty\left(\frac1{2k}-\frac1{2k-1+z}\right)-\left(\frac1{2k}-\frac1{2k+z}\right)\\ &=\frac12\sum_{k=1}^\infty\left(\frac1{k}-\frac1{k+\frac{z-1}{2}}\right) -\frac12\sum_{k=1}^\infty\left(\frac1{k}-\frac1{k+\frac{z}{2}}\right)\\ &=\frac12\left(\psi\left(\frac{z+1}{2}\right)+\gamma\right) -\frac12\left(\psi\left(\frac{z+2}{2}\right)+\gamma\right)\\ &=\frac12\psi\left(\frac{z+1}{2}\right)-\frac12\psi\left(\frac{z+2}{2}\right)\tag{2} \end{align} Applying $(2)$ to the question yields \begin{align} \int_0^\infty\log(\cos^2(t))\,e^{-t}\,\mathrm{d}t &=2\,\mathrm{Re}\left(\int_0^\infty\log(\cos(t))\,e^{-t}\,\mathrm{d}t\right)\\ &=2\,\mathrm{Re}\left(\int_0^\infty\left(\color{#C00000}{\log(e^{it})}+\log(1+e^{-2it})\color{#00A000}{-\log(2)}\right)\,e^{-t}\,\mathrm{d}t\right)\\ &=\color{#00A000}{-2\log(2)}-2\sum_{k=1}^\infty\mathrm{Re}\left(\int_0^\infty\frac{(-1)^k}{k}e^{-2kit}\,e^{-t}\,\mathrm{d}t\right)\\ &=-2\log(2)-2\sum_{k=1}^\infty\mathrm{Re}\left(\frac{(-1)^k}{k}\frac1{1+2ki}\right)\\ &=-2\log(2)-2\sum_{k=1}^\infty(-1)^k\mathrm{Re}\left(\frac1k-\frac1{k+\frac1{2i}}\right)\\ &=2\sum_{k=1}^\infty(-1)^k\mathrm{Re}\left(\frac1{k+\frac1{2i}}\right)\\ &=\sum_{k=1}^\infty(-1)^k\left(\frac1{k+\frac1{2i}}+\frac1{k-\frac1{2i}}\right)\\ &=\frac12\psi\left(\frac12+\frac i4\right) +\frac12\psi\left(\frac12-\frac i4\right)\\ &-\frac12\psi\left(1+\frac i4\right) -\frac12\psi\left(1-\frac i4\right)\tag{3} \end{align} This agrees with the other answers, and plugging into Mathematica yields

N[1/2(PolyGamma[1/2+I/4]+PolyGamma[1/2-I/4] -PolyGamma[1+I/4]-PolyGamma[1-I/4]), 20]

$-1.03225543583966217044$