# Complex Analysis to solve this integral? $\int_0^{\pi/2} \frac{\ln(\sin(x))}{\sqrt{1 + \cos^2(x)}}\text{d}x$

Complex Analysis time! I need some help in figuring out how to proceed to calculate this integral:

$$\int_0^{\pi/2} \frac{\ln(\sin(x))}{\sqrt{1 + \cos^2(x)}}\text{d}x$$

I tried to apply what I have been studying in complex analysis, that is stepping into the complex plane. So

$$\sin(x) \to z - 1/z$$ $$\cos(x) \to z + 1/z$$ Obtaining

$$\int_{|z| = 1} \frac{\ln(z^2-1) - \ln(z)}{\sqrt{z^4 + 3z^2 + 1}} \frac{\text{d}z}{i}$$

I found out the poles,

$$z_k = \pm \sqrt{\frac{-3 \pm \sqrt{5}}{2}}$$

But now I am confused: how to deal with the logarithms? Also, what when I have both imaginary and real poles?

I am a rookie in complex analysis so please be patient...

• How do you define $\ln(z^2-1)-\ln(z)$ on and inside the unit circle? What is the value for example at $z=\pm 1$ or $z=-1/2$? How about the square root branch points (which are not poles)?
– Gary
Jun 24, 2022 at 6:49
• @Gary In general, $\log(z) = \log|z| + i \text{arg}(z)$. I still have to understand how to get "arg". It's the polar angle in the interval $(-\pi, \pi)$? What then? Jun 24, 2022 at 6:52
• The logarithm cannot be defined analytically around the origin. Not even continuously. It is also not defined at the origin.
– Gary
Jun 24, 2022 at 7:07
• @Gary Is that a way to say that the integral cannot be computed via Complex Integration, or that I am wrong, or what? Jun 24, 2022 at 7:18
• somewhat obvious comment, but letting $\cos x \mapsto x$ and viewing $\log u$ as $\frac{\partial}{\partial t} u^t$ evaluated at zero gives an answer in terms of derivatives of Hypergeometric functions Jun 24, 2022 at 8:30

Following D'Aurizio hint, we have to deal with $$I=\frac{1}{2}\int_{0}^{1}\frac{\log\left(1-t^{2}\right)}{\sqrt{1-t^{4}}}dt=\frac{1}{2}\int_{0}^{K(i)}\log\left(1-\text{sinlem}\left(t\right)^{2}\right)dt$$ where $$\text{sinlem}\left(t\right)$$ is the Lemniscate sine function. Using the relation $$\text{sinlem}\left(t\right)=\text{sn}\left(t;i\right)$$ where $$\text{sn}(z;k)$$ is the Jacobi Elliptic sine, we get$$I=\frac{1}{2}\int_{0}^{K(i)}\log\left(1-\text{sn}\left(t;i\right)^{2}\right)dt=\int_{0}^{K(i)}\log\left(\text{cn}\left(t;i\right)\right)dt$$ and now it is enough to recall a classical result of Glaisher $$\int_{0}^{K(k)}\log\left(\text{cn}\left(t;k\right)\right)dt=-\frac{1}{4}\pi K^{\prime}\left(k\right)+\frac{1}{2}K\left(k\right)\log\left(\frac{k^{\prime}}{k}\right)$$ and so $$I=-\frac{1}{4}\pi K^{\prime}\left(i\right)+\frac{1}{2}K\left(i\right)\log\left(\frac{\sqrt{2}}{i}\right)$$ $$=\color{blue}{\frac{L}{8}\left(\log\left(2\right)-\pi\right)}=\color{red} {-0.8024956186037819...}$$ where $$L/2$$ is the Lemniscate constant.

$$\int_{0}^{1}\frac{\log(t)\,dt}{\sqrt{(1-t^2)(2-t^2)}} \stackrel{t\mapsto\sqrt{t}}{=} \frac{1}{4}\int_{0}^{1}\frac{\log(t)\,dt}{\sqrt{t(1-t)(2-t)}}\stackrel{t\mapsto 1-t}{=}\frac{1}{4}\int_{0}^{1}\frac{\log(1-t)}{\sqrt{t-t^3}}\,dt$$ equals $$\frac{1}{2}\int_{0}^{1}\frac{\log(1-t^2)}{\sqrt{1-t^4}}\,dt.$$ By replacing $$t$$ with the inverse function of the primitive of $$\frac{1}{\sqrt{1-t^4}}$$ we have that this integral, which is also a harmonic-binomial series, is related to the Weierstrass products of the lemniscate elliptic functions.

