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]
$$
 A: 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}$$
A: $\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}
A: 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.
A: \begin{align}
J&=\int_0^\pi \theta\ln\left(\tan\left(\frac{\theta}{2}\right)\right)d\theta\\
&\overset{u=\tan\left(\frac{\theta}{2}\right)}=4\underbrace{\int_0^\infty \frac{\arctan u\ln u}{1+u^2}du}_{=K}\\
K&\overset{\text{IBP}}=\underbrace{\left[\arctan u\left(\int_0^u \frac{\ln t}{1+t^2}dt\right)\right]_0^\infty}_{=0}-\int_0^\infty \frac{1}{1+u^2}\left(\underbrace{\int_0^u \frac{\ln t}{1+t^2}dt}_{y(t)=\frac{t}{u}}\right)du\\
&=-\int_0^\infty \left(\int_0^1 \frac{u\ln(uy)}{(1+u^2)(1+u^2y^2)}dy\right)du\\
&=-\int_0^\infty \left(\int_0^1 \frac{u\ln u}{(1+u^2)(1+u^2y^2)}dy\right)du-\int_0^1 \left(\int_0^\infty \frac{u\ln y}{(1+u^2)(1+u^2y^2)}du\right)dy\\
&=-\int_0^\infty \left[\frac{\arctan(uy)}{1+u^2}\right]_{y=0}^{y=1}\ln udu-\frac{1}{2}\int_0^1 \left[\frac{\ln\left(\frac{1+u^2}{1+u^2y^2}\right)}{1-y^2}\right]_{u=0}^{u=\infty}\ln ydy\\
&=-K+\int_0^1 \frac{\ln^2 y}{1-y^2}dy\\
&=\frac{1}{2}\int_0^1 \frac{\ln^2 y}{1-y}dy-\frac{1}{2}\underbrace{\int_0^1 \frac{y\ln^2 y}{1-y^2}dy}_{z=y^2}\\
&=\frac{7}{16}\int_0^1 \frac{\ln^2 y}{1-y}dy\\
J&=\frac{7}{4}\int_0^1 \frac{\ln^2 y}{1-y}dy\\
J&=\frac{7}{4}\times 2\zeta(3)\\
&=\boxed{\frac{7}{2}\zeta(3)}
\end{align}
A: I ran across this question while researching a duplicate question.
I had written the following answer, which seems to be a different approach to the answers I've seen so far.

As shown in this answer
$$
\log(\sin(x))=-\log(2)-\sum_{k=1}^\infty\frac{\cos(2kx)}{k}\tag1
$$
and
$$
\log(\cos(x))=-\log(2)+\sum_{k=1}^\infty(-1)^{k-1}\frac{\cos(2kx)}{k}\tag2
$$
Subtraction yields
$$
\log(\tan(x))=-2\sum_{k=0}^\infty\frac{\cos((4k+2)x)}{2k+1}\tag3
$$
Therefore,
$$
\begin{align}
\int_0^{\pi/2}x\log(\tan(x))\,\mathrm{d}x
&=-2\sum_{k=0}^\infty\int_0^{\pi/2}\frac{x\cos((4k+2)x)}{2k+1}\,\mathrm{d}x\tag{4a}\\
&=-4\sum_{k=0}^\infty\frac1{(4k+2)^3}\int_0^{(2k+1)\pi}x\cos(x)\,\mathrm{d}x\tag{4b}\\
&=-\frac12\sum_{k=0}^\infty\frac1{(2k+1)^3}\int_0^{(2k+1)\pi}x\,\mathrm{d}\sin(x)\tag{4c}\\
&=\frac12\sum_{k=0}^\infty\frac1{(2k+1)^3}\int_0^{(2k+1)\pi}\sin(x)\,\mathrm{d}x\tag{4d}\\
&=\sum_{k=0}^\infty\frac1{(2k+1)^3}\tag{4e}\\[3pt]
&=\frac78\zeta(3)\tag{4f}
\end{align}
$$
Explanation:
$\text{(4a):}$ apply $(3)$
$\text{(4b):}$ substitute $x\mapsto\frac{x}{4k+2}$
$\text{(4c):}$ prepare to integrate by parts
$\text{(4d):}$ integrate by parts
$\text{(4e):}$ evaluate the integral
$\text{(4f):}$ $\underbrace{\sum\frac1{(2k+1)^3}}_\text{odds}=\underbrace{\sum\frac1{(k+1)^3}}_\text{all}-\underbrace{\sum\frac1{(2k+2)^3}}_\text{evens}=\frac78\sum\frac1{(k+1)^3}$
Thus,
$$
\begin{align}
\int_0^\pi\theta\log(\tan(\theta/2))\,\mathrm{d}\theta
&=4\int_0^{\pi/2}x\log(\tan(x))\,\mathrm{d}x\tag{5a}\\[3pt]
&=\frac72\zeta(3)\tag{5b}
\end{align}
$$
Explanation:
$\text{(5a):}$ $\theta=2x$
$\text{(5b):}$ apply $(4)$
A: As an alternative to kishlaya's answer, we have the Fourier series
$$\ln(\cos(x)) = -\ln(2) - \sum_{k=1}^\infty (-1)^k\frac{\cos(2kx)}k \\ \ln(\sin(x)) = -\ln(2) - \sum_{k=1}^\infty \frac{\cos(2kx)}k$$
and hence
$$\int_0^{\frac\pi2} \ln(\cos(x)) \, dx \stackrel{x\mapsto\frac\pi2-x}= \int_0^{\frac\pi2} \ln(\sin(x)) \, dx = -\frac\pi2 \ln(2)$$
Now,
$$\int_0^{\frac\pi2} x \ln(\cos(x)) \, dx \stackrel{x\mapsto\frac\pi2-x}= \int_0^{\frac\pi2} \left(\frac\pi2-x\right) \ln(\sin(x)) \, dx = -\frac{\pi^2}4 \ln(2) - \int_0^{\frac\pi2} x\ln(\sin(x)) \, dx$$
$$\implies \int_0^\pi x \ln\left(\tan\left(\frac x2\right)\right) \, dx = 8\int_0^{\frac\pi2} x\ln(\sin(x)) \, dx + \pi^2 \ln(2)$$
For the remaining integral, we have
$$\begin{align*}
\int_0^{\frac\pi2} x \ln(\sin(x)) \, dx &= -\ln(2) \int_0^{\frac\pi2} x \, dx - \int_0^{\frac\pi2} \sum_{k=1}^\infty \frac{x\cos(2kx)}k \, dx \\[1ex]
&= -\frac{\pi^2}8\ln(2) - \sum_{k=1}^\infty \frac1k \int_0^{\frac\pi2} x \cos(2kx) \, dx \\[1ex]
&= -\frac{\pi^2}8 \ln(2) - \frac14 \sum_{k=1}^\infty \frac{(-1)^k-1}{k^3} \\[1ex]
&= -\frac{\pi^2}8 \ln(2) - \frac14 \left(-\frac34\zeta(3)-\zeta(3)\right) \\[1ex]
&= -\frac{\pi^2}8 \ln(2) + \frac7{16} \zeta(3)
\end{align*}$$
and it follows that
$$\int_0^\pi x \ln\left(\tan\left(\frac x2\right)\right) \, dx = \boxed{\frac72\zeta(3)}$$
