Calculate the integral $\int_0^{+\infty}\frac{\ln(\cos^2x)}{1+e^{2x}}dx$

complex-analysisdefinite integralsintegration

Calculate the integral $$\int_0^{+\infty}\frac{\ln(\cos^2x)}{1+e^{2x}}\,dx.$$

I tried

$$\displaystyle\ln(\cos^2x)=\ln\left(\frac{\cos2x+1}{2}\right)=\ln(1+\cos2x)-\ln2.$$

It's easy to get the result of

$$\displaystyle\int_0^{+\infty}\frac{-\ln2}{1+e^{2x}}\,dx=-\ln 2$$

and using $2x=t$ for another part
$$\displaystyle \int_0^{+\infty}\frac{\ln(1+\cos2x)}{1+e^{2x}}\,dx$$

I got $$\int_0^{+\infty}\frac{\ln(\cos^2x)}{1+e^{2x}}\,dx=\frac12\int_0^{+\infty}\frac{\ln(1+\cos t)}{1+e^{t}}\,dt-\ln2.$$

I don't know how to calculate the first integral. Could someone help me? Thanks!

Best Answer

The original integral is

$$I = 2\int_0^{\infty} \frac{\ln(|\cos x|)e^{-2x}}{1 + e^{-2x}}dx$$

Use the following result from Fourier series of Log sine and Log cos,

$$\ln(|\cos x|) = -\sum_{k = 1}^{\infty} (-1)^k\frac{\cos(2kx)}{k} - \ln 2 \, \, \forall x \in \mathbb{R}$$

i.e

$$ I = -2\sum_{k=1}^{\infty}\frac{(-1)^k}{k}\int_0^{\infty}\frac{\cos(2kx)e^{-2x}}{1 + e^{-2x}}dx - 2\ln2\int_0^{\infty}\frac{e^{-2x}}{1 + e^{-2x}}dx$$

The right integral is equal to $\frac{\ln 2}{2}$. For the left integral, use the expansion $\frac{1}{1+e^{-2x}} = \sum_{n=0}^{\infty}(-1)^n e^{-2nx}$ since $e^{-2x} < 1$.

$$ I = -2\sum_{k=1}^{\infty}\sum_{n=0}^{\infty}\frac{(-1)^{k + n}}{k}\int_0^{\infty}\cos(2kx)e^{-2x(n+1)}dx - \ln^2 2$$

Call the integral inside the sum as $J$.

$$J = \int_0^{\infty} \cos(2kx)e^{-2x(n + 1)}dx = \Re\int_0^{\infty} e^{-2x(n + 1 +ik)}dx = \Re\frac{1}{2(n + 1 + ik)}$$

$$\Rightarrow J = \frac{1}{2}\frac{n + 1}{k^2 + (n + 1)^2}$$

Therefore,

$$I = \sum_{k = 1}^{\infty}\sum_{n = 1}^{\infty} \frac{(-1)^{k + n}}{k}\frac{n}{n^2 + k^2} - \ln^2 2$$

Note the change in summation limits. Call the summation as $S$. Note that replacing $k$ with $n$ won't change the result, hence

$$2S = \sum_{k = 1}^{\infty}\sum_{n = 1}^{\infty}\frac{(-1)^{k + n}}{k}\frac{n}{n^2 + k^2} + \sum_{k = 1}^{\infty}\sum_{n = 1}^{\infty}\frac{(-1)^{k + n}}{n}\frac{k}{n^2 + k^2} $$

$$\Rightarrow S = \frac{1}{2}\sum_{k = 1}^{\infty}\sum_{n = 1}^{\infty}\frac{(-1)^{k + n}}{nk} = \frac{1}{2}\left(\sum_{k = 1}^{\infty}\frac{(-1)^k}{k}\right)^2 = \frac{\ln^2 2}{2}$$

Therefore,

$$ I = \frac{\ln^2 2}{2} - \ln^2 2 = -\frac{\ln^2 2}{2}$$

Related Question