TITLE: Integration of $\frac{1}{x\ln(x)}$ by parts
QUESTION [6 upvotes]: I tried to solve $\int \frac{dx}{x\ln(x)}$ by parts. I have done it as usual:
$$\int \frac{dx}{x\ln(x)}=\begin{bmatrix}
f(x)=\frac{1}{\ln x} & g'(x)=\frac{1}{x}\\ 
f'(x)=-\frac{1}{x\ln^2x} & g(x)=\ln x
\end{bmatrix} = \frac{1}{\ln x} \ln x - \int \left(-\frac{1}{x\ln^2x}\ln x\right)dx=$$ 
$$
=1+\int \left(\frac{dx}{x\ln x}\right)
$$ 
So, taking most left and right part we get:
$$
\int \frac{dx}{x\ln(x)}=1+\int \left(\frac{dx}{x\ln x}\right)
$$
By subtracting integral from both sides, we get:
$$
0=1
$$
I know that $\int \frac{dx}{x\ln(x)}=\ln(\ln x)+C$. However, I often use integration by parts and I wonder what is wrong here, and what should I do to avoid it (here it's plainly wrong, but what if the mistake was more subtle?). I guess may be something connected with constants, but I used to add them at the very end(wrongly?).

REPLY [3 votes]: A simpler example of this "paradox":
$$\int \frac1x \, dx = \int 1 \frac1x \, dx = x \frac1x - \int x \left(-\frac{1}{x^2}\right) \, dx = 1 + \int \frac1x \, dx$$