I am sure Marco Cantarini is working on the subject at the current time, so it might be a good idea to summon him.

Indeed, after some simplification of Glaisher's result (given by the relations between the complete elliptic integral of the first kind and the $$\text{AGM}$$ mean) we have

$$\frac{1}{2}\int_{0}^{1}\frac{\log(1-t^2)}{\sqrt{1-t^4}}\,dt =\color{red}{ \frac{\log(2)-\pi}{16\sqrt{2\pi}}\,\Gamma\left(\frac{1}{4}\right)^2}=-\frac{1}{2}\sum_{n\geq 0}\frac{\binom{2n}{n}}{4^n}\cdot\frac{H_{2n+\frac{1}{2}}}{4n+1}.$$

Similarly

$$\int_{0}^{1}\frac{\log(t)\,dt}{\sqrt{1-t^4}} = \color{red}{-\sqrt{\frac{\pi}{2}}\,\Gamma\left(\frac{5}{4}\right)^2}=-\sum_{n\geq 0}\frac{\binom{2n}{n}}{4^n(4n+1)^2}.$$

• I so admire you. $+1$ Jun 26, 2022 at 8:29

@Hans-André-Marie-Stamm, I hope you don't mind that I was unable to solve this problem using Complex Analysis, but here's a method that relies on the Beta Function and some algebric work.

\begin{align}I&=\int_{0}^{\pi/2}\frac{\log\left(\sin(x)\right)}{\sqrt{1+\cos^2(x)}}dx;\ \cos(x)\rightarrow y\\&=\frac{1}{2}\int_{0}^{1}\frac{\log\left(1-y^2\right)}{\sqrt{1-y^4}}dy =\underbrace{\frac{1}{4}\int_{0}^{1}\frac{\log\left(1-y^4\right)}{\sqrt{1-y^4}}dy}_{I_1}+\underbrace{\frac{1}{4}\int_{0}^{1}\frac{\log\left(\frac{1-y^2}{1+y^2}\right)}{\sqrt{1-y^4}}dy}_{I_2}\end{align}

\begin{align}I_1=&\frac{1}{4}\underbrace{\int_{0}^{1}\frac{\log\left(1-y^4\right)}{\sqrt{1-y^4}}dy}_{y=z^{1/4}}=\frac{1}{16}\int_{0}^{1}z^{1/4-1}\frac{\log\left(1-z\right)}{\sqrt{1-z}}dz\\=&\frac{1}{16}\lim_{t \rightarrow 1/2}\frac{d}{dt}\mathfrak{B}\left(\frac{1}{4},t\right)=\frac{1}{16}\mathfrak{B}\left(\frac{1}{4},\frac{1}{2}\right)\left[\psi^{(0)}\left(\frac{1}{2}\right)-\psi^{(0)}\left(\frac{3}{4}\right)\right]\end{align}

\begin{align}I_2=&\frac{1}{4}\underbrace{\int_{0}^{1}\frac{\log\left(\frac{1-y^2}{1+y^2}\right)}{\sqrt{1-y^4}}dy}_{y=\sqrt{\frac{1-\sqrt{z}}{1+\sqrt{z}}}}=\frac{1}{32}\int_{0}^{1}z^{1/4-1}\frac{\log\left(z\right)}{\sqrt{1-z}}dz\\=&\frac{1}{32}\lim_{t \rightarrow 1/4}\frac{d}{dt}\mathfrak{B}\left(\frac{1}{2},t\right)=\frac{1}{32}\mathfrak{B}\left(\frac{1}{2},\frac{1}{4}\right)\left[\psi^{(0)}\left(\frac{1}{4}\right)-\psi^{(0)}\left(\frac{3}{4}\right)\right]\end{align}

Gathering both results: \begin{align}I&=\frac{1}{32}\mathfrak{B}\left(\frac{1}{2},\frac{1}{4}\right)\left[\psi^{(0)}\left(\frac{1}{4}\right)+2\psi^{(0)}\left(\frac{2}{4}\right)-3\psi^{(0)}\left(\frac{3}{4}\right)\right]\\&=\frac{1}{32}\frac{\Gamma\left(1/4\right)\Gamma\left(1/2\right)}{\Gamma\left(3/4\right)}\left[\psi^{(0)}\left(\frac{1}{4}\right)+2\psi^{(0)}\left(\frac{2}{4}\right)-3\psi^{(0)}\left(\frac{3}{4}\right)\right]\end{align}

