Using Integration By Parts results in 0 = 1

Hint: Constant of integration.


You have correctly derived that $0 = 1$... modulo constants.

Antiderivatives are only well-defined modulo constants*; e.g. both $x$ and $x+1$ are antiderivatives (with respect to $x$) of $1$. The equation you wrote is implicitly only meant to be an equation modulo constants; that is, the two sides of the equation don't have to be equal: they're allowed to differ by a constant.

This is traditionally worked around by adding a "constant of integration" in an ad-hoc manner rather than trying to introduce modular arithmetic. This ad-hoc fix can be tricky to get right in a nontrivial algebraic calculation if you don't fully understand what's going on, as your calculation shows.

When you cancel out the two copies of $\int\frac{1}{f} \frac{df}{dx} \, dx$, that doesn't get rid of the fact that the equation is still only meant to hold modulo constants: you've merely eliminated your mental cue (the presence of an antiderivative) to remind you of that fact.

*: Technically, I should say "locally constant functions in the integration variable" rather than "constants"