# Integral: $\int_0^{\pi} \frac{x}{x^2+\ln^2(2\sin x)}\,dx$

I am trying to solve the following by elementary methods: $$\int_0^{\pi} \frac{x}{x^2+\ln^2(2\sin x)}\,dx$$

I wrote the integral as: $$\Re\int_0^{\pi} \frac{dx}{x-i\ln(2\sin x)}$$ But I don't find this easier than the original integral. I have seen solutions which make use of complex analysis but I am interested in elementary approaches.

Any help is appreciated. Thanks!

• Why the downvote? – Pranav Arora Jul 26 '14 at 12:04
• I don't know, even using non elementary methods but the beautiful thing is that your last integral is a real ! +1 for this interesting question. Cheers. – Claude Leibovici Jul 26 '14 at 12:05
• Beats me why there's a downvote, but I upvoted because I've been wondering this too and I want a darn answer. Is the integral really exactly $2$?? – David H Jul 26 '14 at 12:09
• – Shine Jul 26 '14 at 14:15

Here is an approach without using contour integration (Cauchy's theorem).

I've found the following result.

Theorem. Let $a$ be any real number.

Then \begin{align} \displaystyle \int_{0}^{\pi} \frac{x}{x^2+\ln^2(2 e^{a} \sin x)}\mathrm{d}x & = \, \frac{2 \pi^2}{\pi^2+4a^2},\tag1\\\\ \int_{0}^{\pi} \frac{\ln(2 e^{a} \sin x)}{x^2+\ln^2(2 e^{a} \sin x)}\mathrm{d}x & = \frac{4\pi a}{\pi^2+4a^2}.\tag2 \end{align}

from which, by putting $a=0$, you deduce the evaluation of the desired integral:

Example $1 (a)$. \begin{align} \int_{0}^{\pi} \frac{x}{x^2+\ln^2(2 \sin x)}\:\mathrm{d}x & = 2 \tag3 \end{align}

and

Example $1 (b)$. \begin{align} \int_{0}^{\pi} \frac{\ln(2\sin x)}{x^2+\ln^2(2\sin x)}\mathrm{d}x& = 0. \\ \tag4 \end{align}

Proof of the Theorem. We consider throughout the principal value of $\log(z)$ defined for $z\neq 0$ by $$\log(z)= \ln |z| + i \arg z, \, - \pi < \arg z \leq \pi,$$ where $\ln$ is the base-$e$ logarithm $\ln e = 1$.

Let $a$ be any real number. Since $\displaystyle z \mapsto i \pi/2+a+\log(1+z)$ is analytic on $|z| < 1$ non-vanishing at the point $z=0$, one may obtain the following power series expansion \begin{align} \displaystyle \frac{1}{i \pi/2+a+\log \left(1+z\right)} - \frac{1}{i \pi/2+a} = \sum_{n=1}^{\infty} \displaystyle \frac{a_n(\alpha)}{n!} z^n,\tag5 \end{align} with $$\displaystyle a_1(\alpha) = -\alpha^2, \quad a_2(\alpha) = \alpha^3+\alpha^2/2, \, ... ,$$ $\displaystyle {a}_n(\cdot)$ being a polynomial of degree $n+1$ in $\displaystyle \alpha$, where we have set $\displaystyle \alpha:=1/(i \pi/2+a)$. Plugging $z=-e^{2ix}$ in $(3)$, for $0<x<\pi$, noticing $$i x +\ln(2e^{a} \sin x) = \log\left(ie^{a}\left(1-e^{2ix} \right) \right),$$ separating real and imaginary parts, gives the Fourier series expansions: \begin{align} \displaystyle \frac{x}{x^2 +\ln^2(2e^{a}\sin x)} & = \frac{2\pi}{\pi^2+4a^2}+ \sum_{n=1}^{\infty}(-1)^n \left( \frac{a_n^{-}(\alpha)}{n!} \cos (2nx)+\frac{a_n^{+}(\alpha)}{n!} \sin (2nx)\right) \\ \frac{\ln(2e^{a}\sin x)}{x^2 +\ln^2(2e^{a}\sin x)} & = \frac{4a}{\pi^2+4a^2}+ \sum_{n=1}^{\infty}(-1)^n \left( \frac{a_n^{+}(\alpha)}{n!} \cos (2nx)-\frac{a_n^{-}(\alpha)}{n!} \sin (2nx)\right) \end{align} with $\displaystyle a_n^{+}(\alpha):= {\mathfrak{R}}a_n(\alpha)$ and $\displaystyle a_n^{-}(\alpha):= {\mathfrak{I}}a_n(\alpha)$. Now, a termwise integration with respect to $x$ from 0 to $\pi$, justified by the convergence of the series $\sum_{n=1}^{\infty} \displaystyle \frac{a_n(\alpha)}{n!}$, leads to the Theorem due to \begin{align} \displaystyle \int_{0}^{\pi} \cos(2nx)\:\mathrm{d}x = \int_{0}^{\pi} \sin(2nx)\:\mathrm{d}x = 0. \end{align}

One may observe that, by uniqueness of the Fourier coefficients, you have the following closed forms.

Example $2 (a)$. \begin{align} \int_{0}^{\pi} \frac{x}{x^2+\ln^2(2 \sin x)}\cos^{2} x \:\mathrm{d}x & = 1, \tag6 \\ \int_{0}^{\pi} \frac{x}{x^2+\ln^2(2 \sin x)}\sin^{2} x\:\mathrm{d}x & = 1. \tag7 \end{align}



Example $2 (b)$. \begin{align} \int_{0}^{\pi} \frac{\ln(2 \sin x)}{x^2+\ln^2(2 \sin x)} \cos^{2} x \:\mathrm{d}x & = -\frac{1}{\pi}, \tag8 \\ \int_{0}^{\pi} \frac{\ln(2 \sin x)}{x^2+\ln^2(2 \sin x)}\sin^{2} x\:\mathrm{d}x & = \frac{1}{\pi}. \tag9 \end{align}

A general result does exist.

• Thank you Oliver Oloa for the response but I cannot understand most of it. :( What does the statement "Since $z↦\log(1+z)$ is analytic on $|z|<1$, one may obtain the following power series expansion" mean? And then, why did you introduce the subsequent series expansion? Can you please share some motivation behind introducing $e^a$? Sorry for too many dumb questions. Thank you again. – Pranav Arora Jul 26 '14 at 12:42
• @PranavArora. There is no dumb question ! I am fascinated by this answer but I am almost sure I just understand a few percents of it. Cheers :) – Claude Leibovici Jul 26 '14 at 12:50
• @Oliver Oloa. Do you have many things like that ? By the way, where are you in Paris ? Cheers from Pau :) – Claude Leibovici Jul 26 '14 at 12:52
• @Pranav Arora When an analytic function $h$ say near $z_0=0$ is such that $h(0) \neq 0$, then the reciprocal $z \mapsto 1/h(z)$ is also analytic near $0$. We are in this case here. Thank you. – Olivier Oloa Jul 26 '14 at 12:58
• I do not know what an analytic function is. I think I will have to learn about that before trying to understanding your answer. Thank you for your time, I accept your answer. :) – Pranav Arora Jul 26 '14 at 13:02