Absolute Value Functions
Every question with a fully worked solution.
- Absolute Value Functions - Video - Graphing Absolute Value Functions Watch
Theory
The graphs of \(y=|f(x)|\) and \(y=f(|x|)\) both come from the graph of \(y=f(x)\), but in different ways. This Year 11 Mathematics Extension 1 page shows how to reflect the parts below the \(x\)-axis for \(|f(x)|\), how to reflect the right half in the \(y\)-axis for \(f(|x|)\), and how to count and find the solutions of \(|f(x)|=k\).
The absolute value can act on the output of a function or on its input, and the two graphs are different.
\(y=|f(x)|\) (absolute value of the output). Work out \(f(x)\) first, then make it positive. Where \(f(x)\geq0\) the graph is unchanged; where \(f(x)\lt 0\) the graph is reflected in the \(x\)-axis. The graph of \(y=|f(x)|\) never goes below the \(x\)-axis, the \(x\)-intercepts stay where they are, and the graph has a sharp point wherever \(f\) crosses the \(x\)-axis. A minimum turning point below the axis becomes a maximum turning point above it, and an asymptote below the axis, such as \(y=-3\), is reflected to \(y=3\).
\(y=f(|x|)\) (absolute value of the input). Take the absolute value of \(x\) first, then apply \(f\). For \(x\geq0\), \(|x|=x\), so the graph is the same as \(y=f(x)\). For \(x\lt 0\), \(f(|x|)=f(-x)\), so the left half is the mirror image of the right half in the \(y\)-axis. The part of \(f\) to the left of the \(y\)-axis is thrown away. Since \(f(|-x|)=f(|x|)\), the function \(y=f(|x|)\) is always even: its graph is symmetric about the \(y\)-axis.
The order matters when you evaluate. For \(f(x)=x-7\) and \(x=-3\): \(|f(-3)|=|-10|=10\), but \(f(|-3|)=f(3)=-4\).
Some functions are written as \(f(|x|)\) in disguise: \(y=5-|x|\) is \(f(|x|)\) for \(f(x)=5-x\), \(y=\log_3|x|\) is \(f(|x|)\) for \(f(x)=\log_3x\), and \(y=|x^2|-2|x|\) is \(f(|x|)\) for \(f(x)=x^2-2x\), because \(|x^2|=|x|^2\).
Absolute value of the output:
Absolute value of the input:
| \(y=|f(x)|\) | \(y=f(|x|)\) | |
|---|---|---|
| Keep | the parts with \(f(x)\geq0\) | the part with \(x\geq0\) |
| Reflect | the parts below the \(x\)-axis, in the \(x\)-axis | the part with \(x\geq0\), in the \(y\)-axis |
| Throw away | nothing (it is flipped up) | the part with \(x\lt 0\) |
| Symmetry | none in general | about the \(y\)-axis (even) |
| Range | \(y\geq0\) only | can go below the axis |
| Sharp points | where \(f\) crosses the \(x\)-axis | possibly on the \(y\)-axis |
Solving an equation with an absolute value of the output (\(k\gt 0\)):
How to sketch \(y=|f(x)|\)
- Sketch \(y=f(x)\) lightly and find its \(x\)-intercepts.
- Keep every part of the graph on or above the \(x\)-axis.
- Reflect every part below the \(x\)-axis in the \(x\)-axis: a point \((a,b)\) with \(b\lt 0\) moves to \((a,-b)\). Reflect turning points and asymptotes too.
- Label the \(x\)-intercepts (now sharp points), the \(y\)-intercept \(|f(0)|\) and the reflected turning points.
How to sketch \(y=f(|x|)\)
- Sketch \(y=f(x)\) for \(x\geq0\) only.
- Reflect that part in the \(y\)-axis to get the part for \(x\lt 0\). Throw away the old left half of \(f\).
- Label intercepts and turning points in pairs: an intercept \(x=a\) (\(a\gt 0\)) gives \(x=\pm a\), and a turning point \((a,b)\) gives \((\pm a,b)\).
How to solve \(|f(x)|=k\)
- Split into \(f(x)=k\) and \(f(x)=-k\), and solve each.
- Check the number of solutions with the line \(y=k\) on the graph of \(y=|f(x)|\).
(i) Find \(|f(-3)|\) and \(f(|-3|)\).
(ii) Sketch \(y=|f(x)|\) and \(y=f(|x|)\) on the same axes.
(i) Apply \(f\) first, then the absolute value:
| \(f(-3)\) | \(=\) | \(2(-3)+4=-2\) |
| \(|f(-3)|\) | \(=\) | \(|-2|=\mathbf{2}\) |
Take the absolute value of \(x\) first:
| \(|-3|\) | \(=\) | \(3\) |
| \(f(3)\) | \(=\) | \(2(3)+4=\mathbf{10}\) |
(ii) \(f(x)=0\) at \(x=-2\). For \(y=|2x+4|\), reflect the part of the line with \(x\lt -2\) in the \(x\)-axis: a V with its vertex at \((-2,0)\) and \(y\)-intercept \((0,4)\).
For \(y=f(|x|)=2|x|+4\), keep the line for \(x\geq0\), starting at \((0,4)\), and reflect it in the \(y\)-axis: a V with its vertex at \((0,4)\).
(i) Sketch \(y=|f(x)|\), showing the intercepts and the turning point.
(ii) Hence state the number of solutions of \(|x^2-6x+5|=3\), and find them exactly.
(i) Factorise and complete the square:
| \(f(x)\) | \(=\) | \((x-1)(x-5)\) |
| \(\) | \(=\) | \((x-3)^2-4\) |
\(x\)-intercepts \((1,0)\), \((5,0)\); \(y\)-intercept \(|f(0)|=5\): \((0,5)\). The parabola is below the axis for \(1\lt x\lt 5\), so that part is reflected: the vertex \((3,-4)\) becomes a local maximum \((3,4)\).
(ii) The line \(y=3\) is between \(0\) and the local maximum \(4\), so it meets the graph 4 times.
\(|f(x)|=3\) means \(f(x)=3\) or \(f(x)=-3\):
| \(x^2-6x+5\) | \(=\) | \(3\) |
| \(x^2-6x+2\) | \(=\) | \(0\) |
| \(x\) | \(=\) | \(\dfrac{6\pm\sqrt{36-8}}{2}\) |
| \(\) | \(=\) | \(3\pm\sqrt7\) |
| \(x^2-6x+5\) | \(=\) | \(-3\) |
| \(x^2-6x+8\) | \(=\) | \(0\) |
| \((x-2)(x-4)\) | \(=\) | \(0\) |
| \(x\) | \(=\) | \(2,\ 4\) |
\(\therefore x=\mathbf{3-\sqrt7,\ 2,\ 4,\ 3+\sqrt7}\)
(i) Find the \(x\)-intercepts of \(y=f(|x|)\).
(ii) Find the minimum value of \(y=f(|x|)\) and the values of \(x\) where it occurs.
(iii) Sketch \(y=f(|x|)\).
\(y=f(|x|)\): take \(f\) for \(x\geq0\) and reflect it in the \(y\)-axis.
(i) \(f(x)=(x-1)(x-5)=0\Rightarrow x=1,\ 5\)
| \(f(|x|)\) | \(=\) | \(0\) |
| \(|x|\) | \(=\) | \(1\ \text{or}\ |x|=5\) |
| \(x\) | \(=\) | \(\pm1,\ \pm5\) |
\(\therefore\) \(x\)-intercepts \(x=\mathbf{-5,\ -1,\ 1,\ 5}\)
(ii) \(f(x)=(x-3)^2-4\): minimum \(-4\) at \(x=3\) (with \(x\geq0\)). Reflecting: minimum value \(\mathbf{-4}\) at \(x=\mathbf{3}\) and \(x=\mathbf{-3}\).
(iii) The \(y\)-intercept is \(f(0)=5\). The two halves meet at \((0,5)\) at a sharp point, which is a local maximum. The graph is a W shape, symmetric about the \(y\)-axis.
(i) Sketch \(y=|f(x)|\), showing any asymptote and intercepts, and state its range.
(ii) Sketch \(y=f(|x|)\), showing its intercepts, and state its range.
Features of \(f\): as \(x\to-\infty\), \(3^x\to0\), so \(f(x)\to-3\): asymptote \(y=-3\). \(x\)-intercept: \(3^x=3\Rightarrow x=1\). \(y\)-intercept: \(f(0)=1-3=-2\).
(i) For \(x\geq1\): \(f(x)\geq0\), so \(y=3^x-3\) (unchanged). For \(x\lt 1\): \(f(x)\lt 0\), so \(y=3-3^x\), the reflection of \(f\) in the \(x\)-axis.
| \(\text{asymptote}\) | \(:\) | \(y=-3\ \text{reflects to}\ y=3\) |
| \(y\text{-intercept}\) | \(:\) | \(|f(0)|=|-2|=2\) |
Sharp point at \((1,0)\). Range: \(\boldsymbol{y\geq0}\).
(ii) For \(x\geq0\), \(y=3^x-3\), from \((0,-2)\) up through \((1,0)\). Reflect this in the \(y\)-axis.
\(x\)-intercepts \(x=\pm1\), sharp minimum \((0,-2)\), and no asymptote (the left half of \(f\), with its asymptote, is thrown away). Range: \(\boldsymbol{y\geq-2}\).
Common pitfalls
Frequently asked questions
What is the difference between y = |f(x)| and y = f(|x|)?
In \(y=|f(x)|\) the absolute value acts on the output, so every part below the \(x\)-axis is reflected up. In \(y=f(|x|)\) it acts on the input, so the part for \(x\geq0\) is kept and reflected in the \(y\)-axis.
How do you sketch y = |f(x)|?
Sketch \(y=f(x)\), keep the parts on or above the \(x\)-axis, and reflect the parts below the \(x\)-axis in the \(x\)-axis. The graph has sharp points where \(f\) crosses the axis.
How do you sketch y = f(|x|)?
Sketch \(y=f(x)\) for \(x\geq0\) only, then reflect that part in the \(y\)-axis. Throw away the original part for \(x\lt 0\).
Is y = f(|x|) always an even function?
Yes. \(f(|-x|)=f(|x|)\) for every \(x\), so the graph of \(y=f(|x|)\) is always symmetric about the \(y\)-axis. \(y=|f(x)|\) is not even in general: \(y=|x-7|\) is symmetric about \(x=7\), not the \(y\)-axis.
How many solutions does |f(x)| = k have?
Draw the line \(y=k\) on the graph of \(y=|f(x)|\) and count the points where they meet. To find them, solve \(f(x)=k\) and \(f(x)=-k\). There are none if \(k\lt 0\).
Can the graph of y = |f(x)| go below the x-axis?
No. An absolute value is never negative, so \(|f(x)|\geq0\) and the whole graph is on or above the \(x\)-axis. The graph of \(y=f(|x|)\) can go below the axis.