# How to evaluate $\int_{0}^{\pi }\theta \ln\tan\frac{\theta }{2} \, \mathrm{d}\theta$

I have some trouble in how to evaluate this integral: $$\int_{0}^{\pi}\theta\ln\left(\tan\left(\theta \over 2\right)\right) \,\mathrm{d}\theta$$ I think it maybe has another form $$\int_{0}^{\pi}\theta\ln\left(\tan\left(\theta \over 2\right)\right) \,\mathrm{d}\theta = \sum_{n=1}^{\infty}{1 \over n^{2}} \left[\psi\left(n + {1 \over 2}\right) - \psi\left(1 \over 2\right)\right]$$

Obviously we have $$\int_{0}^{\pi }\theta \ln\tan\frac{\theta }{2}\mathrm{d}\theta =4\int_{0}^{\pi /2}x\ln \tan x\mathrm{d}x$$ then use the definition of Lobachevskiy Function(You can see this in table of integrals,series,and products,Eighth Edition by Ryzhik,page 900) $$\mathrm{L}\left ( x \right )=-\int_{0}^{x}\ln\cos x\mathrm{d}x,~ ~ ~ ~ ~ -\frac{\pi }{2}\leq x\leq \frac{\pi }{2}$$ Hence we have \begin{align*} \int_{0}^{\pi /2}x\ln\tan x\mathrm{d}x &= x\left [ \mathrm{L}\left ( x \right )+\mathrm{L}\left ( \frac{\pi }{2}-x \right ) \right ]_{0}^{\pi /2}-\int_{0}^{\pi /2}\left [ \mathrm{L}\left ( x \right )+\mathrm{L}\left ( \frac{\pi }{2}-x \right ) \right ]\mathrm{d}x\\ &= \left ( \frac{\pi }{2} \right )^{2}\ln 2-2\int_{0}^{\pi /2}\mathrm{L}\left ( x \right )\mathrm{d}x \end{align*} use $$\mathrm{L}\left ( x \right )=x\ln 2-\frac{1}{2}\sum_{k=1}^{\infty }\frac{\left ( -1 \right )^{k-1}}{k^{2}}\sin 2kx$$ (Integrate the fourier series of $\ln\cos x$ from $0$ to $x$.)

we can calculate \begin{align*} \int_{0}^{\pi /2}\mathrm{L}\left ( x \right )\mathrm{d}x&=\frac{1}{2}\left ( \frac{\pi }{2} \right )^{2}\ln 2-\frac{1}{2}\sum_{k=1}^{\infty }\frac{\left ( -1 \right )^{k-1}}{k^{2}}\int_{0}^{\pi /2}\sin 2kx\mathrm{d}x \\ &= \frac{\pi ^{2}}{8}\ln 2-\frac{1}{2}\sum_{k=1}^{\infty }\frac{1}{\left ( 2k-1 \right )^{3}} \end{align*} So \begin{align*} \int_{0}^{\pi/2}x\ln\tan x\mathrm{d}x &=\frac{\pi ^{2}}{4}\ln 2-2\left [ \frac{\pi ^{2}}{8}\ln 2-\frac{1}{2}\sum_{k=1}^{\infty }\frac{1}{\left ( 2k-1 \right )^{3}} \right ] \\ &=\sum_{k=1}^{\infty }\frac{1}{\left ( 2k-1 \right )^{3}}\\ &=\sum_{k=1}^{\infty } \frac{1}{k^{3}}-\sum_{k=1}^{\infty }\frac{1}{\left ( 2k \right )^{3}}=\frac{7}{8}\zeta \left ( 3 \right ) \end{align*} Hence the initial integral is $$\boxed{\Large\color{blue}{\int_{0}^{\pi }\theta \ln\tan\frac{\theta }{2}\mathrm{d}\theta=\frac{7}{2}\zeta \left ( 3 \right )}}$$ in addition,as you mentioned $$\int_{0}^{\pi }\theta \ln\tan\frac{\theta }{2}\mathrm{d}\theta=\color{red}{\sum_{n=1}^{\infty }\frac{1}{n^{2}}\left [ \psi \left ( n+\frac{1}{2} \right )-\psi \left ( \frac{1}{2} \right ) \right ]=\frac{7}{2}\zeta \left ( 3 \right )}$$ or $$\sum_{n=1}^{\infty }\frac{1}{n^{2}}\psi \left ( n+\frac{1}{2} \right )=\frac{7}{2}\zeta \left ( 3 \right )-\left ( \gamma +2\ln 2 \right )\frac{\pi ^{2}}{6}$$

