Trying to evaluate $\int_{0}^{1}\ln x\ln\left(\frac{\ln x}{\ln x-1}\right) dx$ I want to compute this integral
$$I=\int_{0}^{1}\ln x\ln\left(\frac{\ln x}{\ln x-1}\right)\mathrm dx$$
Applying integration by parts
$u=\ln\left(\frac{\ln x}{\ln x-1}\right)$
$\mathrm du=\frac{\ln x-1}{\ln x}\left(\frac{1}{x(\ln x-1)}-\frac{\ln x}{x(\ln x-1)^2}\right)dx$
$\mathrm dv=\ln x \mathrm dx$
$v=x\ln x-x $
$$I=x(\ln x-1)\ln\left(\frac{\ln x}{\ln x-1}\right)-\int x(\ln x-1)^2\left(\frac{1}{x(\ln x-1)}-\frac{\ln x}{x(\ln x-1)^2}\right)\mathrm dx$$
$$I=x(\ln x-1)\ln\left(\frac{\ln x}{\ln x-1}\right)-\int \frac{1}{\ln x}\mathrm dx$$
$$I=\int_{0}^{1} \frac{1}{\ln x}\mathrm dx$$
this is where I got so far, but I can't continue...
 A: Make the change of variable $x\mapsto e^{-x}$ and integrate by parts two times to arrive at 
$$I=\int_{0}^{1}\ln x\ln\left(\frac{\ln x}{\ln x-1}\right)\mathrm dx=-\int_0^{\infty} \log(x) e^{-x}\mathrm dx=\gamma.$$
A: Your last line is not quite right. It is true that 
$$ \int \log x \log\left(\frac{\log x}{\log x - 1}\right) \, dx
= x(\log x - 1)\log\left(\frac{\log x}{\log x - 1}\right) + \int \frac{dx}{\log x} $$
on $(0, 1)$. But you cannot simply plug $x = 0$ or $x = 1$ since the RHS has singularity at those points. Thankfully, the lower limit $x = 0$ poses little issue, yielding
$$ \int_{0}^{a} \log x \log\left(\frac{\log x}{\log x - 1}\right) \, dx
= a(\log a - 1)\log\left(\frac{\log a}{\log a - 1}\right) + \int_{0}^{a} \frac{dx}{\log x} \tag{1} $$
For the upper limit $x = 1$, we are out of luck as the RHS becomes the difference of two divergent terms. To resolve this issue, write $a = 1-\epsilon$ for $\epsilon > 0$. Our aim is to study the behavior of $\text{(1)}$ as $\epsilon \downarrow 0$. Now it is not hard to check that
$$ a(\log a - 1)\log\left(\frac{\log a}{\log a - 1}\right)
= -\log\epsilon + \mathcal{O}(\epsilon). $$
Now using the identity $ -\log\epsilon = \int_{0}^{1-\epsilon} \frac{dx}{1-x} $, we find that
\begin{align*}
\int_{0}^{1-\epsilon} \log x \log\left(\frac{\log x}{\log x - 1}\right) \, dx
&= -\log\epsilon + \int_{0}^{1-\epsilon} \frac{dx}{\log x} + \mathcal{O}(\epsilon) \\
&= \int_{0}^{1-\epsilon} \left( \frac{1}{1-x} + \frac{1}{\log x} \right) \, dx + \mathcal{O}(\epsilon).
\end{align*}
Now the integrand in the RHS has removable singularity at $x = 1$ and we can safely let $\epsilon \downarrow 0$ to obtain
$$ I = \int_{0}^{1} \left( \frac{1}{1-x} + \frac{1}{\log x} \right) \, dx. $$
This is a well-known representation of the Euler-Mascheroni constant $\gamma$.
