0

So I was trying to solve this integral (I'm not asking how to solve it) and I thought I did some progress but I can't figure out what I've done. (See below) This integral converges, and I got to something which is indeterminate plus another integral which I suppose is convergent. WolframAlpha shows that the numerical value of this last integral is the same as that of the original integral, so I suppose the indeterminate part should cancel to 0. However, I think I got $- \infty$, which doesn't make sense for what I said. Therefore, my question: Does the indeterminate part approach $- \infty$? Does it approach 0? How do you compute it? And anyway, is there anything wrong with my approach (something should definitely be wrong...) ?

$$\int_0^{\frac{\pi}{2}} \ln^2\left({\cos{x}}\right) = x \ln^2\left({\cos{x}} \right) \Big|_0^{\frac{\pi}{2}} +2 \int_0^{\frac{\pi}{2}} x \tan{x} \ln\left({\cos{x}}\right)dx = x \ln^2\left({\cos{x}} \right) \Big|_0^{\frac{\pi}{2}} +2 \int_{-\infty}^0 u \arccos\left({e^u}\right) du = x \ln^2\left({\cos{x}} \right) \Big|_0^{\frac{\pi}{2}} +2 \int_{-\infty}^0 u \left( \frac{\pi}{2} - \arcsin\left({e^u}\right)\right) du = x \ln^2\left({\cos{x}} \right) \Big|_0^{\frac{\pi}{2}} + \frac{\pi}{2} u^2 \Big|_{-\infty}^0 - 2\int_{-\infty}^0 u \arcsin\left({e^u}\right)du$$

First I did integration by parts and then change of variable $\ln\left(\cos{x}\right) = u$

3 Answers3

1

From Fourier series of Log sine and Log cos we have \begin{eqnarray*} -\log(\cos(x))=\sum_{k=1}^\infty(-1)^k\frac{\cos(2kx)}{k}+\log(2). \end{eqnarray*} Square this & integrate, the only terms that will survive, give \begin{eqnarray*} I= \frac{ \pi}{2} \left( (\ln(2))^2+ \frac{1}{2} \sum_{k=1}^{\infty} \frac{1}{k^2} \right) = \frac{ \pi}{2} \left( (\ln(2))^2+ \frac{\pi^2}{12} \right). \end{eqnarray*}

Donald Splutterwit
  • 36,613
  • 2
  • 26
  • 73
0

I will present a solution using a different approach for those curious. First, substitute $u=\frac{\pi}{2}-x$, then add the original integral: \begin{align*} 2I&=\int_0^{\frac{\pi}{2}} \ln^2\left(\sin{x}\right)+\ln^2\left(\cos{x}\right) \; \mathrm{d}x \\ &= \frac{1}{2} \underbrace{\int_0^{\frac{\pi}{2}} {\left(\ln\left(\frac{\sin{2x}}{2}\right)\right)}^2 \; \mathrm{d}x}_{\mathcal{I}_1}+ \frac{1}{2} \underbrace{\int_0^{\frac{\pi}{2}}{\left(\ln\left(\tan{x}\right)\right)}^2 \; \mathrm{d}x}_{\mathcal{I}_2}\ \end{align*}

Now, to evaluate $\mathcal{I}_1$ use logarithm properties to obtain: \begin{align*} \int_0^{\frac{\pi}{2}} {\left(\ln\left(\frac{\sin{2x}}{2}\right)\right)}^2 \; \mathrm{d}x &= \int_0^{\frac{\pi}{2}} \left(\ln\left(\sin{2x}\right) \right)^2\; \mathrm{d}x- 2\ln{2}\int_0^{\frac{\pi}{2}} \ln\left(\sin{2x}\right)\; \mathrm{d}x+\left(\ln{2}\right)^2\int_0^{\frac{\pi}{2}} \; \mathrm{d}x\\ &=I+\pi \left(\ln{2}\right)^2+\frac{\pi}{2}\left(\ln{2}\right)^2 \\ &=I+\frac{3\pi}{2}\left(\ln{2}\right)^2 \\ \end{align*}

For $\mathcal{I}_2$, substitute $t=\tan{x}$: \begin{align*} \int_0^{\frac{\pi}{2}} {\left(\ln\left(\tan{x}\right)\right)}^2 \; \mathrm{d}x &= \int_0^{\infty} \frac{\ln^2{t}}{1+t^2} \; \mathrm{d}t\\ &= \int_0^{1} \frac{\ln^2{t}}{1+t^2} \; \mathrm{d}t+\int_1^{\infty} \frac{\ln^2{t}}{1+t^2} \; \mathrm{d}t\\ &= 2\int_1^{\infty} \frac{\ln^2{t}}{1+t^2} \; \mathrm{d}t\\ &= 2\int_1^{\infty} \frac{t^{-2}\ln^2{t}}{1+t^{-2}} \; \mathrm{d}t\\ &= 2\int_1^{\infty} \sum_{n=1}^{\infty} (-1)^n t^{-2n} \ln^2{t} \; \mathrm{d}t\\ &= 2\sum_{n=1}^{\infty} (-1)^n\int_1^{\infty} t^{-2n} \ln^2{t} \; \mathrm{d}t\\ &= 4\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{(2n-1)^3}\\ &= \frac{\pi^3}{8} \\ \end{align*}

In conclusion, \begin{align*} 2I &= \frac{\mathcal{I}_1}{2}+\frac{\mathcal{I}_2}{2} \\ &=\frac{I+\frac{3\pi}{2}\left(\ln{2}\right)^2 +\frac{\pi^3}{8}}{2}\\ \int_0^{\frac{\pi}{2}} \ln^2\left(\cos{x}\right) \; \mathrm{d}x &= \boxed{\color{blue}{\frac{\pi}{2}\ln^2{2}+\frac{\pi^3}{24}}} \\ \end{align*}

Ty.
  • 5,434
  • 1
    I appreciate your answer, really, I'll have a look at it later at my own pace. I don't want to sound rude but I actually wrote at the start that I wasn't asking how to solve the integral, but what is the value of the indeterminate part at the end. I don't like looking for different approaches until I understand what I did wrong. I hope you understand – user267998 Sep 03 '20 at 14:34
  • Okay, sorry. I just found an approach that I enjoyed and figured I'd post it here (maybe other users will appreciate this answer more). I haven't looked at your final integral in-depth but it may not be an efficient approach. – Ty. Sep 03 '20 at 14:41
  • I didn't even try to compute the last integral. I'm aware it won't help too much, but I assume it converges, so the two improper integral evaluations before that should converge (cancel infinities). That's what I'm asking essentially, what is $x \ln^2\left({\cos{x}} \right) \Big|0^{\frac{\pi}{2}} + \frac{\pi}{2} u^2 \Big|{-\infty}^0$ – user267998 Sep 03 '20 at 14:53
0

The problem with your approach lies in the equality$$\int_0^{\pi/2}\log^2(\cos x) \,\mathrm dx= \left.x \log^2(\cos x) \right|_0^{\pi/2} +2 \int_0^{\pi/2} x \tan{x} \log\left(\cos x\right)\,\mathrm dx,$$since it says that the number that you want to compute is $\infty-\infty$, and $\infty-\infty$ is undefined.