How to evaluate $\int_0^{\pi/4} \ln^2\cos x dx$?

244 Views Asked by At

I got this expressions from D. F. Connon's article, "Some series and integrals involving the Riemann zeta function, binomial coefficients and the harmonic numbers", which is in arxiv.org: $$2\ln^2\cos x=\sum_{n=2}^{\infty}\frac{(-1)^nH_{n-1}}{n}\tan^{2n}x$$ It is obtained from a series for $\ln^2(1+x)$. Here, $H_{n-1}=1+\frac12+\frac13+...\frac{1}{n-1}$ is $(n-1)$-th harmonic number.

I also evaluated these integrals by WA: $\int_{0}^{\pi/4}\tan^{2n}xdx$

But, it is not easy to put all these stuff into a closed form. Probably this is not a good aproach. I also tried $e^{ix}$ approach by using series of $\ln^2(1+x)$. But it also gives complicated sums. I didn't continue. I am confused and dismotivated.

Is my approach the best way? Is there another approach? How to evaluate $\int_0^{\pi/4} \ln^2\cos x dx$ or $\int_0^{\pi/2} \ln^2\cos x dx$? Can it done by a contour integral and some residues?

Thanks in advance.

3

There are 3 best solutions below

3
On BEST ANSWER

Evaluating $\int_0^{\frac{\pi}{2}} \ln^2(\cos x)\mathrm{d}x:$ Using \begin{equation*} \ln^2(\cos x)=\ln^2(2\cos x)-2\ln(2)\ln(\cos x)-\ln^2(2), \end{equation*} we have \begin{equation*} \int_0^{\frac{\pi}{2}} \ln^2(\cos x)\mathrm{d}x=\int_0^{\frac{\pi}{2}}\ln^2(2\cos x)\mathrm{d}x-2\ln(2)\int_0^{\frac{\pi}{2}}\ln(\cos x)\mathrm{d}x-\int_0^{\frac{\pi}{2}}\ln^2(2)\mathrm{d}x. \end{equation*} The third integral is $\frac{\pi}{2}\ln^2(2)$ and the second integral is $-\frac{\pi}{2}\ln(2)$ . For the first one, use \begin{equation*} \ln^2(2\cos x)=x^2+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\cos(2nx), \end{equation*} to have \begin{gather*} \int_0^{\frac{\pi}{2}}\ln^2(2\cos x)\mathrm{d}x=\int_0^{\frac{\pi}{2}}x^2\mathrm{d}x+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\int_0^{\frac{\pi}{2}}\cos(2nx)\mathrm{d}x\\ =\frac{\pi^3}{24}+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\cdot\frac{\sin(2nx)}{2n}\bigg|_0^{\frac{\pi}{2}}\\ =\frac{\pi^3}{24}+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\cdot\frac{\sin(n\pi)}{2n}\\ \{\text{the sum evaluates to $0$, since $\sin(n\pi)=0$ for integer $n$}\}\\ =\frac{\pi^3}{24}. \end{gather*} Combining the three integrals gives

\begin{equation} \int_0^{\frac{\pi}{2}} \ln^2(\cos x)\mathrm{d}x=\frac{\pi}{2}\ln^2(2)+\frac{\pi^3}{24}.\label{ln^2sinx} \end{equation}


Evaluating $\int_0^{\frac{\pi}{4}} \ln^2(\cos x)\mathrm{d}x:$ Similarly

\begin{equation*} \int_0^{\frac{\pi}{4}} \ln^2(\cos x)\mathrm{d}x=\int_0^{\frac{\pi}{4}}\ln^2(2\cos x)\mathrm{d}x-2\ln(2)\int_0^{\frac{\pi}{4}}\ln(\cos x)\mathrm{d}x-\int_0^{\frac{\pi}{4}}\ln^2(2)\mathrm{d}x. \end{equation*}

The third integral is $\frac{\pi}{4}\ln^2(2)$ and the second integral is $\frac12G-\frac{\pi}{2}\ln(2)$ . For the first one,

\begin{gather*} \int_0^{\frac{\pi}{4}}\ln^2(2\cos x)\mathrm{d}x=\int_0^{\frac{\pi}{4}}x^2\mathrm{d}x+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\int_0^{\frac{\pi}{4}}\cos(2nx)\mathrm{d}x\\ =\frac{\pi^3}{192}+2\sum_{n=1}^\infty (-1)^n\frac{H_{n-1}}{n}\cdot\frac{\sin(n\pi/2)}{2n}\\ \left\{\text{note that $\sum_{n=1}^\infty a_n\sin(n\pi/2)=\sum_{n=0}^\infty (-1)^{n} a_{2n+1}=\Im\sum_{n=1}^\infty i^{n} a_{n}$}\right\}\\ =\frac{\pi^3}{192}-\Im\sum_{n=1}^\infty i^n\frac{H_{n-1}}{n^2}\\ =\frac{\pi^3}{192}-\Im\{\zeta(3)-\operatorname{Li}_3(1-i)+\ln(1-i)\operatorname{Li}_2(1-i)+\frac12\ln(i)\ln^2(1-i)\}\\ =\frac{7\pi^3}{192}+\frac{\pi}{16}\ln^2(2)+\frac{1}{2}G\ln(2)+\Im\,\operatorname{Li}_3(1-i). \end{gather*}

