Skip to main content
Graphing Calculator

Function library

Absolute Value Function

f(x) = abs(x)

The V-shaped measure of distance from zero — simple, symmetric, with a corner at the origin.

The absolute value function f(x) = |x| is distance made visible: |x| is how far x sits from zero on the number line, regardless of direction. Its graph is a perfect V — the line y = −x for negative inputs meeting the line y = x for positive ones at the sharp corner (0, 0). That corner is the function’s most famous feature: the one point where it is continuous but not differentiable, where the slope jumps from −1 to 1.

Absolute value turns up wherever magnitude matters more than sign: error bounds (|measured − true| < tolerance), tolerances in manufacturing, the distance between two numbers (|a − b|), and piecewise definitions throughout applied mathematics. It is also the simplest example of a function built by gluing two formulas together. Type abs(x) into the calculator, then try abs(x - 3) to watch the V slide and see distance-from-3 drawn as a graph.

Computed properties

Calculated by the graphing calculator's own math engine at build time for abs(x).

Roots in [−10, 10]
0.0000
y-intercept f(0)
0.0000
Local extrema in [−10, 10]
  • local minimum at (0.0000, 0.0000)
Sample values
f(-2) = 2 · f(-1) = 1 · f(0) = 0 · f(1) = 1 · f(2) = 2
Derivative f′(1)
1.0000
Integral ∫₀¹ f(x) dx
0.5000

Key facts

  • Piecewise definition: |x| = x for x ≥ 0, |x| = −x for x < 0; equivalently |x| = √(x²).
  • Domain: all real numbers; range: y ≥ 0.
  • V-shaped graph with vertex (corner) at (0, 0); even function, symmetric about the y-axis.
  • Continuous everywhere but not differentiable at x = 0 (slope jumps from −1 to 1).
  • |x − a| is the distance between x and a; global minimum 0 at x = 0, no maximum.

What absolute value is

The definition is piecewise: |x| = x when x ≥ 0 and |x| = −x when x < 0 — the minus sign flips negatives back to positive. So |5| = 5 and |−5| = −(−5) = 5. Equivalently, |x| = √(x²), which shows why the output is never negative: squaring erases the sign and the principal root keeps it erased. Both forms say the same thing: magnitude without direction.

This makes |x − a| the distance between x and a, the workhorse interpretation. The inequality |x − 3| < 2 describes all points within 2 units of 3, i.e. the open interval (1, 5) — absolute value converts distance language into algebra and back. It is an even function, |−x| = |x|, so the V mirrors perfectly across the y-axis.

The corner at the origin

At x = 0 the two arms of the V meet at an angle, and that angle is a genuine singularity of smoothness: approaching from the left the slope is −1, from the right it is +1, so no single tangent line exists. The function is continuous at 0 — the arms join without a gap — but not differentiable there, the standard counterexample separating the two concepts in every calculus course.

Away from the corner everything is tame: the derivative is −1 for x < 0 and +1 for x > 0, often written as the sign function, and the second derivative is 0 wherever it exists. The V has its global minimum of 0 at x = 0 and no maximum; both arms rise to +∞ with constant slope, never bending.

Where absolute value appears

Error analysis runs on absolute value: “within 0.5 of the true value” is |error| < 0.5, and numerical methods stop when successive approximations satisfy |xₙ₊₁ − xₙ| < tolerance. In statistics, mean absolute deviation measures spread without squaring, staying in the original units and resisting outliers better than variance.

In optimization and machine learning, the absolute value is the L1 penalty: minimizing sums of |·| encourages sparsity (many exact zeros), unlike the squared L2 penalty. Piecewise-linear models, from tax brackets to ReLU neural networks (max(0, x) = (x + |x|)/2), are built from absolute-value-like corners — the kink at zero is a feature, not a bug.

Frequently asked questions

Why is |x| not differentiable at 0?

Differentiability at a point requires the slopes from both sides to agree. For |x|, the left-hand slope is −1 and the right-hand slope is +1 — they disagree, so no tangent line exists at the corner. The function is still continuous there; it just has a kink.

What is the difference between |x| and √(x²)?

None — they are the same function. Squaring removes the sign of x and the principal square root returns the non-negative result, which is exactly the absolute value. The identity |x| = √(x²) is often used to differentiate |x| away from zero.

How do you solve |x − 3| = 5?

Read it as “the distance from x to 3 is 5”, giving x = 3 + 5 = 8 or x = 3 − 5 = −2. Algebraically, split into cases: x − 3 = 5 gives x = 8, and x − 3 = −5 gives x = −2. Both check out: |8 − 3| = 5 and |−2 − 3| = 5.

Related pages