The Modulus Function and Modulus Equations

A2 · P3 · 18 min

The modulus of a number is its size with the sign thrown away: ∣5∣=5|5| = 5 and ∣−5∣=5|-5| = 5. That one idea gives V-shaped graphs and equations that secretly contain two equations at once. P3 almost always has a short modulus question near the start of the paper, often worth 3 to 5 marks, and it is very often followed by a "hence" part that turns the same equation into one about 2x2^x or exe^x.

What the modulus means

There are two ways to think about ∣x∣|x|, and you need both.

The algebraic view: keep xx if it is already non-negative, and change its sign if it is negative.

Definition

The modulus (or absolute value) of a real number xx is

∣x∣={xif x≥0−xif x<0|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}

so ∣x∣≥0|x| \ge 0 for every xx, and ∣x∣=0|x| = 0 only when x=0x = 0.

The −x-x in the second line is not a negative number. When x=−3x = -3, −x=3-x = 3. The rule says "if it is negative, flip it".

The geometric view: ∣x∣|x| is the distance from xx to 00 on the number line. More usefully, ∣x−a∣|x - a| is the distance between xx and aa. So ∣x−3∣=2|x - 3| = 2 asks "which numbers are exactly 22 away from 33?", and the answer x=1x = 1 or x=5x = 5 can be read straight off a number line. The distance view is what makes modulus inequalities easy, so it is worth practising now.

Key result

Facts that follow straight from the definition, for all real aa and bb:

  • ∣a∣≥0|a| \ge 0, and ∣−a∣=∣a∣|-a| = |a|
  • ∣ab∣=∣a∣ ∣b∣|ab| = |a|\,|b| and ∣ab∣=∣a∣∣b∣\left|\dfrac{a}{b}\right| = \dfrac{|a|}{|b|} for b≠0b \ne 0
  • ∣a∣2=a2|a|^2 = a^2, and a2=∣a∣\sqrt{a^2} = |a|
  • ∣a∣=∣b∣  ⟺  a=±b  ⟺  a2=b2|a| = |b| \iff a = \pm b \iff a^2 = b^2
  • ∣a−b∣|a - b| is the distance between aa and bb on the number line
Watch out

∣a+b∣|a + b| is not ∣a∣+∣b∣|a| + |b| in general: ∣3+(−5)∣=2|3 + (-5)| = 2 but ∣3∣+∣−5∣=8|3| + |-5| = 8. Products and quotients split; sums and differences do not. So ∣2x−6∣=2∣x−3∣|2x - 6| = 2|x - 3| is fine (factor out the 22), but ∣x−3∣|x - 3| is not ∣x∣−3|x| - 3.

The graph of y=∣ax+b∣y = |ax + b|

Start with the straight line y=ax+by = ax + b. Wherever the line is above the xx-axis the modulus changes nothing. Wherever the line is below the axis the modulus flips the sign of yy, which reflects that part of the line in the xx-axis. The result is a V shape with its vertex on the xx-axis.

y = 2x - 3 y = abs(2x - 3)

The straight line is y=2x−3y = 2x - 3; the V is y=∣2x−3∣y = |2x - 3|. The part of the line below the axis, for x<1.5x < 1.5, has been reflected upwards.

Key result

For y=∣ax+b∣y = |ax + b| with a≠0a \ne 0:

  • the vertex is on the xx-axis at (−ba, 0)\left(-\dfrac{b}{a},\ 0\right), where ax+b=0ax + b = 0
  • the yy-intercept is (0, ∣b∣)(0,\ |b|)
  • the two arms have gradients ∣a∣|a| and −∣a∣-|a|, so the V is symmetric about the vertical line x=−bax = -\dfrac{b}{a}
  • the graph never goes below the xx-axis
Sketching y = |ax + b|
  1. Solve ax+b=0ax + b = 0 to find the vertex on the xx-axis.
  2. Put x=0x = 0 to find the yy-intercept ∣b∣|b|.
  3. Draw the right arm through the vertex with gradient ∣a∣|a| and the left arm with gradient −∣a∣-|a|.
  4. Label the vertex and the intercept with exact coordinates.

