Away from the corner, the absolute value is a straight line of slope \(\pm 1\).
\[\frac{d}{dx}\left|x\right| = \operatorname{sgn} x, \; x \neq 0\]
What it says
\(\left|x\right|\) is \(x\) for positive \(x\) and \(-x\) for negative \(x\), so its slope is \(+1\) on the right and \(-1\) on the left. That is exactly the sign function, \(\operatorname{sgn} x\).
At \(x = 0\) there is no derivative at all. Approaching from the right the difference quotient is \(+1\), from the left \(-1\); the one-sided limits disagree, so the two-sided limit does not exist. The graph has a corner, not a tangent.
For a compound argument the chain rule applies as usual: \(\frac{d}{dx}\left|u\right| = \operatorname{sgn}(u)\,u'\), valid wherever \(u \neq 0\).
When it applies
\(\left|x\right|\) or \(\texttt{abs(x)}\), alone or inside a larger expression.
Anywhere the argument is nonzero — the answer is undefined at the zeros of the argument.
Also covers \(\sqrt{x^{2}}\), which is \(\left|x\right|\) rather than \(x\).
Five worked examples
Every line is the step the calculator would show, in the order it applies them. Each graph
is live: hover it to read both curves and see the tangent whose slope is the derivative,
drag to pan, scroll to zoom.
1
Example 1
\[\frac{d}{dx}\left[\left|x\right|\right]\]
Split by sign: the graph is \(-x\) then \(x\).
\[\left|x\right| = \begin{cases} x & x > 0 \\ -x & x < 0\end{cases}\]
Each piece is a line, with slope \(+1\) or \(-1\).
The V and its step. f′ jumps from \(-1\) to \(+1\) at the origin with no value in between, and that gap is the whole point: a corner has no tangent. Hover just either side and the readout flips sign without passing through anything.
Undefined at \(x = 0\), where the two slopes meet at a corner.