Pure · Functions and Graphs · Year 2

The Modulus Function

Strip away the sign, and every negative output flips upright — a graph that folds itself in half along the x-axis.

9 min read 4 worked examples

Defining the modulus

The modulus (or absolute value) of a number, $|x|$, strips away its sign and returns only its distance from zero. Formally,

$|x| = \begin{cases}x, & x\ge0 \\ -x, & x<0\end{cases}$

So $|5|=5$ and $|-5|=5$: both outputs are non-negative, always. For a linear function, $y=|ax+b|$ takes the graph of $y=ax+b$ and reflects any part that dips below the x-axis back up above it, since the modulus can never output a negative value.

A V-shaped graph of y equals the modulus of 2x minus 1, showing a straight line coming down from the upper left, hitting a sharp vertex at the point (0.5, 0) on the x-axis, then rising straight back up to the upper right, entirely on or above the x-axis, with a dashed grey line beneath the x-axis showing where the original unreflected line y = 2x - 1 would have continued.
y = |2x − 1|: the graph of y = 2x − 1 (dashed, where negative) reflected in the x-axis to form a V-shape with vertex at (0.5, 0).
Reading off the vertex

The sharp "vertex" of $y=|ax+b|$ sits exactly where the original line crosses the x-axis, i.e. where $ax+b=0$, so $x=-\dfrac{b}{a}$. To the left of the vertex the graph follows $y=-(ax+b)$; to the right, it follows the original $y=ax+b$. The graph is never negative, and the vertex is always the graph's minimum point.

Solving modulus equations and inequalities

An equation like $|2x-1|=x$ can be solved graphically (sketch both $y=|2x-1|$ and $y=x$, and read off intersection $x$-values) or algebraically, using one of two equivalent approaches:

Two algebraic strategies

Case split: solve the equation once assuming the expression inside the modulus is non-negative (so $|ax+b|=ax+b$), and once assuming it's negative (so $|ax+b|=-(ax+b)$) — then check each candidate solution actually satisfies the case assumed. Squaring: since $|A|=B \Leftrightarrow A^2=B^2$ (when $B\ge0$), squaring both sides removes the modulus entirely, at the cost of possibly introducing extra solutions that must be checked back in the original equation.

Inequalities such as $|2x-1|>x$ follow the same two approaches, but need extra care: solutions to a modulus inequality are typically a union of intervals, and a sketch is the most reliable way to see exactly which regions satisfy it before committing to algebra.

Strategy — sketch first, always

Even when solving algebraically, a quick sketch of both sides of an equation or inequality shows immediately how many solutions to expect and roughly where they lie — an essential sanity check, since squaring can silently introduce extra "solutions" that don't actually satisfy the original equation.

Worked example 1

Sketching a modulus graph and solving graphically
Sketch $y=|2x-1|$ and $y=x$ on the same axes, and use the sketch to find the number of solutions to $|2x-1|=x$.
MethodLocate the vertex, sketch both graphs, then count intersections
1
$y=|2x-1|$ has vertex at $2x-1=0 \Rightarrow x=\dfrac{1}{2}$, i.e. vertex $(0.5,0)$, opening upwards in a V-shape.
Vertex sits where the inside of the modulus is zero.
2
$y=x$ is a straight line through the origin with gradient $1$.
Standard line for comparison.
3
Sketching both: the line $y=x$ crosses the left branch of the V (steeper, gradient $-2$) once, and the right branch (gradient $2$) once.
Visualise where a gradient-1 line meets a steeper V-shape.
4
So there are exactly $2$ solutions to $|2x-1|=x$.
Read the count directly from the sketch.
▪ solved
Examiner's eye

A sketch alone doesn't give exact solution values — but it's invaluable for predicting how many solutions an algebraic method should produce, and for catching extraneous "solutions" that squaring can introduce (see Example 2).

Worked example 2

Solving a modulus equation algebraically
Solve $|2x-1|=x$ algebraically.
MethodSquare both sides, solve the resulting quadratic, then check each root
1
Square both sides: $(2x-1)^2 = x^2$.
Removes the modulus, since |A| = B ⇔ A² = B² when B ≥ 0.
2
$4x^2-4x+1 = x^2 \Rightarrow 3x^2-4x+1=0$.
Expand and rearrange to standard quadratic form.
3
Factorise: $(3x-1)(x-1)=0 \Rightarrow x=\dfrac{1}{3}$ or $x=1$.
Solve the quadratic.
4
Check $x=\dfrac13$: $|2(\tfrac13)-1| = |-\tfrac13| = \tfrac13 = x$. ✓ Check $x=1$: $|2(1)-1|=|1|=1=x$. ✓
Verify both roots satisfy the original (unsquared) equation.
5
Both solutions are valid: $x=\dfrac{1}{3}$ or $x=1$.
Matches the 2 intersections predicted by the sketch in Example 1.
▪ solved
The key insight

