Absolute Value Function |x|: Graph, Derivative, Integral and Corner
The absolute value function |x|: its V-shaped graph, why it is continuous but not differentiable at 0, its derivative x/|x|, and its integral.
Algebraic functions Updated 3 min read
At a glance
- Domain
- (-\infty, \infty)
- Range
- [0, \infty)
- Derivative
- \frac{x}{|x|}
- Integral
- \frac{x|x|}{2} + C
- Not differentiable at
- x = 0 (a corner)
- Symmetry
- Even: |-x| = |x|
On this page
The absolute value function f(x) = |x| gives the distance from x to 0 on the number line, so it removes any negative sign: |3| = 3 and |-3| = 3. Its V-shaped graph is the classic example of a function that is continuous everywhere but has a point where the derivative does not exist.
Formula
It is a piecewise function built from two linear functions. Equivalently, |x| = \sqrt{x^2}, which links it to the square root function.
Graph of |x|
The general form y = a|x - h| + k is a V with vertex (h, k), opening up if a > 0 and down if a < 0, with side slopes \pm a.
Key properties
- Domain all reals; range [0, \infty).
- Even function: |-x| = |x|, symmetric about the y-axis.
- Continuous everywhere, including at 0.
- Absolute minimum of 0 at x = 0, which is a critical point because f'(0) does not exist.
- Triangle inequality: |a + b| \le |a| + |b|.
- Products split, sums do not: |ab| = |a||b|, but |a + b| is usually not |a| + |b|.
Derivative of |x|
For x \ne 0:
At x = 0 the one-sided limits of the difference quotient are
They disagree, so f'(0) does not exist. This is the textbook case of when derivatives fail: a corner. With the chain rule, \frac{d}{dx}|g(x)| = \frac{g(x)}{|g(x)|}g'(x) wherever g(x) \ne 0.
Integral of |x|
Check it piece by piece: for x > 0 it is \frac{x^2}{2}, with derivative x = |x|; for x < 0 it is -\frac{x^2}{2}, with derivative -x = |x|. For a definite integral, split at the point where the inside changes sign.
Worked examples
Example 1: definite integral. Evaluate \int_{-1}^{2}|x|\,dx by splitting at 0:
Geometrically, these are two triangles with areas \frac{1}{2} and 2.
Example 2: a shifted absolute value. g(x) = |x - 3| has derivative 1 for x > 3 and -1 for x < 3, and is not differentiable at x = 3.
Example 3: chain rule. For x \ne 2, \frac{d}{dx}|2x - 4| = \frac{2x - 4}{|2x - 4|} \cdot 2, which is 2 for x > 2 and -2 for x < 2.
Example 4: a limit. \lim_{x \to 0}\frac{|x|}{x} does not exist, because it is 1 from the right and -1 from the left.
Common mistakes
- Saying |x| is not continuous at 0. It is continuous; it is only not differentiable there.
- Writing |{-x}| = -|x|. Absolute value is never negative: |-x| = |x|.
- Integrating across 0 without splitting. \int_{-1}^{2}|x|\,dx is not \frac{2^2}{2} - \frac{(-1)^2}{2}.
- Forgetting it is a critical point. When looking for extrema, include points where the derivative does not exist, like the vertex of a V.
How it connects
Absolute values appear in \int \frac{1}{x}\,dx = \ln|x| + C, in the epsilon-delta definition of a limit, and in absolute convergence of series in convergence tests. For more on corners and other places where derivatives fail, see the continuity guide.
Practice it now
When derivatives fail
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson