I plan to evaluate

$$\int_0^{\pi/3} \ln^2\left(\frac{\sin x }{\sin (x+\pi/3)}\right)\, \mathrm{d}x$$ and I need a starting point for both real and complex methods. Thanks !


  • 10
    $\begingroup$ You ask very nice questions; I've learned a LOT from them! $\endgroup$
    – anon271828
    Feb 15, 2013 at 22:05
  • 2
    $\begingroup$ @anon271828: I'm very glad to read that. Thank you :-) $\endgroup$ Feb 15, 2013 at 22:08

4 Answers 4


It turns out that this integral takes on a very simple form amenable to analysis via residues. Let $u = \sin{x}/\sin{(x+\pi/3)}$. We may then find that (+)

$$\tan{x} = \frac{(\sqrt{3}/2)u}{1-(u/2)}$$

A little bit of algebra reveals a very nice form for the differential:

$$dx = \frac{\sqrt{3}}{2} \frac{du}{1-u+u^2}$$

so the original integral takes on a much simpler-looking form:

$$\frac{\sqrt{3}}{2} \int_0^1 du \frac{\log^2{u}}{1-u+u^2}$$

This is not ready for contour integration yet. We may transform this into such an integral by substituting $u=1/v$ and observing that

$$\int_0^1 du \frac{\log^2{u}}{1-u+u^2} = \int_1^\infty du \frac{\log^2{u}}{1-u+u^2} = \frac{1}{2} \int_0^\infty du \frac{\log^2{u}}{1-u+u^2}$$

We may now analyze that last integral via the residue theorem. Consider the integral

$$\oint_C dz \frac{\log^3{z}}{1-z+z^2}$$

where $C$ is a keyhole contour that passes up and back along the positive real axis. It may be shown that the integral along the large and small circular arcs vanish as the radii of the arcs goes to $\infty$ and $0$, respectively. We may then write the integral in terms of positive contributions just above the real axis and negative contributions just below. The result is

$$\oint_C dz \frac{\log^3{z}}{1-z+z^2} = \begin{array}\\ i \left ( - 6 \pi \int_0^\infty du \frac{\log^2{u}}{1-u+u^2} + 8 \pi^3 \int_0^\infty du \frac{1}{1-u+u^2} \right ) \\ + 12 \pi^2 \int_0^\infty du \frac{\log{u}}{1-u+u^2} \end{array}$$

We set this equal to $i 2 \pi$ times the sum of the residues of the poles of the integrand within $C$. The poles are $z \in \{e^{i \pi/3},e^{i 5\pi/3}\}$. The residues are

$$\mathrm{Res}_{z=e^{i \pi/3}} = -\frac{\pi^3}{27 \sqrt{3}}$$

$$\mathrm{Res}_{z=e^{i 5\pi/3}} = \frac{125 \pi^3}{27 \sqrt{3}}$$

$i 2 \pi$ times the sum of these residues is then

$$i \frac{248 \pi^4}{27 \sqrt{3}}$$

Equating imaginary parts of the integral to the above quantity, we see that

$$ - 6 \pi \int_0^\infty du \frac{\log^2{u}}{1-u+u^2} + 8 \pi^3 \int_0^\infty du \frac{1}{1-u+u^2} = \frac{248 \pi^4}{27 \sqrt{3}}$$

Now, I will state without proof for now that (++)

$$\int_0^\infty du \frac{1}{1-u+u^2} = \frac{4 \pi}{3 \sqrt{3}}$$

Then with a little arithmetic, we find that

$$\int_0^\infty du \frac{\log^2{u}}{1-u+u^2} = \frac{20 \pi^3}{81 \sqrt{3}}$$

The integral we want is $\sqrt{3}/4$ times this value; therefore

$$\int_0^{\pi/3} dx \log^2{\left [ \frac{\sin{x}}{\sin{(x + \pi/3)}} \right ]} = \frac{5\pi^3}{81}$$

Proof of (++)

Now, to prove (++), we go right back to the observation (+) that

$$ x = \int \frac{du}{1-u+u^2} \implies \tan{\left ( \frac{\sqrt{3}}{2} x \right )} = \frac{(\sqrt{3}/2)u}{1-(u/2)}$$


$$\int_0^1 \frac{du}{1-u+u^2} = \frac{2}{\sqrt{3}} \left [ \arctan \left ( \frac{(\sqrt{3}/2) u}{1-(u/2)} \right ) \right ]_0^1 = \frac{2}{\sqrt{3}} \frac{\pi}{3}$$

