Skip to main content
Examonaut

Topic 2 · Lesson 4 of 6

The modulus function, domain and range

The modulus functionA level only

The modulus ∣x∣|x| means the size of xx ignoring its sign: ∣5∣=5|5| = 5 and ∣−5∣=5|-5| = 5. So ∣x∣=x|x| = x when x≥0x \ge 0 and ∣x∣=−x|x| = -x when x<0x < 0. To sketch y=∣2x−3∣y = |2x - 3|, draw y=2x−3y = 2x - 3 and reflect any part below the xx-axis up above it. This gives a V shape with its vertex where 2x−3=02x - 3 = 0, at x=1.5x = 1.5.

The same idea gives two related sketches, using the dashed curve f(x)=x2−2x−3f(x) = x^2 - 2x - 3 below:

  • y=∣f(x)∣y = |f(x)|: reflect the parts below the xx-axis upwards. All yy-values become positive.
  • y=f(∣x∣)y = f(|x|): keep the part for x≥0x \ge 0, throw away the left half, and replace it with a mirror image of the right half in the yy-axis. (Since f(∣−3∣)=f(3)f(|-3|) = f(3), the graph is symmetrical.)
y = |f(x)|y = f(|x|)

Worked example

A modulus equation and inequalityA level

a) Solve ∣2x−3∣=5−x|2x - 3| = 5 - x. b) Hence solve ∣2x−3∣<5−x|2x - 3| < 5 - x.

Show solution

A modulus equation is two equations in one, because the inside is either positive or negative. Each answer must then be checked.

  1. Case 1, inside positive: 2x−3=5−x2x - 3 = 5 - x, so 3x=83x = 8, x=83x = \frac{8}{3}.
  2. Case 2, inside negative: −(2x−3)=5−x-(2x - 3) = 5 - x, so −2x+3=5−x-2x + 3 = 5 - x, x=−2x = -2.
  3. Check: x=83x = \frac{8}{3} gives ∣73∣=73|\frac{7}{3}| = \frac{7}{3} ✓; x=−2x = -2 gives ∣−7∣=7=5+2|-7| = 7 = 5 + 2 ✓.
  4. b) The diagram shows the V is below the line between the two crossings, so −2<x<83-2 < x < \frac{8}{3}.
xyO−2−112345268y = |2x − 3|y = 5 − x

Checking matters: for ∣x−1∣=2x+4|x - 1| = 2x + 4, case 2 gives x=−1x = -1, which checks (both sides equal 2) ✓, while case 1 gives x=−5x = -5, where 2x+4=−62x + 4 = -6 is negative, which a modulus can never equal. So x=−5x = -5 is rejected.

Functions, domain and rangeA level only

A function is a rule that gives exactly one output for each input. The set of allowed inputs is the domain, and the set of outputs is the range. We write f(x)=x2f(x) = x^2, x∈Rx \in \mathbb{R}, or f:x↦x2f: x \mapsto x^2. A function is one-to-one if every output comes from just one input, and many-to-one otherwise (x2x^2 is many-to-one, since f(2)=f(−2)f(2) = f(-2)).

Composites. A composite function fg(x)fg(x) means "do gg first, then ff": fg(x)=f(g(x))fg(x) = f(g(x)). Order matters. With f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^2, fg(x)=2x2+1fg(x) = 2x^2 + 1 but gf(x)=(2x+1)2gf(x) = (2x + 1)^2.

Inverses. An inverse function f−1f^{-1} undoes ff: if f(3)=6f(3) = 6 then f−1(6)=3f^{-1}(6) = 3. Only one-to-one functions have inverses (otherwise f−1(4)f^{-1}(4) would have to be both 2 and −2-2), which is why domains are often restricted, for example x≥1x \ge 1 below. Because the inverse swaps inputs and outputs, its graph is the reflection of y=f(x)y = f(x) in the line y=xy = x, and the domain of f−1f^{-1} is the range of ff.

How to find an inverse function

  1. Step 1: Write y=f(x)y = f(x).
  2. Step 2: Rearrange to make xx the subject.
  3. Step 3: Swap xx and yy (or just write the answer as f−1(x)f^{-1}(x)).
  4. Step 4: State the domain of f−1f^{-1}: it is the range of ff.

For f(x)=(x−1)2+2f(x) = (x - 1)^2 + 2, x≥1x \ge 1: the range is f(x)≥2f(x) \ge 2. From y=(x−1)2+2y = (x - 1)^2 + 2, x=1+y−2x = 1 + \sqrt{y - 2} (the positive root, as x≥1x \ge 1). So f−1(x)=1+x−2f^{-1}(x) = 1 + \sqrt{x - 2}, x≥2x \ge 2. The diagram shows the reflection.

xyO123456123456(2, 1)y = f(x)y = f⁻¹(x)y = x

Worked example

Composite and inverse functionstop gradeA level

f(x)=3x−2f(x) = \frac{3}{x - 2}, x>2x > 2, and g(x)=x2+1g(x) = x^2 + 1, x∈Rx \in \mathbb{R}.
a) State the range of ff. b) Find f−1(x)f^{-1}(x) and its domain. c) Solve fg(x)=1fg(x) = 1.

Show solution
  1. a) For x>2x > 2, x−2x - 2 takes every positive value, so 3x−2\frac{3}{x - 2} takes every positive value: f(x)>0f(x) > 0.
  2. b) y=3x−2y = \frac{3}{x - 2}, so x−2=3yx - 2 = \frac{3}{y} and x=2+3yx = 2 + \frac{3}{y}. So f−1(x)=2+3xf^{-1}(x) = 2 + \frac{3}{x}, with domain x>0x > 0 (the range of ff).
  3. c) fg(x)=f(x2+1)=3x2+1−2=3x2−1fg(x) = f(x^2 + 1) = \frac{3}{x^2 + 1 - 2} = \frac{3}{x^2 - 1}. But ff only accepts inputs above 2, so we need x2+1>2x^2 + 1 > 2, that is ∣x∣>1|x| > 1.
  4. 3x2−1=1\frac{3}{x^2 - 1} = 1 gives x2=4x^2 = 4, so x=±2x = \pm 2. Both satisfy ∣x∣>1|x| > 1, so x=2x = 2 or x=−2x = -2.

Practise this topic

Both are part of Premium.