Transformations work exactly as in P1 (see transformations of graphs):

  • y=∣ax+b∣+cy = |ax + b| + c moves the whole V up by cc, so the vertex is at (−ba, c)\left(-\tfrac{b}{a},\ c\right).
  • y=c−∣ax+b∣y = c - |ax + b| is an upside-down V (a "Λ") with its peak at (−ba, c)\left(-\tfrac{b}{a},\ c\right).
  • y=k∣ax+b∣y = k|ax + b| stretches the V vertically, making the arms steeper.
y = abs(x - 1) + 2 y = 4 - abs(x - 1) y = 2 abs(x - 1)
Tip

The syllabus only asks for y=∣ax+b∣y = |ax + b| with ax+bax + b linear (plus simple transformations of it). Graphs of y=∣f(x)∣y = |f(x)| and y=f(∣x∣)y = f(|x|) for non-linear ff are explicitly excluded from P3, though you met reflecting a curve in P1 and the idea is the same.

Solving ∣ax+b∣=k|ax + b| = k

If k>0k > 0 there are two solutions: ax+b=kax + b = k or ax+b=−kax + b = -k. Geometrically, the horizontal line y=ky = k cuts the V twice.

If k=0k = 0 there is one solution, the vertex. If k<0k < 0 there are no solutions, because a modulus is never negative.

Solving ∣f(x)∣=∣g(x)∣|f(x)| = |g(x)|

Here both sides are moduli, so both sides are automatically non-negative. Two equivalent methods, and either is fully acceptable:

  1. Square both sides. ∣a∣=∣b∣  ⟺  a2=b2|a| = |b| \iff a^2 = b^2, so squaring loses nothing and creates nothing. You get a quadratic.
  2. Split into two linear equations. ∣a∣=∣b∣  ⟺  a=b|a| = |b| \iff a = b or a=−ba = -b.

Method 2 is usually faster and avoids messy expansion; method 1 is safer if you tend to lose signs. The squared quadratic also reappears in the inequality version of the question, so it is worth being fluent in both.

Modulus equals modulus (syllabus example)

Solve the equation ∣3x−2∣=∣2x+7∣|3x - 2| = |2x + 7|.

Solution

Method 1: square. Both sides are non-negative, so squaring is reversible:

(3x−2)2=(2x+7)2(3x - 2)^2 = (2x + 7)^29x2−12x+4=4x2+28x+499x^2 - 12x + 4 = 4x^2 + 28x + 495x2−40x−45=0⇒x2−8x−9=0⇒(x−9)(x+1)=05x^2 - 40x - 45 = 0 \quad\Rightarrow\quad x^2 - 8x - 9 = 0 \quad\Rightarrow\quad (x - 9)(x + 1) = 0

So x=9x = 9 or x=−1x = -1.

Method 2: split. 3x−2=2x+73x - 2 = 2x + 7 gives x=9x = 9. 3x−2=−(2x+7)3x - 2 = -(2x + 7) gives 5x=−55x = -5, so x=−1x = -1.

Check: x=9x = 9 gives ∣25∣=∣25∣|25| = |25|; x=−1x = -1 gives ∣−5∣=∣5∣|-5| = |5|. Both are valid.

The two V graphs y=∣3x−2∣y = |3x - 2| and y=∣2x+7∣y = |2x + 7| cross at exactly these two xx-values.

y = abs(3x - 2) y = abs(2x + 7) (-1, 0) -- (-1, 5) (9, 0) -- (9, 25)

Solving ∣ax+b∣=|ax + b| = a linear expression

Now the right-hand side, such as x+1x + 1, is not a modulus. It can be negative, and a modulus can never equal a negative number. So the cases method can produce a "solution" that does not actually work.

Modulus equal to a non-modulus expression
  1. Write the two cases: ax+b=g(x)ax + b = g(x) and ax+b=−g(x)ax + b = -g(x).
  2. Solve each.
  3. Check every answer in the original equation (equivalently, reject any answer that makes g(x)<0g(x) < 0).
  4. A quick sketch of the V and the line confirms how many solutions there should be.
