d/dx |x| = x/|x|, and none at 0 · the piecewise definition

Derivative of |x|

0methods worked0practice questions0students taught0teaching online since
the answer

The derivative of |x|, the absolute value of x is x/|x|, and none at 0, by the piecewise definition. Not differentiable at x = 0.

the rule

📐 The piecewise definition

|x| = x for x ≥ 0 and −x for x < 0, so differentiate each piece.

d/dx |x| = x/|x| (1 for x > 0, −1 for x < 0; undefined at 0).

step by step

✍️ Differentiating |x|

  1. For x > 0, |x| = x, so the derivative is 1.
  2. For x < 0, |x| = −x, so the derivative is −1.
  3. At x = 0 the left-hand slope is −1 and the right-hand slope is +1; they disagree, so |x| has no derivative at 0.
  4. In one formula: d/dx |x| = x/|x| = |x|/x for x ≠ 0 (the sign of x).
why it is true

🔍 Where the rule comes from

A function is differentiable at a point only if the graph has one tangent there; the V-shape of |x| at the origin has two. In general d/dx |u| = (u/|u|)·u′, which is how |x2 − 1| or |sin x| are differentiated away from their corners.

at a point

📍 The slope of |x| at a point, and the tangent line

f′(a) is the slope of the graph at x = a, and the tangent line there is y = f′(a)(x − a) + f(a). Values to four decimal places; the calculator below gives any other point.

Point|x|f′(x)Tangent line
x = −22−1y = −x
x = −11−1y = −x
x = −0.50.5−1y = −x
x = 0.50.51y = x
x = 111y = x
x = 221y = x
x = 331y = x
the family

👪 Rules and special cases: the derivatives side by side

The same rule, or the same trap, runs through the whole family; each row has its own worked page.

FunctionDerivative
xxxx(ln x + 1)the page
a constant0the page
xyy + x·dy/dxthe page
an integralf(x), by the fundamental theoremthe page
an inverse function1 / f′(f−1(x))the page
a fraction(u′v − uv′)/v2the page
mistakes

⚠️ The mistakes that lose the marks

  • Writing 1 for every x: the derivative is −1 on the negative side.
  • Claiming a derivative at x = 0: there is none.
try another number

🧮 Calculator

The answer appears here, with the working in words.

practice

✏️ Five questions, answers hidden

1. Differentiate |x| at x = −3.

Answer: −1

2. Differentiate |2x|.

Answer: 2x/|2x| = 2·sign(x)

3. Differentiate |x − 1|.

Answer: (x − 1)/|x − 1|, undefined at x = 1

4. Differentiate x|x|.

Answer: 2|x|

5. Differentiate |x^2 − 4|.

Answer: 2x·(x^2 − 4)/|x^2 − 4|, undefined at x = ±2

where this is taught

📚 The class this belongs to

Derivatives are taught in AP Calculus AB and BC and in Calculus 1 in the US (the power, product, quotient and chain rules, trigonometric, exponential and logarithmic derivatives, implicit differentiation), in A-level Maths (Year 12 and 13, Pure) in the UK, in IB Mathematics Analysis and Approaches (Topic 5), in Class 11 and 12 in CBSE (NCERT Limits and Derivatives, Continuity and Differentiability) and in Mathematical Methods (Units 3 and 4) and Specialist Mathematics in Australia.

If this page is the homework and the method is not sticking, that is what a 1-on-1 class fixes: one tutor with a master's degree, one child, on a shared whiteboard, in your time zone, about US$10 to $13 an hour. How 1-on-1 online tutoring works.

Book a free demoLet's go!

The maths library, by topic
Questions

Asked about Derivative of |x|

1What is the derivative of |x|?
x/|x|, and none at 0, by the piecewise definition. Not differentiable at x = 0.
2Which rule differentiates |x|?
The piecewise definition: |x| = x for x ≥ 0 and −x for x < 0, so differentiate each piece.
3How do you differentiate |x| step by step?
For x > 0, |x| = x, so the derivative is 1. For x < 0, |x| = −x, so the derivative is −1.
4What is the slope of y = |x| at x = 3?
1 (to four decimal places): the derivative evaluated at that point. The tangent line there is y = x.