• Thank you for your perfect answer,but I don't know the Lobachevskiy integral,do you have some other method to solve it. – user308493 Jan 31 '16 at 10:06
• maybe you can focus on the series you find. – Renascence_5. Jan 31 '16 at 10:08
• Look at the Clausen integral. – Zaid Alyafeai Jan 16 '17 at 8:51

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\int_{0}^{\pi}\theta\ln\pars{\tan\pars{\theta \over 2}}\,\dd\theta \,\,\,\stackrel{\theta/2\ \mapsto\ \theta}{=}\,\,\, 4\int_{0}^{\pi/2}\theta\ln\pars{\tan\pars{\theta}}\,\dd\theta \\[5mm] = &\ \left.4\,\Re\int_{0}^{\pi/2}\bracks{-\ic\ln\pars{z}} \ln\pars{\bracks{z - z^{-1}}/\bracks{2\ic} \over \bracks{z + z^{-1}}/2}\, {\dd z \over \ic z}\,\right\vert_{\ z\ =\ \exp\pars{\ic\theta}} \\[5mm] = &\ \left.-\,4\,\Re\int_{0}^{\pi/2}\ln\pars{z} \ln\pars{{1 - z^{2} \over 1 + z^{2}}\,\ic}\, {\dd z \over z}\,\right\vert_{\ z\ =\ \exp\pars{\ic\theta}} \\[1cm] = &\ 4\,\Re\int_{1}^{\epsilon}\bracks{\ln\pars{y} + {\pi \over 2}\,\ic} \bracks{\ln\pars{1 + y^{2} \over 1 - y^{2}} + {\pi \over 2}\,\ic}\, {\dd y \over y} + 4\,\Re\int_{\pi/2}^{0}\bracks{\ln\pars{\epsilon} + \ic\theta}\,{\ic\pi \over 2}\,\ic\,\dd\theta \\[5mm] + &\ 4\,\Re\int_{\epsilon}^{1}\ln\pars{x}\bracks{\ln\pars{1 - x^{2} \over 1 + x^{2}} + {\pi \over 2}\,\ic}\,{\dd x \over x} \\[1cm] = &\ \bracks{4\int_{1}^{\epsilon}\ln\pars{y}\ln\pars{1 + y^{2} \over 1 - y^{2}} {\dd y \over y} - \pi^{2}\ln\pars{\epsilon}} + \pi^{2}\ln\pars{\epsilon} + 4\int_{\epsilon}^{1}\ln\pars{x}\ln\pars{1 - x^{2} \over 1 + x^{2}} \,{\dd x \over x} \end{align}

When $\ds{\epsilon \to 0^{+}}$: \begin{align} &\int_{0}^{\pi}\theta\ln\pars{\tan\pars{\theta \over 2}}\,\dd\theta = 8\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x^{2} \over 1 + x^{2}}\,{\dd x \over x} \,\,\,\stackrel{x^{2}\ \mapsto\ x}{=}\,\,\, 2\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x \over 1 + x}\,{\dd x \over x} \\[5mm] = &\ 4\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,{\dd x \over x} - 2\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x^{2}}\,{\dd x \over x} \end{align} With $\ds{x^{2}\ \mapsto\ x}$ in the $second$ integral: \begin{align} &\int_{0}^{\pi}\theta\ln\pars{\tan\pars{\theta \over 2}}\,\dd\theta = 4\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,{\dd x \over x} - {1 \over 2}\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,{\dd x \over x} \\[5mm] = &\ -\,{7 \over 2}\int_{0}^{1}\ln\pars{x}\overbrace{\bracks{-\,{\ln\pars{1 - x} \over x}}}^{\ds{\mrm{Li}_{2}\,'\pars{x}}}\ \,\dd x = {7 \over 2}\int_{0}^{1} \overbrace{\mrm{Li}_{2}\pars{x} \over x}^{\ds{\mrm{Li}_{3}\,'\pars{x}}}\ \,\dd x = {7 \over 2}\,\mrm{Li}_{3}\pars{1} = \bbx{\ds{{7 \over 2}\,\zeta\pars{3}}} \end{align}

Here's another way to solve the integral.

$$\int_{0}^{\pi}\theta \ln\tan\frac{\theta}{2}\mathrm{d}\theta = 4\int_{0}^{\frac{\pi}{2}}x\ln\tan{x}\mathrm{d}x = 4\left(\int_{0}^{\frac{\pi}{2}}x\ln\sin{x}\mathrm{d}x-\int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x\right)$$

