Derivative of |x|
Updated 6 November 2026 · Checked numerically by the ihateDesmos engine
The derivative of |x|
ddx(|x|)=x|x|
The derivative of |x| is x/|x|, which is 1 for x > 0 and −1 for x < 0. At x = 0 it doesn’t exist, because the graph has a sharp corner there.
y=|x|
in blue and its derivative y=x|x|
in red. Defined for x ≠ 0.How to find the derivative of |x|
Method: definition.
- 1Split the function: |x| = x for x > 0, and |x| = −x for x < 0.
- 2For x > 0, the derivative of x is 1.
- 3For x < 0, the derivative of −x is −1.
- 4Both cases are captured by x/|x|.
- 5At x = 0, the slope from the left is −1 and from the right is 1. They disagree, so there is no derivative.
What it means on the graph
The V-shaped graph is made of two straight lines, one with slope −1 and one with slope 1. The derivative jumps from −1 to 1 at the corner. This is the standard example of a function that is continuous but not differentiable.
Table of values
The derivative column uses the formula. The last column estimates the slope directly from the original function, as an independent check.
| x | |x| | x/|x| | Slope, measured |
|---|---|---|---|
| −2 | 2 | −1 | −1 |
| −1 | 1 | −1 | −1 |
| 1 | 1 | 1 | 1 |
| 2 | 2 | 1 | 1 |
Related derivatives
The same result with the chain or product rule. Each of these is checked numerically too.
| Function | Derivative |
|---|---|
|2x| | 2x|x| |
|x−3| | x−3|x−3| |
Common mistakes
- Saying the derivative at 0 is 0. It doesn’t exist.
Frequently asked questions
What is the derivative of |x|?
The derivative of |x| is x/|x|, for x ≠ 0.
Is |x| differentiable at 0?
No. The slopes from the left and right are −1 and 1, so no single tangent line exists there.
What is the derivative of |u|?
u · u′ / |u|, by the chain rule, wherever u isn’t 0.
Keep going
Differentiate any function
Type your own function into the derivative calculator and see every rule applied, step by step.