Both cases valid

Solve ∣2x−5∣=x+1|2x - 5| = x + 1.

Solution

Case 1: 2x−5=x+1⇒x=62x - 5 = x + 1 \Rightarrow x = 6.

Case 2: 2x−5=−(x+1)⇒3x=4⇒x=432x - 5 = -(x + 1) \Rightarrow 3x = 4 \Rightarrow x = \tfrac{4}{3}.

Check x=6x = 6: ∣7∣=7|7| = 7 and 6+1=76 + 1 = 7. Valid.

Check x=43x = \tfrac{4}{3}: ∣83−5∣=73\left|\tfrac{8}{3} - 5\right| = \tfrac{7}{3} and 43+1=73\tfrac{4}{3} + 1 = \tfrac{7}{3}. Valid.

So x=43x = \tfrac{4}{3} or x=6x = 6.

One case must be rejected

Solve ∣x−1∣=2x−5|x - 1| = 2x - 5.

Solution

Case 1: x−1=2x−5⇒x=4x - 1 = 2x - 5 \Rightarrow x = 4. Check: ∣3∣=3|3| = 3 and 2(4)−5=32(4) - 5 = 3. Valid.

Case 2: x−1=−(2x−5)⇒3x=6⇒x=2x - 1 = -(2x - 5) \Rightarrow 3x = 6 \Rightarrow x = 2. Check: ∣1∣=1|1| = 1 but 2(2)−5=−12(2) - 5 = -1. A modulus cannot equal −1-1, so reject x=2x = 2.

The only solution is x=4x = 4.

The sketch shows why. The line y=2x−5y = 2x - 5 meets the right arm of the V once. The second case found where the line meets the extension of the left arm, y=−(x−1)y = -(x - 1), below the axis, which is not part of the graph at all.

y = abs(x - 1) y = 2x - 5 y = 1 - x (2, -1) (4, 3)
Watch out

If you square ∣x−1∣=2x−5|x - 1| = 2x - 5 you get (x−1)2=(2x−5)2(x - 1)^2 = (2x - 5)^2, whose roots are again x=2x = 2 and x=4x = 4. Squaring is not reversible here because 2x−52x - 5 can be negative, so the false root x=2x = 2 slips in. Squaring is only safe when both sides are known to be non-negative. With a non-modulus side, use cases and check.

Multiples of a modulus and "hence" questions

Equations such as 2∣x+1∣=∣3x−4∣2|x + 1| = |3x - 4| are still "modulus equals modulus", because 2∣x+1∣=∣2x+2∣2|x + 1| = |2x + 2|. Square, or split as 2(x+1)=±(3x−4)2(x + 1) = \pm(3x - 4).

Cambridge very often follows such an equation with "hence solve" an equation in which xx has been replaced by 2y2^y, eye^y, 3y3^y or similar. The idea is to reuse the answers: set 2y2^y equal to each solution for xx, then solve with logarithms. Any solution where the exponential would have to be zero or negative is impossible and must be discarded with a reason.

A multiple of a modulus, then hence

(a) Solve the equation 2∣x+1∣=∣3x−4∣2|x + 1| = |3x - 4|.

(b) Hence solve the equation 2∣2y+1∣=∣3×2y−4∣2|2^y + 1| = |3 \times 2^y - 4|, giving answers correct to 3 significant figures.

Solution

(a) Both sides are non-negative, so square:

4(x+1)2=(3x−4)24(x + 1)^2 = (3x - 4)^24x2+8x+4=9x2−24x+164x^2 + 8x + 4 = 9x^2 - 24x + 160=5x2−32x+12=(5x−2)(x−6)0 = 5x^2 - 32x + 12 = (5x - 2)(x - 6)

So x=6x = 6 or x=25x = \tfrac{2}{5}.

Check: x=6x = 6 gives 2×7=142 \times 7 = 14 and ∣14∣=14|14| = 14. x=0.4x = 0.4 gives 2×1.4=2.82 \times 1.4 = 2.8 and ∣1.2−4∣=2.8|1.2 - 4| = 2.8. Both valid.

(b) This is part (a) with x=2yx = 2^y. So 2y=62^y = 6 or 2y=0.42^y = 0.4. Both are positive, so both give solutions.

2y=6⇒y=ln⁡6ln⁡2=2.582y=0.4⇒y=ln⁡0.4ln⁡2=−1.322^y = 6 \Rightarrow y = \frac{\ln 6}{\ln 2} = 2.58 \qquad\qquad 2^y = 0.4 \Rightarrow y = \frac{\ln 0.4}{\ln 2} = -1.32

(3 s.f.)

Exam tip

In a "hence" part you must use the earlier result. Write "2y=62^y = 6 or 2y=0.42^y = 0.4" explicitly. If one of the earlier solutions is negative, say "2y=−32^y = -3 has no solution since 2y>02^y > 0". Examiners give a mark for rejecting it with the reason.

Sums of moduli (stretch)

Equations like ∣x∣+∣x−4∣=6|x| + |x - 4| = 6 are not common in P3, but they test real understanding, and the distance view makes them quick. ∣x∣+∣x−4∣|x| + |x - 4| is the distance from xx to 00 plus the distance from xx to 44.

Sum of two moduli

Solve ∣x∣+∣x−4∣=6|x| + |x - 4| = 6.

Solution

The expressions inside the moduli change sign at x=0x = 0 and x=4x = 4, so split the number line into three regions.

For x≥4x \ge 4: both are non-negative, so x+(x−4)=6⇒x=5x + (x - 4) = 6 \Rightarrow x = 5. This is in the region. Valid.

For 0≤x<40 \le x < 4: x+(4−x)=4x + (4 - x) = 4, which is never 66. No solutions here.

For x<0x < 0: −x+(4−x)=6⇒−2x=2⇒x=−1-x + (4 - x) = 6 \Rightarrow -2x = 2 \Rightarrow x = -1. This is in the region. Valid.

So x=−1x = -1 or x=5x = 5.

In distance terms: any point between 00 and 44 has total distance 44 to the two ends; to make it 66 you must step 11 unit outside, giving −1-1 and 55.

y = abs(x) + abs(x - 4) y = 6
Tip

For any equation with several moduli, the "critical values" where each inside expression is zero split the line into regions. In each region every modulus can be replaced by +(…)+(\ldots) or −(…)-(\ldots), giving an ordinary equation. Keep only answers that lie in the region you were working in.

Counting solutions with a graph

Some questions ask how many solutions an equation has, or for which values of a constant there are two solutions. Sketch the V and the other graph and watch them move.

A line through the origin meeting a V

Find the set of values of mm for which the equation ∣2x−4∣=mx|2x - 4| = mx has exactly two solutions.

Solution

Sketch y=∣2x−4∣y = |2x - 4|: vertex (2,0)(2, 0), yy-intercept 44, arms of gradient 22 and −2-2. The line y=mxy = mx passes through the origin.

If m≤0m \le 0, the line lies on or below the axis for x≥0x \ge 0 and passes through the origin; it can meet the left arm y=4−2xy = 4 - 2x only when m<−2m < -2 (steeper than that arm), and then just once. For m=0m = 0 it touches only the vertex. So m≤0m \le 0 never gives two solutions.

If m>0m > 0, the line meets the left arm y=4−2xy = 4 - 2x where mx=4−2xmx = 4 - 2x, i.e. x=4m+2x = \dfrac{4}{m + 2}, which is less than 22, so it is on the arm. It meets the right arm y=2x−4y = 2x - 4 where mx=2x−4mx = 2x - 4, i.e. x=42−mx = \dfrac{4}{2 - m}; this exists and is at least 22 exactly when 0<m<20 < m < 2. If m≥2m \ge 2 the line is at least as steep as the right arm and never catches it.

So there are exactly two solutions when 0<m<20 < m < 2.

y = abs(2x - 4) y = 0.5 x y = 2x

With m=0.5m = 0.5 the line cuts both arms; with m=2m = 2 it is parallel to the right arm and cuts only the left one.

Common mistakes

Watch out

Treating ∣x∣|x| as "remove the minus sign" inside an expression. ∣x−3∣|x - 3| is not x+3x + 3. The modulus acts on the whole value inside, after it has been worked out.

Watch out

Squaring when one side is not a modulus. ∣x−1∣=2x−5|x - 1| = 2x - 5 squared gives a false root. Only square when both sides are certainly non-negative, otherwise use cases and check.

Watch out

Forgetting the second case. ∣2x−1∣=5|2x - 1| = 5 has two solutions, x=3x = 3 and x=−2x = -2. Writing only 2x−1=52x - 1 = 5 loses half the marks.

Watch out

Not rejecting impossible exponentials. In a "hence" part, ey=−2e^y = -2 has no solution. Say so; do not write y=ln⁡(−2)y = \ln(-2).

Exam tip
  • "Solve" means find all solutions. Expect two for modulus-equals-modulus questions (occasionally one, if the quadratic has a repeated root or becomes linear).
  • When squaring, show the expanded quadratic and its factorisation or formula: the method marks are for "squaring and forming a three-term quadratic" and "solving it".
  • If the squared equation becomes linear (because the x2x^2 terms cancel, as in ∣x−2∣=∣x+4∣|x - 2| = |x + 4|), that is correct: there is just one solution.
  • Give exact answers (fractions) unless told otherwise, and in "hence" parts give 3 significant figures if asked.
  • A sketch is never wasted: it shows the number of solutions before you start and catches false roots.

Summary

Summary
  • ∣x∣|x| is the size of xx, the distance from 00; ∣x−a∣|x - a| is the distance from xx to aa.
  • y=∣ax+b∣y = |ax + b| is a V with vertex (−ba,0)\left(-\tfrac{b}{a}, 0\right), yy-intercept ∣b∣|b| and arm gradients ±a\pm a.
  • ∣ax+b∣=k|ax + b| = k has two solutions if k>0k > 0, one if k=0k = 0, none if k<0k < 0.
  • ∣a∣=∣b∣  ⟺  a2=b2  ⟺  a=±b|a| = |b| \iff a^2 = b^2 \iff a = \pm b: for modulus = modulus, square or split, no checking needed.
  • For modulus = non-modulus, split into two cases and check each; squaring can introduce false roots.
  • For several moduli, split the number line at each critical value and work region by region.
  • In "hence" questions, replace xx by the given exponential, solve each case with logs, and reject impossible ones with a reason.

Practice

Question
  1. Solve ∣4x−1∣=7|4x - 1| = 7.
  2. Sketch y=∣2x+3∣y = |2x + 3|, giving the coordinates of the vertex and the yy-intercept, and hence solve ∣2x+3∣=5|2x + 3| = 5.
  3. Solve ∣x+2∣=∣3x−4∣|x + 2| = |3x - 4|.
  4. Solve ∣2x+1∣=3−x|2x + 1| = 3 - x.
  5. Solve ∣x−3∣=2x|x - 3| = 2x.
  6. Solve ∣x−4∣=3∣x∣|x - 4| = 3|x|.
  7. (a) Solve 3∣x−1∣=∣2x+3∣3|x - 1| = |2x + 3|. (b) Hence solve 3∣ey−1∣=∣2ey+3∣3|e^y - 1| = |2e^y + 3|, giving the answer in exact form.
  8. Find the set of values of kk for which ∣x−2∣=k−x|x - 2| = k - x has no solutions.
  9. Solve ∣x−1∣+∣x+2∣=7|x - 1| + |x + 2| = 7.
Answers
  1. 4x−1=7⇒x=24x - 1 = 7 \Rightarrow x = 2, or 4x−1=−7⇒x=−324x - 1 = -7 \Rightarrow x = -\tfrac{3}{2}.

  2. Vertex where 2x+3=02x + 3 = 0: (−32,0)\left(-\tfrac{3}{2}, 0\right). yy-intercept (0,3)(0, 3). Arms have gradients ±2\pm 2. The line y=5y = 5 cuts the V twice: 2x+3=5⇒x=12x + 3 = 5 \Rightarrow x = 1 and 2x+3=−5⇒x=−42x + 3 = -5 \Rightarrow x = -4.

  3. Split: x+2=3x−4⇒x=3x + 2 = 3x - 4 \Rightarrow x = 3; x+2=−(3x−4)⇒4x=2⇒x=12x + 2 = -(3x - 4) \Rightarrow 4x = 2 \Rightarrow x = \tfrac{1}{2}. Squaring gives 8x2−28x+12=08x^2 - 28x + 12 = 0, i.e. 2x2−7x+3=(2x−1)(x−3)=02x^2 - 7x + 3 = (2x - 1)(x - 3) = 0, the same answers.

  4. 2x+1=3−x⇒x=232x + 1 = 3 - x \Rightarrow x = \tfrac{2}{3}; check ∣73∣=73\left|\tfrac{7}{3}\right| = \tfrac{7}{3}, valid. 2x+1=−(3−x)⇒x=−42x + 1 = -(3 - x) \Rightarrow x = -4; check ∣−7∣=7|-7| = 7 and 3−(−4)=73 - (-4) = 7, valid. So x=23x = \tfrac{2}{3} or x=−4x = -4.

  5. x−3=2x⇒x=−3x - 3 = 2x \Rightarrow x = -3, but then 2x=−6<02x = -6 < 0, reject. x−3=−2x⇒x=1x - 3 = -2x \Rightarrow x = 1; check ∣−2∣=2=2(1)|-2| = 2 = 2(1), valid. Only x=1x = 1.

  6. Square: x2−8x+16=9x2⇒8x2+8x−16=0⇒x2+x−2=0⇒(x+2)(x−1)=0x^2 - 8x + 16 = 9x^2 \Rightarrow 8x^2 + 8x - 16 = 0 \Rightarrow x^2 + x - 2 = 0 \Rightarrow (x + 2)(x - 1) = 0. x=1x = 1 (check 3=33 = 3) or x=−2x = -2 (check 6=66 = 6).

  7. (a) Square: 9(x−1)2=(2x+3)2⇒9x2−18x+9=4x2+12x+9⇒5x2−30x=0⇒5x(x−6)=09(x - 1)^2 = (2x + 3)^2 \Rightarrow 9x^2 - 18x + 9 = 4x^2 + 12x + 9 \Rightarrow 5x^2 - 30x = 0 \Rightarrow 5x(x - 6) = 0, so x=0x = 0 or x=6x = 6. (b) ey=0e^y = 0 is impossible since ey>0e^y > 0 for all yy. ey=6⇒y=ln⁡6e^y = 6 \Rightarrow y = \ln 6.

  8. Sketch y=∣x−2∣y = |x - 2| (vertex (2,0)(2, 0)) and y=k−xy = k - x (gradient −1-1, parallel to the left arm). The line is parallel to the left arm, so it can only meet the right arm y=x−2y = x - 2, at x−2=k−xx - 2 = k - x, i.e. x=k+22x = \tfrac{k + 2}{2}, which is on the right arm only if k+22≥2\tfrac{k + 2}{2} \ge 2, i.e. k≥2k \ge 2. (When k=2k = 2 the line coincides with the left arm's line y=2−xy = 2 - x and the whole left arm is a solution set.) So there are no solutions when k<2k < 2.

  9. Critical values x=1x = 1 and x=−2x = -2. For x≥1x \ge 1: (x−1)+(x+2)=7⇒2x=6⇒x=3(x - 1) + (x + 2) = 7 \Rightarrow 2x = 6 \Rightarrow x = 3, valid. For −2≤x<1-2 \le x < 1: (1−x)+(x+2)=3≠7(1 - x) + (x + 2) = 3 \ne 7, no solutions. For x<−2x < -2: (1−x)−(x+2)=7⇒−2x=8⇒x=−4(1 - x) - (x + 2) = 7 \Rightarrow -2x = 8 \Rightarrow x = -4, valid. So x=−4x = -4 or x=3x = 3.

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action