21

Evaluate : $$\int_0^{\frac{\pi}{2}}\ln ^2\left(\cos ^2x\right)\text{d}x$$ I found it can be simplified to $$\int_0^{\frac{\pi}{2}}4\ln ^2\left(\cos x\right)\text{d}x$$ I found the exact value in the table of integrals: $$2\pi\left(\ln ^22+\frac{\pi ^2}{12}\right)$$ Anyone knows how to evaluate this?

Ryan
  • 3,945
  • 3
    I assume the integrand is meant to be $(\ln(\cos^2x))^2$? The convention for powers of trigonometric functions is somewhat questionable, but at least it is very well established. When applied to other kinds of functions, not so much. An alternative interpretation would be an iterated logarithm. (To add to the confusion, one meets iterated logs more frequently than powers of logs, I think.) – Harald Hanche-Olsen Feb 11 '13 at 08:08
  • 1
    There is absolutely nothing confusing about the way the expression is written. I dont get where Harald's criticism is coming from. It has nothing to do with the question. – CogitoErgoCogitoSum Feb 11 '13 at 08:15
  • maple doesn't know the antiderivative, or even the value of the definite integral in closed form. Numerically about 8.186488. – coffeemath Feb 11 '13 at 08:52
  • 1
    The definite integral can be expressed in term of generalized hypergeometric function $8 _4F_3(\frac12,\frac12,\frac12,\frac12;\frac32,\frac32,\frac32;1)$ but I doubt this has any real use. – achille hui Feb 11 '13 at 09:22
  • @achillehui : Thx! I found the exact value in the table of integrals. – Ryan Feb 11 '13 at 10:21
  • @ryan: Interesting exact value! maple doesn't always find tricky indefinite integrals... – coffeemath Feb 11 '13 at 10:25
  • 1
    It would be interesting to know how to get the value. Just curiosity... – vonbrand Feb 11 '13 at 11:54

5 Answers5

19

I find a way to get the number using gamma functions, nothing is rigorous.

Consider the integral $I(\beta) = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}(\cos x)^\beta dx$. We know: $$2 \frac{d^2}{d\beta^2} I(\beta) \bigg|_{\beta=0} = 4 \int_{0}^{\frac{\pi}{2}} \ln^2(\cos x) dx$$ is the integral we want. Introduce $u = \frac{1 + \sin x}{2}$, we have:

$$\begin{align} I(\beta) &= \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}(\cos x)^{\beta-1} d\sin x\\ &= \int_0^1 (4 u (1-u))^{\frac{\beta-1}{2}} d( 2u )\\ &= 2^{\beta} \int_0^1 u^{\frac{\beta+1}{2}-1} (1-u)^{\frac{\beta+1}{2}-1} du\\ &= 2^{\beta} \frac{\Gamma(\frac{\beta+1}{2})^2}{\Gamma(\beta+1)} \end{align}$$ Using the taylor expansion of various terms at $\beta = 0$, $$\begin{align} 2^{\beta} &= 1 + \ln(2) \beta + \frac{\ln^2 2}{2}\beta^2 + \,...\\ \Gamma(\frac{\beta+1}{2}) &= \sqrt{\pi} \left( 1 - \frac{\gamma + 2\ln 2}{2} \beta + \frac{\pi^2+2( \gamma + 2\ln 2)^2}{16}\beta^2 + \, ...\right)\\ \Gamma(\beta+1) &= 1 -\gamma \beta + \frac{6\gamma^2 + \pi^2}{12} \beta^2 + \,... \end{align} $$ We get: $$\begin{align} &I(\beta) = \pi \left( 1 - \ln(2) \beta + \frac{\pi^2 + 12 \ln^2 2}{24}\beta^2 + \,... \right)\\ \implies &2 \frac{d^2}{d\beta^2} I(\beta)\bigg|_{\beta=0} = 2\pi \left( \frac{\pi^2}{12} + \ln^2 2 \right) \end{align}$$

achille hui
  • 122,701
  • Very brilliant solution! What inspire you to make that subsitution? :) $u=\frac{1+\sin x}{2}$ – Ryan Feb 11 '13 at 14:28
  • 4
    @Ryan because you have told us the exact value of the integral, the $\frac{\pi^2}{12}$ there make me wonder whether it comes from $\zeta(2)$. To get $\zeta(2)$, I start to play with $2^{nd}$ derivatives of various integrals which looks like the defining integral for gamma functions. – achille hui Feb 11 '13 at 14:53
13

