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"


This line $$\int \frac{1}{f} \frac{df}{dx} dx = \frac{1}{f} f - \int f \left(-\frac{1}{f^2} \frac{df}{dx}\right) dx$$ should be $$\int_a^b \frac{1}{f} \frac{df}{dx} dx = \left[\frac{1}{f} f\right]_a^b - \int_a^b f \left(-\frac{1}{f^2} \frac{df}{dx}\right) dx$$ so $$\int_a^b \frac{1}{f} \frac{df}{dx} dx = \left[1\right]_a^b - \int_a^b f \left(-\frac{1}{f^2} \frac{df}{dx}\right) dx$$ and $\left[1\right]_a^b=0$