and we showed that this is $1/2$ the integral over $[0,\infty)$, and

$$\int_0^\infty \frac{du}{1-u+u^2} = \frac{4 \pi}{3 \sqrt{3}}$$


  • 1
    $\begingroup$ That's an awesome proof. $\endgroup$ Feb 16, 2013 at 6:57
  • 1
    $\begingroup$ @rlgordonma: It is a clever choice for the change of variables (+1), $\endgroup$ Feb 16, 2013 at 15:12
  • $\begingroup$ Very nice, as usual, +1. $\endgroup$
    – Julien
    Feb 16, 2013 at 16:02
  • $\begingroup$ This is rather remarkable! +1 for the proof. How do you come up with these ideas for approaches? Experience/exposure? Natural talent? Some other ingredient I can try to incorporate into my life? :) $\endgroup$
    – anon271828
    Feb 19, 2013 at 1:55
  • $\begingroup$ @anon271828 (and Mhenni): I wanted a contour integral with the $\log^2{u}$ term, so I tried that change of variables without any expectations. It was simply a guess, nothing more, and an obvious one at that. That it worked out so beautifully was a pleasant surprise. What was very nice was that the same change in variable applied to both integrals that needed to be evaluated. $\endgroup$
    – Ron Gordon
    Feb 19, 2013 at 9:13

Here is a start, using the change of variables $x=\arctan(t)$, we have

$$ \int_0^{\pi/3} \ln^2\left(\frac{\sin x }{\sin (x+\pi/3)}\right)\, \mathrm{d}x = \int _{0}^{\sqrt {3}}\!{\frac { \left( \ln \left( 2 \right) +\ln \left( t \right) -\ln \left( t+\sqrt {3} \right) \right) ^{2}}{1+{t }^{2}}}{dt} $$

$$ = \int _{0}^{\sqrt {3}}\!{\frac { \left( \ln \left( \frac{2t}{t+\sqrt {3}} \right)\right)^{2}}{1+{t }^{2}}}{dt} = \frac{\sqrt{3}}{2}\int _{0}^{1}\!{\frac { \left( \ln \left( y\right) \right) ^{2}}{1-y+{y }^{2}}}{dt}. $$

The later integral follows by using the change of variables $\frac{2t}{t+\sqrt {3}}=y$. Now, to evaluate the last integral, you need to use some techniques that have been used before such as partial fraction decomposition combined with the use of polylogarithm function. Here are some links link 1, link 2.

  • 1
    $\begingroup$ thank you for the clever way! (+1) $\endgroup$ Feb 16, 2013 at 6:58
  • $\begingroup$ @Chris'ssisterandpals: You are welcome. $\endgroup$ Feb 16, 2013 at 15:07
  • $\begingroup$ @Mhenni Benghorbal Well done! $\endgroup$ Aug 22, 2014 at 9:26
  • $\begingroup$ @OlivierOloa: thank you for the comment. I really appreciate it. $\endgroup$ Aug 22, 2014 at 10:44

Set $t=\dfrac{\sin x}{\sin\left(x+\frac\pi3\right)}$, then $$ \int_0^{\Large\frac\pi3}\ln^2\left[\dfrac{\sin x}{\sin\left(x+\frac\pi3\right)}\right]\ dx=\frac{\sqrt3}2\int_0^1\frac{\ln^2t}{1-t+t^2}\ dt.\tag1 $$

Method $1$ :

