Why is $\frac{d}{dx}\ln |x|=\frac 1x$

Here is an intuitive reason for why this is true.

Note that $\ln|x|, x < 0$ is a reflection of $\ln|x|, x > 0$ through the $y$-axis. Now recall that the instantaneous rate of change $\frac{dy}{dx}$ is loosely speaking, $\frac{\text{change in }y}{\text{change in }x}$ for a very small interval.

The change in $y$ is unaffected, but when $x < 0$, the change in $x$ is negative compared to $x > 0$ because of the reflection. Therefore, when $x < 0$, we first reflect $x \to -x$ to map $x > 0$ to the domain $x < 0$, and then adjust the slope $\frac{d}{dx}$ to get $\ln |x| = -\frac{1}{-x} = \frac{1}{x}$.


Original answer:

$\ln x$ is only defined when $x > 0$ (at least in the real numbers). When $x > 0$, $|x| = x$, and hence $\frac{1}{|x|} = \frac{1}{x}$.


Maybe you know $\frac{d}{dx}\ln(u(x))=\frac{u'}{u}$ and $$\forall x\neq 0 \to \frac{d}{dx}|x|=\frac{|x|}{x}$$ so $$\frac{d}{dx}\ln(|x|)=\frac{\frac{|x|}{x}}{|x|}=\frac 1{x}$$
Remark: there is no difference between $\frac{|x|}{x}$ and $\frac x{|x|}$ because $$\frac{|x|}{x}=\\\frac{|x|}{x}\times \frac{|x|}{|x|} \\=\frac{x^2}{x|x|}\\=\frac{x}{|x|}$$


Adding to Toby's answer, we will need to show the case for $x < 0$.

Note that $\mathbb R_{\ne 0}$ is open, allowing $\ln |x|$ to be differentiable in every point in its domain.

We have for $x < 0$:

$$\frac d {dx} \ln |x|=\frac d {dx}\ln (-x)=\frac 1 {-x}(-1)=\frac1x$$

(and of course for $x>0$, $\dfrac d{dx}\ln |x| =\dfrac d {dx}\ln x=\dfrac1x$.