Can $ \int_0^{\pi/2} \ln ( \sin(x)) \; dx$ be evaluated with "complex method"?

Can the following integral be evaluated using complex method by substituting $\sin(x) = {e^{ix}-e^{-ix} \over 2i}$? $$ I=\int_0^{\pi/2} \ln ( \sin(x)) \; dx = - {\pi \ln(2) \over 2}$$


Solution 1:

Note first that \begin{align*} \int_0^{2\pi} \ln(\sin t)\,dt &= 2\int_0^{\pi/2} \ln(\sin t)\,dt + 2\int_0^{\pi/2} \ln(-\sin t)\,dt \\ &= 2\int_0^{\pi/2} \ln(\sin t)\,dt + 2\int_0^{\pi/2} \Bigl(\ln(\sin t) + i\pi\Bigr)\,dt \\ &= 4I + \pi^2i \end{align*} and, using the substitution $z=e^{it}$ \begin{align*} \int_0^{2\pi} \ln(\sin t)\,dx &= \int_{|z|=1} \ln\left(\frac{z-1/z}{2i}\right)\,\frac{dz}{iz} \\ &= \int_{|z|=1} \frac{\ln(1-z^2)}{iz}\,dz - \int_{|z|=1} \frac{\ln z}{iz}\,dz + \int_{|z|=1} \frac{\ln(i/2)}{iz}\,dz. \end{align*}

The first integral on the right is zero $\dots$ this is because $\ln(1-z^2)$ is analytic inside the unit disk and vanishes at $z=0$ so the singularity in the integrand there is removable (you need to shrink the circle of integration slightly to avoid the points $z=\pm1$ and then let the radius go to 1).

The second integral we do directly $$ \int_{|z|=1} \frac{\ln z}{iz}\,dz = \left[\frac{1}{2i}\bigl(\ln z\bigr)^2\right]_{-1^+}^{-1^-} = \frac{1}{2i}\Bigl[(\pi i)^2 - (-\pi i)^2 \Bigr] = 0 $$ where $-1^\pm$ indicate points just above and below $-1$ and on either side of the branch cut of $\ln$ along the negative real axis.

The third integral is just $2\pi i\ln(i/2)/i = 2\pi\bigl(-\ln2 + \pi i/2\bigr)$.

Therefore $4I + \pi^2i = -2\pi\ln2 + \pi^2i$ and $I = -\frac{\pi}{2}\ln2$.

Solution 2:

Let us change variables $u=\sin^2(x)$, $x=\arcsin(\sqrt{u})$, $\mathrm{d}x = \frac{1}{2} \frac{\mathrm{d}u}{\sqrt{u(1-u)}}$: $$ \int_0^{\pi/2} \ln(\sin(x)) \mathrm{d}x = \int_0^1 \frac{1}{2} \ln(u) \cdot \frac{1}{2} \frac{\mathrm{d}u}{\sqrt{u(1-u)}} \stackrel{u=1-v}{=} \frac{1}{4} \int_0^1 \ln(1-v) \cdot \frac{\mathrm{d}v}{\sqrt{v(1-v)}} $$ Adding two last integrals, and dividing by $2$: $$ \int_0^{\pi/2} \ln(\sin(x)) \mathrm{d}x = \frac{1}{4} \int_0^1 \frac{\ln\left(\sqrt{u(1-u)}\right)}{\sqrt{u(1-u)}} \mathrm{d}u = -\frac{1}{4} \left.\frac{\mathrm{d}}{\mathrm{d}s}\operatorname{B}\left(s,s\right)\right|_{s=\frac{1}{2}} $$ Since $\operatorname{B}\left(s,s\right) = \frac{\Gamma(s)^2}{\Gamma(2s)}$: $$ \frac{\mathrm{d}}{\mathrm{d}s}\operatorname{B}\left(s,s\right) = 2 \operatorname{B}\left(s,s\right) \left(\psi(s) - \psi(2s)\right) $$ where $\psi(s)$ is the digamma function. Using $\operatorname{B}\left(\frac{1}{2},\frac{1}{2}\right) = \pi$, and duplication identity for the digamma function: $$ 2 \psi(2s) = \psi(s) + \psi\left(s+\frac{1}{2}\right) + 2 \log(2) \quad \stackrel{s=\frac{1}{2}}{\implies} \quad \psi\left(\frac{1}{2}\right) - \psi(1) = -2\ln(2) $$ Combining, we arrive at the result: $$ \int_0^{\pi/2} \ln(\sin(x)) \mathrm{d}x = \frac{1}{4} \cdot \pi \cdot \left(-2 \ln(2)\right) = -\frac{\pi}{2} \ln(2) $$

Solution 3:

Consider a known formula (which can be proved by the identity of $\sin x$ you mentioned):

$$ \prod_{j=1}^{n-1}\sin\left(\frac{j}{n}\pi\right)=\frac{n}{2^{n-1}}\quad n\geq 2, $$ which implies that $$ \frac{\pi}{2n}\sum_{j=1}^{n-1}\ln \left(\sin\frac{j}{n}\pi\right)=\frac{\pi}{2n}\ln (n)-\frac{\pi\cdot (n-1)}{2n}\ln 2. $$ Now taking the limit on both side as $n\to\infty$, you get what you want by recognizing that the left hand side is a Riemann sum.