Modulus / Absolute Value Functions
A complete self-study lesson on absolute value, piecewise definitions, graph transformations, domain, range and exam-style sketches.
Before you start
This lesson is designed to be read like a textbook chapter. Work through the examples with paper and pencil before opening the answers.
How to sketch basic straight lines and quadratics, find intercepts, and read domain and range from a graph.
Sketch \(y=|f(x)|\), write a modulus function piecewise, solve simple modulus equations and describe domain and range.
IB and IGCSE questions often test whether you understand which part of a graph is reflected and where corners occur.
1. Absolute value as distance
The absolute value of a number is its distance from zero on the number line. Since distance is never negative, an absolute value is always non-negative.
More generally, the absolute value function is defined by
| Input \(x\) | \(-3\) | \(-2\) | \(-1\) | \(0\) | \(1\) | \(2\) | \(3\) |
|---|---|---|---|---|---|---|---|
| Output \(|x|\) | 3 | 2 | 1 | 0 | 1 | 2 | 3 |
2. The graph of \(y=|x|\)
For \(x\ge 0\), \(|x|=x\), so the right-hand side of the graph is the line \(y=x\). For \(x<0\), \(|x|=-x\), so the left-hand side is the line \(y=-x\).
3. Transforming \(y=f(x)\) into \(y=|f(x)|\)
Now suppose we already have a graph \(y=f(x)\). The graph \(y=|f(x)|\) is found by applying the modulus to the output values.
| Part of \(y=f(x)\) | What happens in \(y=|f(x)|\) | Why? |
|---|---|---|
| Above the \(x\)-axis | Stays exactly where it is | The function value is already positive. |
| On the \(x\)-axis | Stays fixed | Zero stays zero: \(|0|=0\). |
| Below the \(x\)-axis | Reflects upward in the \(x\)-axis | A negative function value becomes positive. |
Sketch \(y=|x^2-4|\)
We begin with the graph inside the modulus: \(y=x^2-4\).
The vertex is \((0,-4)\). The roots are found from \(x^2-4=0\), so \(x=-2\) and \(x=2\).
The parabola is below the \(x\)-axis between its roots, so \(x^2-4<0\) for \(-2
The section between \(-2\) and \(2\) is reflected. The original vertex \((0,-4)\) becomes \((0,4)\).
The piecewise definition is
Sketch \(y=|x^2-4x+3|\)
This example shows why it is useful to factor first.
The roots are \(x=1\) and \(x=3\).
The quadratic opens upward, so it is below the \(x\)-axis between the roots: \(1
The original minimum is at \((2,-1)\), so after taking the modulus it appears at \((2,1)\).
4. Be careful: \(y=|f(x)|\) and \(y=f(|x|)\) are different
The modulus can be applied to the output or the input. These two transformations are not the same.
| Graph | Meaning | Transformation |
|---|---|---|
| \(y=|f(x)|\) | Take the modulus of the output | Reflect parts below the \(x\)-axis upward. |
| \(y=f(|x|)\) | Take the modulus of the input | Use the right-hand half of \(y=f(x)\) and reflect it in the \(y\)-axis. |
Solve \(|2x-5|=7\)
A modulus equation can be solved by considering the two possible distances from zero.
Therefore, the solutions are
5. Domain and range
For \(y=|f(x)|\), the domain is usually the same as the domain of \(f(x)\), because we are only changing the outputs after \(f(x)\) has already been calculated.
The range changes because all outputs are non-negative:
However, the exact range depends on whether the graph reaches zero and how high it goes. For example:
- For \(y=|x^2-4|\), the minimum value is \(0\), so the range is \(y\ge 0\).
- For \(y=|x^2+1|\), the original graph is already above the \(x\)-axis, so \(y=|x^2+1|=x^2+1\) and the range is \(y\ge 1\).
6. Practice questions
- Sketch \(y=|x-3|\). State its vertex, domain and range.
- Sketch \(y=|x^2-9|\). Write it as a piecewise function.
- Solve \(|3x+2|=11\).
- Explain the difference between \(y=|f(x)|\) and \(y=f(|x|)\).
- Sketch \(y=|(x+1)(x-4)|\). Identify the roots and the point that is reflected upward.
Answers
- Vertex \((3,0)\), domain \(x\in\mathbb{R}\), range \(y\ge 0\).
- Roots \(-3\) and \(3\). \(|x^2-9|=x^2-9\) for \(x\le -3\) or \(x\ge 3\), and \(9-x^2\) for \(-3
- \(3x+2=11\) or \(3x+2=-11\), so \(x=3\) or \(x=-\frac{13}{3}\).
- \(|f(x)|\) reflects negative outputs upward. \(f(|x|)\) reflects the right-hand half of the graph in the \(y\)-axis.
- Roots are \(-1\) and \(4\). The quadratic opens upward, so the section between \(-1\) and \(4\) is reflected upward. The original vertex occurs at \(x=\frac{3}{2}\).
Checklist before moving on
- I can explain why absolute value is always non-negative.
- I can sketch \(y=|f(x)|\) from \(y=f(x)\).
- I can identify where a graph is below the \(x\)-axis.
- I can write \(|f(x)|\) as a piecewise function.
- I know the difference between \(|f(x)|\) and \(f(|x|)\).