\begin{align} \int_0^1 \dfrac{\ln^2 t }{1-t+t^2}\ dt&= \int_0^1 \dfrac{1+t}{1+t^3} \ln^2t\ dt\\ & = \int_0^1\sum_{k=0}^{\infty}(-1)^k t^{3k}\ (1+t) \ln^2t\ dt\\ &=\sum_{k=0}^{\infty}(-1)^k\left(\int_0^1 t^{3k}\ln^2t\ dt+\int_0^1 t^{3k+1}\ln^2t\ dt\right).\tag2 \end{align} Using $$ \int_0^1 x^\alpha \ln^n x\ dx=\frac{(-1)^n n!}{(\alpha+1)^{n+1}}, \qquad\text{for }\ n=0,1,2,\ldots\tag3 $$ then $(2)$ turns out to be \begin{align} \int_0^1 \dfrac{\ln^2 t }{1-t+t^2}\ dt&= \sum_{k=0}^{\infty}(-1)^k\left[\frac{2}{(3k+1)^{3}}+\frac{2}{(3k+2)^{3}}\right]\\ &= \frac2{3^3}\sum_{k=0}^{\infty}(-1)^k\left[\frac{1}{\left(k+\frac13\right)^{3}}+\frac{1}{\left(k+\frac23\right)^{3}}\right].\tag4 \end{align} Consider the alternating series in term of polygamma function $$ \sum_{k=0}^\infty\frac{(-1)^{k}}{(z+k)^{n+1}}=\frac1{(-2)^{n+1}n!}\left[\psi_n\left(\frac{z}{2}\right)-\psi_n\left(\frac{z+1}{2}\right)\right]\quad;\quad\text{for}\ n\in\mathbb{Z}_+\tag5 $$ and the reflection formula of polygamma function $$ \psi_n(1-z)+(-1)^{n+1}\psi_n(z)=(-1)^{n}\pi\frac{d^n}{dz^n}\cot(\pi z).\tag6 $$ Using $(5)$ and $(6)$, then $(4)$ becomes \begin{align} \int_0^1 \dfrac{\ln^2 x }{1+x+x^2}\ dx&= \frac2{3^3}\cdot\frac{1}{(-2)^3\cdot2!}\bigg[\psi_2\left(\frac16\right)-\psi_2\left(\frac23\right)+\psi_2\left(\frac13\right)-\psi_2\left(\frac56\right)\bigg]\\ &= -\frac1{6^3}\bigg[\psi_2\left(\frac16\right)-\psi_2\left(\frac56\right)+\psi_2\left(\frac13\right)-\psi_2\left(\frac23\right)\bigg]\\ &= -\frac1{216}\left[\pi\left.\frac{d^2}{dz^2}\cot(\pi z)\right|_{z=\frac56}+\pi\left.\frac{d^2}{dz^2}\cot(\pi z)\right|_{z=\frac23}\right]\\ &=-\frac1{216}\left[-8\sqrt3\pi^3-\frac{8\sqrt3}{9}\pi^3\right]\\ &=\frac{10\sqrt3}{243}\pi^3. \end{align} Thus

$$ \int_0^{\Large\frac\pi3}\ln^2\left[\dfrac{\sin x}{\sin\left(x+\frac\pi3\right)}\right]\ dx=\frac{\sqrt3}2\int_0^1\frac{\ln^2t}{1-t+t^2}\ dt=\large\color{blue}{\frac{5}{81}\pi^3}. $$

Method $2$ : Set $t=\frac1x$, from $(1)$ we obtain $$ \int_0^{\Large\frac\pi3}\ln^2\left[\dfrac{\sin x}{\sin\left(x+\frac\pi3\right)}\right]\ dx=\frac{\sqrt3}2\int_0^1\frac{\ln^2t}{1-t+t^2}\ dt=\frac{\sqrt3}4\int_0^\infty\frac{\ln^2x}{1-x+x^2}\ dx. $$ Consider $$ \int_0^\infty \frac{x^{\alpha}\ dx}{1+2x\cos\beta +x^{2}}=\frac{\pi\sin (\alpha\beta)}{\sin (\alpha\pi)\sin \beta }.\tag7 $$ Differentiating $(7)$ with respect to $\alpha$ twice, setting $\alpha=0$ and $\beta=\frac23\pi$, we will obtain \begin{align} \int_0^\infty \frac{\partial^2}{\partial\alpha^2}\left[\frac{x^{\alpha}\ dx}{1+2x\cos\beta +x^{2}}\right]_{\alpha=0\ ;\ \beta=\frac23\pi}&=\frac{\partial^2}{\partial\alpha^2}\left[\frac{\pi\sin (\alpha\beta)}{\sin (\alpha\pi)\sin \beta }\right]_{\alpha=0\ ;\ \beta=\frac23\pi}\\ \int_0^\infty \frac{\ln^2x}{1-x +x^{2}}\ dx&=\frac{20}{81\sqrt3}\pi^3 \end{align} Thus

$$ \int_0^{\Large\frac\pi3}\ln^2\left[\dfrac{\sin x}{\sin\left(x+\frac\pi3\right)}\right]\ dx=\frac{\sqrt3}4\int_0^\infty\frac{\ln^2x}{1-x+x^2}\ dx=\large\color{blue}{\frac{5}{81}\pi^3}. $$

  • 3
    $\begingroup$ Good job! Bravo. $\endgroup$ Aug 22, 2014 at 9:25

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x :\ {\large ?}}$