This result can be simplified if one applies Gamma's Reflection Formula, and Digamma's Reflection and Multiplication Formulas, obtaining: $$I=\int_{0}^{\pi/2}\frac{\log\left(\sin(x)\right)}{\sqrt{1+\cos^2(x)}}dx=\frac{\log(2)-\pi}{16\sqrt{2\pi}}\Gamma^2\left(\frac{1}{4}\right)$$

• Amazing!!  Jul 15, 2022 at 9:37
• Thank you! Did you have success applying Complex Analysis? I've tried to use Residue at Infinity after some algebric transformations, but I coudn't proceed it properly. Jul 16, 2022 at 15:01

(Too long to post as a comment.)

Using the Fourier series

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

and reducing the power of $$\cos(x)$$ with the identity

$$\cos^2(x) = \frac{1+\cos(2x)}2$$

we have

\begin{align*} \int_0^{\pi/2} \frac{\ln(\sin(x))}{\sqrt{1+\cos^2(x)}} \, dx &= -\sqrt2\ln(2) \int_0^{\pi/2} \frac{dx}{\sqrt{3+\cos(2x)}} - \sum_{k=1}^\infty \frac{\sqrt2}k \int_0^{\pi/2} \frac{\cos(2kx)}{\sqrt{3+\cos(2x)}} \, dx \\[1ex] &= -\frac{\ln(2)}{\sqrt2} I_0 - \frac1{\sqrt2} \sum_{k=1}^\infty \frac{I_k}k \end{align*}

where for $$\alpha\in\{0,1,2,\ldots\}$$,

$$I_\alpha = \int_0^\pi \frac{\cos(\alpha x)}{\sqrt{3+\cos(x)}} \, dx$$

each of which apparently (according to Mathematica) evaluate to a linear combination of $$E\left(\frac12\right)$$ and $$K\left(\frac12\right)$$ ($$K$$ and $$E$$ denote the elliptic integrals of the first and second kind, respectively). Finding a closed form for $$I_\alpha$$ and in turn for your integral seems unlikely, though.

• I imagine this is roughly equivalent to writing the integral as $\int_{0}^{1}\frac{\ln\left(u\right)}{\sqrt{\left(2-u^{2}\right)\left(1-u^{2}\right)}}du$ via a u-sub, and then noting it would be an Elliptic integral if the log weren't there so we can Taylor expand the log to get an infinite series of elliptic integrals with denominator $k$. (Your result at least appears to roughly be of that form, up to the missing $(-1)^k$ term from the log taylor series... perhaps that is why Mathematica gave it in terms of two different elliptic integrals?) Jun 24, 2022 at 8:33

As already said in answers and comments, using $$\sin(x)=t$$ $$\int_0^{\frac \pi2} \dfrac{\log(\sin(x))}{\sqrt{1 + \cos^2(x)}}\,dx=\int_0^1 \frac{\log (t)}{\sqrt{(1-t^2)(2-t^2)} }$$

There is a nasty explicit solution in terms of the Gaussian hypergeometric function $$\, _2F_1\left(\frac{3}{4},\frac{3}{4};1;-8\right)$$ and its derivatives with respect to its first, second and third arguments.

Probably easier, would be to expand $$\frac{1}{\sqrt{(1-t^2)(2-t^2)} }=\frac 1{\sqrt 2} \sum_{n=0}^\infty a_n\, t^{2n}$$ where the $$a_n$$ form the sequence $$\left\{1,\frac{3}{4},\frac{19}{32},\frac{63}{128},\frac{867}{2048},\frac{3069}{ 8192},\frac{22199}{65536},\frac{81591}{262144},\frac{2428451}{8388608},\frac {9119601}{33554432},\frac{68993757}{268435456},\cdots\right\}$$ and use the fact that $$\int_0^1 t^{2n}\,\log(t)\,dt=-\frac{1}{(2 n+1)^2}$$ Using the coefficients listed above, the result is $$-\frac{14645443896353066473}{12947100671567462400 \sqrt{2}}=-0.799862$$ while the exact result is $$-0.802496$$.

Inverse symbolic calculators do not identify $$-0.80249561860378193216746878737636023438643059976849493589569975292440979\cdots$$ and the proposed closest approximation (for an absolute error of $$2.904\times 10^{-8}$$) is $$-\frac{ \sqrt{11} \left(19+3 \sqrt{3}\right)}{100}$$

Running my own trigonometric inverse calculator, for an absolute error of $$2.529\times 10^{-9}$$ $$-\cos \left(\frac{23 \pi }{195}\right) \cos \left(\frac{44 \pi }{259}\right)$$