Start with $$ \begin{align} \int_0^{\pi/2}\log(\sin(x))\,\mathrm{d}x &=\frac12\int_0^\pi\log(\sin(x))\,\mathrm{d}x\\ &=\int_0^{\pi/2}\log(\sin(2x))\,\mathrm{d}x\\ &=\int_0^{\pi/2}\Big(\log(2)+\log(\sin(x))+\log(\cos(x))\Big)\,\mathrm{d}x\\ &=\frac\pi2\log(2)+2\int_0^{\pi/2}\log(\sin(x))\,\mathrm{d}x\tag{1} \end{align} $$ Therefore, $$ \int_0^{\pi/2}\log(\sin(x))\,\mathrm{d}x=-\frac\pi2\log(2)\tag{2} $$


Next $$ \begin{align} \int_0^{\pi/2}\log^2(\sin(x))\,\mathrm{d}x &=\int_0^{\pi/2}\Big(\log(2)+\log(\sin(x))+\log(\cos(x))\Big)^2\,\mathrm{d}x\\ &=\frac\pi2\log^2(2)+4\log(2)\int_0^{\pi/2}\log(\sin(x))\,\mathrm{d}x\\ &+2\int_0^{\pi/2}\log(\sin(x))\log(\cos(x))\,\mathrm{d}x\\ &+2\int_0^{\pi/2}\log^2(\sin(x))\,\mathrm{d}x\tag{3} \end{align} $$ Using $(2)$ in $(3)$ yields $$ \int_0^{\pi/2}\log^2(\sin(x))\,\mathrm{d}x =\frac32\pi\log^2(2)-2\int_0^{\pi/2}\log(\sin(x))\log(\cos(x))\,\mathrm{d}x\tag{4} $$


As in this answer, we can use contour integration to get that $$ \begin{align} \int_0^\infty\frac{\log^2(x)}{1-x^2}\mathrm{d}x &=\int_0^\infty\frac{\log^2(ix)}{1+x^2}\mathrm{d}ix\\ &=i\int_0^\infty\frac{\left(\frac\pi2i+\log(x)\right)^2}{1+x^2}\mathrm{d}x\\ &=i\int_0^\infty\frac{\log^2(x)-\frac{\pi^2}{4}}{1+x^2}\mathrm{d}x -\pi\int_0^\infty\frac{\log(x)}{1+x^2}\mathrm{d}x\tag{5} \end{align} $$ Looking at the imaginary part of $(5)$, we see that $$ \int_0^\infty\frac{\log^2(x)}{1+x^2}\mathrm{d}x=\frac{\pi^3}8\tag{6} $$


With a change of variables, $(6)$ becomes $$ \begin{align} \frac{\pi^3}8 &=\int_0^{\pi/2}\log^2(\tan(x))\,\mathrm{d}x\\ &=\int_0^{\pi/2}\Big(\log^2(\sin(x))+\log^2(\cos(x))-2\log(\sin(x))\log(\cos(x))\Big)\,\mathrm{d}x\tag{7} \end{align} $$ which yields $$ \int_0^{\pi/2}\log^2(\sin(x))\,\mathrm{d}x =\frac{\pi^3}{16}+\int_0^{\pi/2}\log(\sin(x))\log(\cos(x))\,\mathrm{d}x\tag{8} $$


Adding twice $(8)$ to $(4)$ and dividing by $3$ gives $$ \int_0^{\pi/2}\log^2(\sin(x))\,\mathrm{d}x=\frac{\pi^3}{24}+\frac12\pi\log^2(2)\tag{9} $$ Therefore, $$ \int_0^{\pi/2}\log^2(\cos^2(x))\,\mathrm{d}x=\frac{\pi^3}{6}+2\pi\log^2(2)\tag{10} $$

robjohn
  • 345,667
7

A related problem. Using the substitution $ \cos(x) = y $, we have

$$ 4\int_0^{\frac{\pi}{2}}\ln^2\left(\cos x\right)\text{d}x = 4\int _{0}^{1}\!{\frac { \ln^2 \left( y \right)}{ \sqrt {1-{y}^{2}}}}{dy} = I. $$

To evaluate the last integral $I$, consider the integral

$$ F := 4\int _{0}^{1}\!{\frac { y^\alpha}{ \sqrt {1-{y}^{2}}}}{dy} = 2\,{\frac {\sqrt {\pi }\,\Gamma\left( \frac{\alpha}{2}+\frac{1}{2} \right) }{ \Gamma\left( \frac{\alpha}{2}+1 \right) }}. $$

$F$ was evaluated using the beta function. Now, $I$ follows directly from $F$ as

$$ I = F_{\alpha \alpha}|_{\alpha=0} = \frac{\pi}{6} \, \left( {\pi }^{2}+12\, \left( \ln \left( 2 \right) \right)^{2} \right) \sim 8.186488098. $$