Squaring is only reversible when both roots are checked back in the original equation — because squaring can turn a false statement like $|{-5}|=-5$ into a true one ($25=25$), silently manufacturing invalid solutions. Here both roots happened to check out, but this must always be verified, never assumed.

Worked example 3

Solving a modulus inequality
Solve $|2x-1|>x$.
MethodUse the equation's solutions as boundaries, then test each region
1
From Example 2, $|2x-1|=x$ at $x=\dfrac13$ and $x=1$ — these are the boundary points where the inequality could switch direction.
Boundaries of a modulus inequality are exactly where equality holds.
2
Test $x=0$ (left of $\tfrac13$): $|2(0)-1|=1 > 0$. True.
Sample a point in each of the 3 regions split by the boundaries.
3
Test $x=0.5$ (between $\tfrac13$ and $1$): $|2(0.5)-1|=0$, and $0 > 0.5$ is false.
This region does not satisfy the inequality.
4
Test $x=2$ (right of $1$): $|2(2)-1|=3 > 2$. True.
This region does satisfy the inequality.
5
So $|2x-1|>x$ for $x<\dfrac13$ or $x>1$.
Combine the true regions, excluding the boundary points themselves (strict inequality).
▪ solved
Look deeper — matches the sketch

On the sketch from Example 1, the V-shaped graph $y=|2x-1|$ sits above the line $y=x$ everywhere except the middle section between the two intersection points — exactly the regions $x<\tfrac13$ and $x>1$ found algebraically here.

Worked example 4

A modulus equation with two moduli · Challenge
Solve $|x-3|=|2x+1|$.
MethodSquare both sides — valid directly, since both sides are already non-negative
1
Since both sides are moduli (always $\ge0$), squaring is valid without extra conditions: $(x-3)^2=(2x+1)^2$.
|A| = |B| ⇔ A² = B², with no sign restriction needed on either side.
2
$x^2-6x+9 = 4x^2+4x+1$.
Expand both sides.
3
$0 = 3x^2+10x-8$.
Collect all terms on one side.
4
Factorise: $(3x-2)(x+4)=0 \Rightarrow x=\dfrac23$ or $x=-4$.
Solve the resulting quadratic.
5
Check $x=\dfrac23$: $|{\tfrac23-3}|=\tfrac73$; $|2(\tfrac23)+1|=|\tfrac73|=\tfrac73$. ✓ Check $x=-4$: $|-4-3|=7$; $|2(-4)+1|=|-7|=7$. ✓
Verify both roots — good practice even when squaring both moduli directly.
6
Both solutions are valid: $x=\dfrac{2}{3}$ or $x=-4$.
Final answer.
▪ solved
Look deeper — why no extraneous roots appear here

When squaring $|A|=B$ where $B$ might be negative, extraneous roots can creep in. But $|A|=|B|$ squares to $A^2=B^2$ regardless of either expression's sign, since both sides of the original equation are guaranteed non-negative — so every algebraic root is automatically a genuine solution. Checking is still good exam practice, but here it's a formality rather than a necessity.

Look ahead

Every graph here has been the linear case $y=|ax+b|$, giving a V-shape. The same "reflect what's negative" idea extends to sketching $y=|f(x)|$ for any function $f$ — quadratics, cubics and beyond — plus a second, different way of folding a graph using $y=f(|x|)$. Both are covered in the final lesson of this topic.

Common mistake

Squaring an equation like $|2x-1|=x-5$ without first noting that the right-hand side could be negative — since $|2x-1|\ge0$ always, any solution requires $x-5\ge0$ too. Skipping this check is exactly how squaring introduces invalid roots that solve $A^2=B^2$ but not the original $|A|=B$; always verify final answers in the original, un-squared equation.

Check yourself

Solve $|3x+2|=x+4$ algebraically, checking both roots.
(Hint: square both sides, solve the quadratic, then verify each root in the original equation.)

Method
1
$(3x+2)^2=(x+4)^2 \Rightarrow 9x^2+12x+4 = x^2+8x+16 \Rightarrow 8x^2+4x-12=0$.
2
$2x^2+x-3=0 \Rightarrow (2x+3)(x-1)=0 \Rightarrow x=-\dfrac32$ or $x=1$.
Simplify then factorise.
3
Check $x=-\tfrac32$: $|{-\tfrac52+2}|$... $|3(-\tfrac32)+2|=|-\tfrac52|=\tfrac52$; $x+4=\tfrac52$. ✓ Check $x=1$: $|5|=5$; $x+4=5$. ✓ Both valid: $x=-\dfrac32$ or $x=1$.
Both roots check out against the original equation.
▪ solved