A “proof” for $0=1$ by integrating $\int \frac{dx}{x\ln x}$ by parts [duplicate]

Let's consider the indefinite integral $$\int \frac{dx}{x\ln x}.$$ We will compute it by integrating by parts: $$\int \frac{dx}{x\ln x}=\int (\ln x)'\frac{dx}{\ln x}=1+\int \frac{dx}{x\ln x}.$$ Hence, $$0=1$$. The question is : is there anything wrong in these computations?

Note: I came across this example while reading a book on counterexamples in real analysis. I thought that the people here would find this funny, especially because the error is not so obvious to everyone.

• Any two antiderivatives differ by only a constant. 1 is a perfect example of such a constant. – InterstellarProbe Jun 26 '19 at 21:24
• One of my favorites: $0 = (1 - 1) + (1 - 1) + (1-1) + \ldots = 1 + (-1 + 1) + (-1 + 1) + (-1 + 1) + \ldots = 1$ – I.Chekhov Jun 26 '19 at 21:34
• Your Note suggests that you already know the answer to your question, so it's not really appropriate to post it here. – Blue Jun 26 '19 at 21:37
• @I.Chekhov I like this one too. Depending on how you manipulate it you can also show it equals $-1$ and $1/2$ since really it could take any value that satisfies $|S|\le 1$ – Henry Lee Jun 26 '19 at 22:31
• Thank you guys for your input! I thought that maybe there are more like this one, but I just wanted to show people here another example. @Blue the book only said "this is wrong because we cannot reduce indefinite integrals". I basically knew that this isn't allowed, but now other users added further explanations for this. – Alexdanut Jun 26 '19 at 22:38

The issue here is what an indefinite integral means. An indefinite integral $$\int f(x)dx$$ is not a single function; rather, it's best thought of as a set of functions, namely, the set $$\{F: {d\over dx}F=f\}.$$ Elements of this set are called antiderivatives, or primitives, of $$f$$.
This set will always contain more than one element, since adding a constant won't affect the derivative. Notation like $$\int xdx={x^2\over 2}+C$$ is shorthand for "$$\int xdx$$ is the set of functions of the form $$x\mapsto {x^2\over 2}+C$$ for some $$C\in\mathbb{R}$$."
Note that it's not always the case that two antiderivatives must always differ by a constant: if the domain of the function is "not connected," we have more options. E.g. consider the function $$f:x\mapsto {1\over x}$$, defined on $$\mathbb{R}-\{0\}$$, has two "pieces" which can behave very differently: the function $$F$$ sending $$x<0$$ to $$\ln(\vert x\vert) + 42$$ and $$x>0$$ to $$\ln( x) -17$$ is an antiderivative of $$f$$, even though it doesn't differ from the "usual" antiderivative $$x\mapsto\ln(\vert x\vert)$$ by a constant.