We solve the later integral first. But before that, recall, $\cos{x} = \frac{e^{ix}+e^{-ix}}{2}$

\begin{align*} \int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x &= \operatorname{Re}\left[\int_{0}^{\frac{\pi}{2}}x\ln\left(\frac{e^{ix}+e^{-ix}}{2}\right)\mathrm{d}x\right]\\ &= \operatorname{Re}\left[\int_{0}^{\frac{\pi}{2}}x\ln\left(\frac{1+e^{2ix}}{2e^{ix}}\right)\mathrm{d}x\right] \\ &= \operatorname{Re}\left[\int_{0}^{\frac{\pi}{2}}x\ln(1+e^{2ix})-x\ln(2e^{ix})\mathrm{d}x\right] \\ \end{align*}

Here, we use the maclaurin expansion of $\ln(1+x) = \sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}x^k$

\begin{align*} \int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x &= \operatorname{Re}\left[\int_{0}^{\frac{\pi}{2}}x\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}(e^{i2kx})\mathrm{d}x -\int_0^{\frac{\pi}{2}} x\ln(2) \mathrm{d}x - \int_0^{\frac{\pi}{2}} ix^2\mathrm{d}x\right] \\ \end{align*}

Interchanging the integral and sum, we get

\begin{align*} \int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x &= \operatorname{Re}\left[\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\left(\int_{0}^{\frac{\pi}{2}} x(e^{i2k})^x \mathrm{d}x \right) - \frac{\pi^2}{4}\ln 2 - i\frac{\pi^3}{24}\right] \\ \end{align*}

Now observe that $$\int xa^x \mathrm{d}x = \frac{xa^x}{\ln{a}} - \frac{a^x}{(\ln{a})^2} + C$$ (by Integration by Parts) \begin{align*} \int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x &= \operatorname{Re}\left[\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\left(\frac{x(e^{2ki})^x}{i2k}+\frac{(e^{i2k})^x}{4k^2}\right|_0^\frac{\pi}{2} - \frac{\pi^2}{4}\ln 2 - i\frac{\pi^3}{24}\right] \\ &= \operatorname{Re}\left[\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\left(\frac{-i\pi}{4k}e^{ik\pi} + \frac{1}{4k^2} (e^{ik\pi}-1)\right) - \frac{\pi^2}{4}\ln 2 - i\frac{\pi^3}{24}\right] \\ &= \operatorname{Re}\left[-i\frac{\pi}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k^2}e^{ik\pi} + \sum_{k=1}^\infty \frac{(-1)^{k+1}}{4k^3} (e^{ik\pi}-1) - \frac{\pi^2}{4}\ln 2 - i\frac{\pi^3}{24}\right] \\ \end{align*}

Since, $$e^{ik\pi} = \begin{cases} 1 & k \equiv 0 \pmod{2} \\ -1 & k \equiv 1 \pmod{2} \\ \end{cases}$$ And taking only the real part, we finally arrive at $$\int_{0}^{\frac{\pi}{2}}x\ln\cos{x}\mathrm{d}x = \sum_{k=1\\ \text{k odd}}^\infty \frac{(-1)^k}{2k^3} - \frac{\pi^2}{4}\ln 2$$ Evaluate the sum as, \begin{align*} \sum_{k=1\\ \text{k odd}}^\infty \frac{(-1)^k}{2k^3} &= \frac{-1}{2} \sum_{k=1}^\infty \frac{1}{(2k-1)^3} \\ &= \frac{-1}{2} \left(\zeta(3) - \sum_{k=1}^\infty \frac{1}{(2k)^3} \right) \\ &= \frac{-7}{16}\zeta(3) \end{align*} Therefore, $$\int_0^\frac{\pi}{2} x\ln\cos{x} \mathrm{d}x = \frac{-7}{16}\zeta(3) - \frac{\pi^2}{8}\ln2$$ In a similar way, you can show that $$\int_0^\frac{\pi}{2} x\ln\sin{x} \mathrm{d}x = \frac{7}{16}\zeta(3) - \frac{\pi^2}{8}\ln2$$ And hence you get – $$\boxed{\int_{0}^{\pi}\theta \ln\tan\frac{\theta}{2}\mathrm{d}\theta = \frac{7}{2}\zeta(3)}$$

P.S. I am not sure as to how should I justify for the interchange of integral and sum.