\begin{align}&\color{#c00000}{% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x} =\int_{-\pi/6}^{\pi/6}\ln^{2}\pars{\sin\pars{x + \pi/6} \over \cos\pars{x}}\,\dd x \\[3mm]&=\int_{-\pi/6}^{\pi/6}\ln^{2}\pars{{\root{3} \over 2}\tan\pars{x} + \half} \,\dd x \end{align}

$$ t\equiv{\root{3} \over 2}\tan\pars{x} + \half\quad\imp\quad \left\lbrace\begin{array}{rcl} x & = & \arctan\pars{2t - 1 \over \root{3}} \\ \dd x & = & {\root{3} \over 2}\,{\dd t \over t^{2} - t + 1} \end{array}\right. $$

$$ \color{#c00000}{% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x} ={\root{3} \over 2}\int_{0}^{1}{\ln^{2}\pars{t} \over t^{2} - t + 1}\,\dd t $$ $\ds{t^{2} - t + 1 = 0}$ roots are given by $\ds{t_{\rm r} = {1 + \root{3}\ic \over 2} = \expo{\ic\pi/3}}$ and $\ds{t_{\rm r}^{*} = { 1 \over t_{\rm r}}}$ such that: \begin{align}&\color{#c00000}{% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x} ={\root{3} \over 2}\int_{0}^{1} {\ln^{2}\pars{t} \over \pars{t - t_{\rm r}}\pars{t - t_{\rm r}^{*}}}\,\dd t \\[3mm]&={\root{3} \over 2}{1 \over 2\ic\,\Im\pars{t_{\rm r}}} \int_{0}^{1}\ln^{2}\pars{t} \pars{{1 \over t - t_{\rm r}} - {1 \over t - t_{\rm r}^{*}}}\,\dd t =\Im\int_{0}^{1}{\ln^{2}\pars{t} \over t_{\rm r}^{*} - t}\,\dd t \\[3mm]&=\Im\int_{0}^{t_{\rm r}}{\ln^{2}\pars{t_{\rm r}^{*}t} \over 1 - t}\,\dd t =\Im\int_{0}^{t_{\rm r}}\ln\pars{1 - t}\bracks{% 2\ln\pars{t_{\rm r}^{*}t}\,{1 \over t}}\,\dd t \\[3mm]&=-2\Im\int_{0}^{t_{\rm r}}{{\rm Li}_{1}\pars{t} \over t}\,\ln\pars{t_{\rm r}^{*}t} \,\dd t \end{align} where $\ds{{\rm Li}_{\rm s}\pars{z}}$ is a PolyLogarithm Function.

By using the recursive property of those functions: \begin{align}&\color{#c00000}{% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x} =-2\Im\int_{0}^{t_{\rm r}}\totald{{\rm Li}_{2}\pars{t}}{t}\, \ln\pars{t_{\rm r}^{*}t}\,\dd t =2\Im\int_{0}^{t_{\rm r}}{{\rm Li}_{2}\pars{t} \over t}\,\dd t \\[3mm]&=2\Im\int_{0}^{t_{\rm r}}\totald{{\rm Li}_{3}\pars{t}}{t}\,\dd t =2\ \Im{\rm Li}_{3}\pars{t_{\rm r}} \end{align}

\begin{align}&\color{#c00000}{% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x} =-\ic\bracks{% {\rm Li}_{3}\pars{\expo{\ic\pi/3}} - {\rm Li}_{3}\pars{\expo{-\ic\pi/3}}} \\[3mm]&=-\ic\bracks{-\,{\pars{2\pi\ic}^{3} \over 3!}\,{\rm B}_{3}\pars{1 \over 6}} ={4 \over 3}\,\pi^{3}\ \overbrace{\bracks{% \pars{1 \over 6}^{3} - {3 \over 2}\,\pars{1 \over 6}^{2} +\half\,\pars{1 \over 6}}}^{\ds{=\ {5 \over 108}}} \end{align} where we used Jonquiere Inversion Formula and $\ds{{\rm B}_{n}\pars{x}}$ is a Bernoulli Polynomial with $\ds{{\rm B}_{3}\pars{x} = x^{3} - {3 \over 2}\,x^{2} + \half\,x}$.

$$ \color{#66f}{\large% \int_{0}^{\pi/3}\ln^{2}\pars{\sin\pars{x} \over \sin\pars{x + \pi/3}}\,\dd x ={5\pi^{3} \over 81}} \approx 1.9140 $$

  • 1
    $\begingroup$ Good job (+1). :-) $\endgroup$ Jun 9, 2014 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .