Why is $\int \frac{du}{u}$ equal to $\ln|u|$

calculusindefinite-integralslogarithmssolution-verification

Why is $\displaystyle \int\dfrac{dx}{x} = \ln|x|$?

What I am asking is about the absolute value. I know that it is used so that $\ln x$ will not have an undefined value for $x < 0$. How can we recheck if this is the correct antiderivative? We take the derivative.

Let $f(x) = \ln|x|$ and $u = |x|$. Then,
$$\begin{align*}\dfrac{df}{dx} &= \dfrac{df}{du}\cdot\dfrac{du}{dx} \\ &=\frac{1}{u}\cdot\frac{x}{|x|} \\ &= \frac{1}{|x|}\cdot\frac{x}{|x|} \\ &=\frac{x}{|x|^{2}}\end{align*}$$

This seems odd. What did I do wrong? Should I get the derivative for $x < 0$ and $x > 0$ separately?


Edit: This might be similar to this, but what I am asking for is confirming that the antiderivative obtained is correct by taking the derivative.

Best Answer

Since $\dfrac x{|x|^2}=\dfrac x{x^2}=\dfrac1x$, you get that $\dfrac{\mathrm df}{\mathrm dx}=\dfrac1x$.

Anyway, the simplest approach consists in using the fact that$$\ln|x|=\begin{cases}\ln(x)&\text{ if }x>0\\\ln(-x)&\text{ if }x<0.\end{cases}$$

Related Question