For this integral: $\int_0^{\frac{\pi}{4}} x \tan(x) dx$ For the following integral: $$\int_0^{\frac{\pi}{4}} x \tan(x) dx=\frac{G}{2}-\frac{\pi\ln(2)}{8}$$ where $G$ is Catalan's constant. After integrating by parts, it is equivalent to compute $\int_0^{\pi/4} \ln(\cos(x)) dx$. How can I proceed further?
 A: We want to evaluate the definite integral
$$ \mathcal{I} = \displaystyle \int_0^{\frac{\pi}{4}} \ln( \cos x ) \ \mathrm dx $$
We note that
$$ \begin{align} \ln(\cos{x}) &=\frac12\Big( ( \ln(\sin{x}) + \ln(\cos{x}) ) -(\ln(\sin{x}) -\ln(\cos{x}))\Big) \\ &= \frac12 \ln \Big( \frac{\sin(2x)}{2}\Big) -\frac12\ln(\tan{x}) \\ &= \frac12\ln(\sin(2x)) -\frac12 \ln(2) - \frac12\ln(\tan{x}) \end{align}$$
Using this, the integrand simplifies to
$$ \mathcal{I} =\frac12 \displaystyle \int_0^{\frac{\pi}{4}} \ln(\sin(2x))\ \mathrm dx - \frac12 \int_0^{\frac{\pi}{4}} \ln(\tan{x})\ \mathrm dx  -\frac12\int_0^{\frac{\pi}{4}} \ln{2} \ \mathrm dx $$
Starting with the second integral, it is a well known result.
$$ \int_0^{\frac{\pi}{4}} \ln(\tan{x})\ \mathrm dx = -G$$
$ G$ denotes Catalan's constant.
For the first integral, the substitution $ 2x=t $ gives
$$\dfrac{1}{2}\int_0^{\frac{\pi}{2}} \ln(\sin{x})\ \mathrm dx $$
This integral just equals $ - \dfrac{\pi}{4}\ln{2}$, by using the well known result
$$ \int_0^{\frac{\pi}{2}} \ln(\sin{x})\ \mathrm dx = - \dfrac{\pi}{2}\ln{2}$$
The third integral is trivial and equals $ \frac{\pi}{4}\ln{2}$.
Summing up the values of the 3 integrals, our original integral equals
$$ \boxed{\boxed{\int_0^{\frac\pi4}\ln(\cos x )\,\mathrm dx =\frac G2 - \dfrac{\pi}{4}\ln{2}}} $$
And using integration by parts,
$$\begin{align}\int_0^{\frac\pi4}x\tan x\,\mathrm dx &= \frac\pi8\ln2+\int_0^{\frac\pi4}\ln(\cos x)\,\mathrm dx \\ &= \frac G2-\frac\pi8\ln2\end{align}$$
Which matches the result given in the OP.
EDIT
As people had problems with the second integral, here is solution.
The Catalan's constant is defined as
$$G=\beta(2)= \sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^2}$$
Here $\beta(\cdot)$ denotes the Dirichlet's beta function.
In our integral, we substitute $\tan x = t$.
$$\begin{align}\int_0^{\frac\pi4}\ln \tan x\,\mathrm dx &= \int_0^1 \frac{\ln t}{1+t^2}\,\mathrm dt \\ &= \sum_{k=0}^\infty(-1)^k \int_0^1 x^{2k}\ln x\,\mathrm dx \\ &= -\sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)^2}\\ &= -G\end{align}$$
A: Using the complex definition of cosine,
$$\begin{align}\ln\cos x&= \ln\Big(\frac{e^{ix}+e^{-ix}}2\Big) \\ &= ix+\ln(1+e^{-2ix})-\ln2 \\ &= -ix+\ln(1+e^{2ix})-\ln2 \\ \implies \ln\cos x &= -\ln 2 +\frac12(\ln(1+e^{2ix})+\ln(1+e^{-2ix})) \\ &= -\ln 2 -\frac12 \sum_{k=1}^\infty (-1)^k\frac1k(e^{2ikx}+e^{-2ikx}) \\ \ln\cos x&= -\ln2-\sum_{k=1}^\infty \frac{(-1)^k}k\cos(2kx) \end{align}$$
This is the Fourier series of $\ln\cos x$. Using this result,
$$\begin{align}I =\int_0^{\pi/4}\ln\cos x\,\mathrm dx &= \int_0^{\pi/4}-\ln2 -\sum_{k=1}^\infty\frac{(-1)^k}k \cos(2k x)\,\mathrm dx \\ &= -\frac\pi4\ln2-\sum_{k=1} ^\infty \frac{(-1)^k}k\int_0^{\pi/4}\cos(2kx)\,\mathrm dx \\  &= -\frac\pi4\ln2-\frac12\sum_{k=1}^\infty \frac{(-1)^k}{k^2} \sin\Big(\frac{k\pi}2\Big) \end{align}$$
Now, we note that for $k\in\mathbb Z$
$$\sin(k\pi) =0 , \quad \sin\Big(\frac{(2k+1)\pi}2\Big) = (-1)^k $$
Using this, we re-index our sum.
$$\begin{align}I &= -\frac\pi4\ln2-\frac12\sum_{k=0}^\infty\frac{(-1)^{2k+1}(-1)^k}{(2k+1)^2} \\ &= -\frac\pi4\ln2+\frac12\sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)^2} \\ I &= \frac G2-\frac\pi4\ln2 \end{align}$$
A: To the nice solutions - just to add another approach (which does not use the trigonometry):
$$I=\int_0^{\pi/4}x\tan xdx=(x=\tan^{-1}t)\,\,\int_0^1\tan^{-1}t\frac{tdt}{1+t^2}$$
$$= (IBP)\,\,\,\,\frac{\pi\ln2}{8}\ln2-\frac{1}{2}\int_0^1\frac{\ln(1+t^2)}{1+t^2}dt$$
Making change $x=1/t$
$$\int_0^1\frac{\ln(1+t^2)}{1+t^2}dt=\int_1^\infty\frac{\ln(1+x^2)}{1+x^2}dx-2\int_1^\infty\frac{\ln x}{1+x^2}dx$$
$$2\int_0^1\frac{\ln(1+t^2)}{1+t^2}dt=\int_0^\infty\frac{\ln(1+x^2)}{1+x^2}dx-2G$$
The last integral it is easy to evaluate via complex integration:
$$\int_0^\infty\frac{\ln(1+x^2)}{1+x^2}dx=\Re\int_{-\infty}^\infty\frac{\ln(1-ix)}{1+x^2}dx$$
Closing the contour in the upper half-plane (where we have one simple pole and no branch points for the chosen integrand)
$$\int_{-\infty}^\infty\frac{\ln(1-ix)}{1+x^2}dx=2\pi i\operatorname{Res}_{x=i}\frac{\ln(1-ix)}{1+x^2}=2\pi i\frac{\ln2}{2i}=\pi\ln2$$
Taking all together
$$I=\frac{\pi\ln2}{8}-\frac{\pi\ln2}{4}+\frac{G}{2}=\frac{G}{2}-\frac{\pi\ln2}{8}$$
A: By integration by parts, we have
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{4}} x \tan x d x &=-\int_{0}^{\frac{\pi}{4}} x d(\ln (\cos x)) \\
&=-\left[ x \ln (\cos x)\right]_{0}^{\frac{\pi}{4}}+\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x\\&= -\frac{\pi}{4} \ln \left(\frac{1}{\sqrt{2}}\right)+\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x
\end{aligned}
$$
By my post in Quora,
$$\int_{0}^{\frac{\pi}{4}} \ln (\cos x) dx =-\frac{\pi}{4} \ln 2+\frac{G}{2},\tag*{} $$
$\textrm{where G is the Catalan's constant.}$
Hence we can conclude that
$$\begin{aligned}\int_{0}^{\frac{\pi}{4}} x \tan x d x &= -\frac{\pi}{4} \ln \left(\frac{1}{\sqrt{2}}\right) -\frac{\pi}{4} \ln 2+\frac{G}{2}\\&=  -\frac{\pi}{8} \ln 2+\frac{G}{2}\end{aligned}$$
A: Rewrite the integral as
\begin{align}
\int_{0}^{\frac{\pi}{4}} x \tan x d x 
&=-\int_{0}^{\frac{\pi}{4}} x d[\ln (2\cos x)]
\overset{ibp}=
 -\frac{\pi}{8} \ln2 +I
\end{align}
where
$I=\int_{0}^{\frac{\pi}{4}} \ln (2\cos x) dx
$, along with $J=\int_{0}^{\frac{\pi}{4}} \ln (2\sin x) dx
$. Note
\begin{align}
I-J&=-\int_0^{\frac\pi4}\ln (\tan x )dx=G\\
I+J &= \int_{0}^{\frac{\pi}{4}} \ln (2\sin 2x) dx
\overset{x\to\frac\pi4 -x}= \int_{0}^{\frac{\pi}{4}} \ln (2\cos 2x) dx\\
&=\frac12 \int_{0}^{\frac{\pi}{4}} \ln (4\sin 2x\cos2x) dx \overset{2x\to x}= \frac14 \int_{0}^{\frac{\pi}{2}} \ln (2\sin 2x) dx\\
&= \frac12 (I+J)=0
\end{align}
which leads to $I=\frac12G$ and
$$\int_{0}^{\frac{\pi}{4}} x \tan x d x =  \frac12G -\frac{\pi}{8} \ln2 $$
