# log-trig integral with sin, cos, and tan

Here is another log-trig integral you may find challenging/fun. Or not :)

$$\int_{0}^{\frac{\pi}{2}}\ln(1+\sin(x))\ln(1+\cos(x))\tan(x)dx=\frac{\pi^{2}}{8}\ln(2)-\frac{5}{16}\zeta(3)$$

• Are you just throwing integrals around? Do you have a question? – naslundx Aug 7 '14 at 19:13
• @naslundx He's implicitly asking how one would show that LHS=RHS. – beep-boop Aug 7 '14 at 20:25
• Weierstraß substitution gives: $$\int_0^1\ln\left(\frac{(t+1)^2}{t^2+1}\right)\ln\left(\frac{2}{t^2+1}\right) \frac{4t}{1-t^4}dt$$I don't know what to do from here. – Akiva Weinberger Aug 8 '14 at 5:04
• I also tried that same sub, columbus. So, since there are some talented and brilliant mathematicians on SE, I thought perhaps they may like this one. I made a sub and arrived at the equivalent $\int_{0}^{1}\frac{\ln(1+\sqrt{1-x^{2}})\ln(x+1)}{x}dx$. I also tried writing it as $\int_{0}^{\frac{\pi}{2}}\frac{\ln(2\sin^{2}(\frac{x}{2}+\frac{\pi}{4}))\ln(2 \cos^{2}(x/2))\sin(x)}{\cos(x)}dx$, for what it's worth. :) I also derived a double sum involving Gamma, but it was certainly not any easier. – Cody Aug 8 '14 at 10:23
• I have seen that thread. That is a nice solution, M. But, this problem has $1+\sin(x), \;\ 1+\cos(x)$, which makes it more difficult. We can get rid of those by rewriting it as I mentioned in the above comment. – Cody Aug 8 '14 at 17:19

The integral equals

$$\int_0^1 dx\, \ln \left( 1 + \sqrt{1-x^2} \right) \frac{\ln(1+x)}{x} \\= \left. -\text{Li}_2(-x) \ln \left( 1 + \sqrt{1-x^2} \right) \right\lvert_0^1 + \int_0^1 dx\, \text{Li}_2(-x)\frac{1}{x} \left[1 - \frac{1}{\sqrt{1-x^2}} \right] \\=\text{Li}_3(-1)-\int_0^1 dx\, \frac{\text{Li}_2(-x)}{x\sqrt{1-x^2}}.$$ Now, $\text{Li}_3(-1) = -\beta(3) = -\left(1 - 2^{1-3}\right) \zeta(3) = -\frac{3}{4} \zeta(3)$. In the second term, write $\text{Li}_2(-x)$ as a series and interchange summation and integration: $$-\int_0^1 dx\, \frac{\text{Li}_2(-x)}{x\sqrt{1-x^2}} = \sum_{k\geq 1} \frac{(-1)^{k-1}}{k^2} \int_0^1 dx\,x^{k-1} \left(1-x^2\right)^{-1/2} = \sum_{k\geq 1} \frac{(-1)^{k-1}}{2k^2} B\left(\frac{k}{2},\frac{1}{2}\right).$$

We calculate this sum, following Cody's suggestion to start with $$\sum_{k\geq 1} (-1)^{k-1} B\left(\frac{k}{2},\frac{1}{2}\right) x^{k-1} = \frac{\pi - 2\arcsin x}{\sqrt{1-x^2}}.$$ Integrating once from $0$ to $x$ yields $$\sum_{k\geq 1} \frac{(-1)^{k-1}}{k} B\left(\frac{k}{2},\frac{1}{2}\right) x^{k} = \pi \arcsin x -\arcsin^2 x.$$ Dividing by $x$ and integrating from $0$ to $1$ yields $$\sum_{k\geq 1} \frac{(-1)^{k-1}}{k^2} B\left(\frac{k}{2},\frac{1}{2}\right) = \int_0^{\pi/2}dx\, \frac{\pi x \cos x}{\sin x} - \frac{x^2 \cos x}{\sin x} \\= -\int_0^{\pi/2}dx\, \pi \ln \sin x-2x\ln \sin x = \frac{\pi^2}{2} \ln 2 + 2 \int_0^{\pi/2}dx\, x\ln \sin x.$$ The latter integral can be calculated as follows: use the identity $\ln \sin x = -\ln 2 -\sum_{k\geq0} \cos(2 k x)$ and interchange summation and integration. This gives the value $$2\int_0^{\pi/2}dx\, x\ln \sin x = -\dfrac{\pi^2}{4}\ln 2 + \beta(3) = -\dfrac{\pi^2}{4}\ln 2 + \dfrac{7}{8} \zeta(3).$$ Adding everything up yields the correct value of the integral:

$$-\frac{3}{4} \zeta(3) + \frac{1}{2} \left[\frac{\pi^2}{2} \ln 2 -\dfrac{\pi^2}{4}\ln 2 + \dfrac{7}{8} \zeta(3)\right] = \frac{\pi^2}{8} \ln 2 - \frac{5}{16} \zeta(3).$$

• :):):) Like me, I knew you'd would obsess until you got it. Cool. – Cody Aug 9 '14 at 14:44
• Nicely done. +1 – Random Variable Aug 9 '14 at 15:07

Very good input Jack. Clever use of the Fourier ln sum.

It would appear I managed to make some headway.

First, make the sub $t=\cos(x)$ to get:

$$-\int_{0}^{1}\frac{\ln(1+\sqrt{1-t^{2}})\ln(1+t)}{t}dt$$

Use the series for ln(1+t):

$$\int_{0}^{1}\ln(1+\sqrt{1-t^{2}})\sum_{k=1}^{\infty}\frac{(-1)^{k+1}t^{k-1}}{k}dt$$

Now, use the ln identity for arcsech(t):

$$\int_{0}^{1}\left(sech^{-1}(t)+\ln(t)\right)\sum_{k=1}^{\infty}\frac{(-1)^{k+1}t^{k-1}}{k}dt$$

distribute:

$$\int_{0}^{1}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}t^{k-1}sech^{-1}(t)}{k}dt+\int_{0}^{1}\sum_{k=1}^{\infty}\frac{(-1)^{k}t^{k-1}\ln(t)}{k}$$

upon integrating the right side and noting the sum is a alternating zeta, we arrive at

$\displaystyle \frac{-3}{4}\zeta(3)\tag{1}$

The left side $\displaystyle \sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{k}\int_{0}^{1}t^{k-1}sech^{-1}(t)dt$

make the sub $u=sech^{-1}(t), \;\ t=sech(u), \;\ dx=-\frac{\tanh(u)}{\cosh(u)}du$

$$\sum_{k=1}^{\infty}\frac{(-1)^{k}}{k}\int_{0}^{\infty}\frac{u\sinh(u)}{\cosh^{k+1}(u)}du$$

This integral can be related to the Beta function, and has probably already been done on the site.

That is, there is a general form that can be used:

$$\int_{0}^{\infty}\frac{u\sinh(u)}{\cosh^{2n+1}(u)}du=\frac{\sqrt{\pi}}{4n}\cdot \frac{\Gamma(n)}{\Gamma(n+1/2)}$$

But, in this case, $n=k/2$, so we get:

$$\frac{\sqrt{\pi}}{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}\Gamma(k/2)}{k^{2}\Gamma(k/2+1/2)}$$

This sum evaluates to $$\frac{7}{16}\zeta(3)+\frac{\pi^{2}}{8}\ln(2)$$

combine this with the zeta result from up top in (1) and we get:

$$\frac{7}{16}\zeta(3)+\frac{\pi^{2}}{8}\ln(2)-\frac{3}{4}\zeta(3)$$

$$=\frac{\pi^{2}}{8}\ln(2)-\frac{5}{16}\zeta(3)$$

this works out and numerically checks.

For the above Gamma sum, one could begin with the series:

$$\frac{\sqrt{\pi}}{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}\Gamma(k/2)}{\Gamma(k/2+1/2)}x^{k-1}=\frac{\cos^{-1}(x)}{\sqrt{1-x^{2}}}\tag{2}$$, then integrate, divide by x, integrate, in order to hammer it into the proper form. I just ran through the steps with maple and it came out correctly.

EDIT: Derive closed form in (2):

$$\sum_{k=1}^{\infty}\frac{(-1)^{k-1}\Gamma(k/2)}{\Gamma(k/2+1/2)}x^{k-1}$$

$$=\sum_{k=1}^{\infty}(-1)^{k-1}\beta(k/2,1/2)x^{k-1}$$

$$=\sum_{k=1}^{\infty}\int_{0}^{1}t^{k/2-1}(1-t)^{-1/2}(-x)^{k-1}dt$$

$$=\int_{0}^{1}\frac{1}{\sqrt{t-t^{2}}(\sqrt{t}x+1)}dt$$

I'm sure there are more efficient ways, but I am just going to do this with subs.

Let $\displaystyle u=\sqrt{t}, \;\ dt=2udu$

$$2\int_{0}^{1}\frac{1}{\sqrt{1-u^{2}}(ux+1)}du$$

Let $\displaystyle u=sin(w)$

$$\int_{0}^{\frac{\pi}{2}}\frac{1}{\sin(w)x+1}dw$$

Let $\displaystyle w=2\tan^{-1}(z)$

$$4\int_{0}^{1}\frac{1}{z^{2}+2xz+1}dz=\frac{4\tan^{-1}\left(\frac{x+z}{\sqrt{1-x^{2}}}\right)}{\sqrt{1-x^{2}}}|_{0}^{1}$$

This is now not too bad and integrates in terms of arctan, which in turn can be converted to arccos:

$z=1$: $$4\frac{\tan^{-1}\left(\frac{x+1}{\sqrt{1-x^{2}}}\right)}{\sqrt{1-x^{2}}}=\frac{\pi+2\sin^{-1}(x)}{\sqrt{1-x^{2}}}$$

$z=0$ $$4\frac{\tan^{-1}\left(\frac{x}{\sqrt{1-x^{2}}}\right)}{\sqrt{1-x^{2}}}=\frac{4\sin^{-1}(x)}{\sqrt{1-x^{2}}}$$

because $\displaystyle \pi -2\sin^{-1}(x)=2\cos^{-1}(x)$:

$$\frac{2\sin^{-1}(x)+\pi}{\sqrt{1-x^{2}}}-\frac{4\sin^{-1}(x)}{\sqrt{1-x^{2}}}=\frac{2\cos^{-1}(x)}{\sqrt{1-x^{2}}}$$

• Nice derivation of the closed form of the series! – user111187 Aug 18 '14 at 9:00

I think is it possible to exploit the fact the the two logarithmic factor have nice Fourier series. Since over $(0,\pi/2)$ we have: $$\log(2\cos x)=\sum_{n=1}^{+\infty}\frac{(-1)^{n+1}}{n}\cos(2nx),$$ $$\log(2\sin x)=-\sum_{n=1}^{+\infty}\frac{1}{n}\cos(2nx),$$ it follows that: $$\log(1+\sin t)=-\log 2+\sum_{k=1}^{+\infty}\frac{(-1)^{k+1}}{k}\cos(kx),$$ $$\log(1+\cos t)=-\log 2+\sum_{k=1}^{+\infty}\frac{(-1)^{k+1}}{k}\cos(2kx)+2\sum_{k=0}^{+\infty}\frac{(-1)^{k}}{2k+1}\sin((2k+1)x)$$ and it looks not so terrible to integrate the product of this two series times $\tan x$ over $(0,\pi/2)$.

In particular, Mathematica told me that $$\int_{0}^{\pi/2}\cos(mx)\log(1+\cos x)\tan x\,dx$$ is always a linear combination of $1$ and $\log 2$ (if $m$ is odd) or a linear combination of $1$ and $\zeta(2)$ (if $m$ is even). I don't believe in coincidences.

Continues.

• I went this route as well, but while the integral was manageable I ran into convergence issues. Your series is slightly different from mine though, so I may have made a mistake. – David H Aug 8 '14 at 19:31