where we used the generating function

$$\sum_{n=1}^\infty\frac{H_{n-1}}{n^2}x^{n}=\zeta(3)-\operatorname{Li}_3(1-x)+\ln(1-x)\operatorname{Li}_2(1-x)+\frac12\ln(x)\ln^2(1-x).$$

Combine the three integrals,

$$\int_0^{\frac{\pi}{4}}\ln^2(\cos x)\mathrm{d}x=\frac{7\pi^3}{192}+\frac{5\pi}{16}\ln^2(2)-\frac{1}{2}G\ln(2)+\Im\,\operatorname{Li}_3(1-i).$$

0
On

There is an antiderivative, given, for sure, in terms of a nasty hypergeometric function.

Assuming $0 \leq x \leq \frac \pi 2$, Mathematica produces for $$I=\int [\log(\cos(x)]^2\,dx$$ $$I=-\log ^2(\sec (x)) \sin ^{-1}(\cos (x))-2\cos(x) A$$ with $$A=\, _4F_3\left(\frac{1}{2},\frac{1}{2},\frac{1}{2},\frac{1}{2};\frac{3}{ 2},\frac{3}{2},\frac{3}{2};\cos ^2(x)\right)+$$ $$\log (\sec (x)) \, _3F_2\left(\frac{1}{2},\frac{1}{2},\frac{1}{2};\frac{3}{2},\frac{3}{2};\cos ^2(x)\right)$$ which is not the most pleasant if you look for an explicit result of the definite integrals. Using the resul of the summation $$\sum_{n=2}^{\infty}\frac{(-1)^nH_{n-1}}{n}\tan^{2n}(x)=\text{Li}_2\left(\cos ^2(x)\right)-\text{Li}_2\left(-\tan ^2(x)\right)+$$ $$4 \log (\sin (x)) \log (\cos (x))-\frac{\pi ^2}{6}$$ I have no idea for its integration.

4
On

(Too long for a comment.) We have

$$\int_{0}^{\pi/4}\ln^{2}\left(\cos x\right)dx = \frac{1}{4}\int_{0}^{1}\frac{\ln^{2}\left(1+x^{2}\right)}{1+x^{2}}dx = \frac{1}{4}\int_{0}^{1}\frac{\ln^{2}\left(\frac{2\left(1+x^{2}\right)}{\left(1+x\right)^{2}}\right)}{1+x^{2}}dx$$

by the transformations $x \mapsto \arctan(x)$ and $x \mapsto \dfrac{1-x}{1+x}$.

Expanding this integral yields

$$\int_{0}^{1}\frac{\ln^{2}\left(1+x\right)}{1+x^{2}}dx+\frac{1}{4}\int_{0}^{1}\frac{\ln^{2}\left(1+x^{2}\right)}{1+x^{2}}dx+\frac{\ln^{2}\left(2\right)}{4}\int_{0}^{1}\frac{1}{1+x^{2}}dx$$

$$-\int_{0}^{1}\frac{\ln\left(1+x\right)\ln\left(1+x^{2}\right)}{1+x^{2}}dx-\ln\left(2\right)\int_{0}^{1}\frac{\ln\left(1+x\right)}{1+x^{2}}dx+\frac{\ln\left(2\right)}{2}\int_{0}^{1}\frac{\ln\left(1+x^{2}\right)}{1+x^{2}}dx.$$

The third integral is trivial. The rest of the integrals can be evaluated through the help of Pisco's and Ali Shadhar's answers. Combining each messy evaluation results in

$$\int_{0}^{\pi/4}\ln^{2}\left(\cos x\right)dx = \frac{7\pi^{3}}{192}-\frac{G\left(\ln2\right)}{2}+\frac{5\pi\ln^{2}\left(2\right)}{16}-\Im\left(\operatorname{Li}_{3}\left(1-i\right)\right)$$

where $G$ denotes Catalan's Constant and $\operatorname{Li}_n(z)$ denotes the Polylogarithm Function.

Numerical approximations can be viewed here since there are a lot of computations.