Note 1: Maple can not give a closed form solution for this kind of integrals.

Note 2: One can evaluate more general integrals, for instance

$$ \int_0^{\frac{\pi}{2}}\ln^3\left(\cos ^2x\right)\text{d}x= -\pi \, \left( 6\,\zeta \left( 3 \right) +{\pi }^{2}\ln \left( 2 \right) +4\, \left( \ln \left( 2 \right) \right) ^{3} \right).$$

2

$$\int _{ 0 }^{ \frac { \pi }{ 2 } }{ { \sin }^{ 2m-1 }\left( x \right) { \cos }^{ 2n-1 }\left( x \right) dx } =B\left( m,n \right) \\ \int _{ 0 }^{ \frac { \pi }{ 2 } }{ { \sin }^{ 2m-1 }\left( x \right) { \left( { \cos }^{ 2 }x \right) }^{ \frac { 2n-1 }{ 2 } }dx } =B\left( m,n \right) $$

On differentiating it twice w.r.t. to n and taking $m=\frac{1}{2}$ and $n=\frac{1}{2}$, we get

$$\int _{ 0 }^{ \frac { \pi }{ 2 } }{ (\ln { \left( { \cos }^{ 2 }x \right) dx })^2 } =\frac { 1 }{ 2 } \frac { { \left( \Gamma \left( \frac { 1 }{ 2 } \right) \right) }^{ 2 } }{ 1 } \left\{ { \left( \psi \left( \frac { 1 }{ 2 } \right) -\psi \left( 1 \right) \right) }^{ 2 }+\psi '\left( \frac { 1 }{ 2 } \right) -\psi '\left( 1 \right) \right\} $$

$$\therefore \int _{ 0 }^{ \frac { \pi }{ 2 } }{ (\ln { \left( { \cos }^{ 2 }x \right) dx })^2 } =\frac { { \pi }^{ 3 } }{ 6 } +2\pi { \left( \ln { 2 } \right) }^{ 2 }$$

Hans
  • 9,804
Aditya Kumar
  • 1,491
1

First of all, substituting $x\to\frac\pi2-x$ yields

$$\int_0^{\frac\pi2} \ln(\cos^2(x)) \, dx = \int_0^{\frac\pi2} \ln(\sin^2(x)) \, dx = 2 \int_0^{\frac\pi2} \ln(\sin(x)) \, dx = -\pi\ln(2)$$

where the log-sine integral can be computed using the identity

$$\ln(\sin(x)) = -\ln(2) - \sum_{k=1}^\infty \frac{\cos(2kx)}k$$

Using the same substitution,

$$\int_0^{\frac\pi2} \ln^2(\cos^2(x)) \, dx = \int_0^{\frac\pi2} \ln^2(\sin^2(x)) \, dx = 4 \int_0^{\frac\pi2} \ln^2(\sin(x)) \, dx$$

In the identity above, square both sides and integrate:

$$\begin{align} \ln^2(\sin(x)) &= \ln^2(2) + 2\ln(2) \sum_{k=1}^\infty \frac{\cos(2kx)}k + \left(\sum_{k=1}^\infty \frac{\cos(2kx)}k\right)^2 \\[2ex] \int_0^{\frac\pi2} \ln^2(\sin(x)) \, dx &= \frac\pi2 \ln^2(2) - 2\ln(2) \int_0^{\frac\pi2} (\ln(2) + \ln(\sin(x)) \, dx \\[1ex] & \qquad + \int_0^{\frac\pi2} \sum_{k=1}^\infty \frac{\cos^2(2kx)}{k^2} \, dx + 2 \int_0^{\frac\pi2} \sum_{i<j}\frac{\cos(2ix)\cos(2jx)}{ij} \, dx\\[2ex] &= \frac\pi2 \ln^2(2) + \frac12 \sum_{k=1}^\infty \frac1{k^2} \int_0^{\frac\pi2} (1+\cos(4kx)) \, dx \\[1ex] &\qquad + \sum_{i<j} \frac1{ij} \int_0^{\frac\pi2} (\cos(2(i+j)x) + \cos(2(i-j)x)) \, dx \\[2ex] &= \frac\pi2\ln^2(2) + \frac\pi4 \sum_{k=1}^\infty \frac1{k^2} \\[2ex] &= \frac\pi2\ln^2(2) + \frac{\pi^3}{24} \end{align}$$

and so

$$\int_0^{\frac\pi2} \ln^2(\cos^2(x)) \, dx = \boxed{2\pi\ln^2(2) + \frac{\pi^3}6}$$

user170231
  • 19,334