Skip to main content

Absolute value and piecewise-defined functions: the piecewise definition of |x|, graphing y = |ax + b|, solving |ax + b| = k with cases (with Extension 1 inequalities and variable right-hand sides flagged), evaluating and graphing piecewise functions and finding where they are continuous (the piecewise definition, domain, range, symmetry and piecewise functions are new in the 2024 syllabus)

Syllabus dot point

“Define and graph piecewise functions, recognise continuity and breaks informally, define the absolute value ∣x∣|x| piecewise, graph y=∣x∣y = |x| and y=∣ax+b∣y = |ax + b|, and solve absolute value equations of the form ∣ax+b∣=k|ax + b| = k algebraically and graphically”

HSCMaths AdvancedYear 11: Functions13 min read

Quick answer

∣x∣=x|x| = x for x≥0x \geq 0 and −x-x for x<0x < 0, with x2=∣x∣\sqrt{x^2} = |x|. Solve ∣ax+b∣=k|ax + b| = k by splitting into cases or by graphing, and check each answer against its case since extraneous solutions occur (inequalities and variable right-hand sides are Extension 1). A piecewise function uses a different rule on each interval and is continuous at a join when the pieces take the same value there. The 2017 Advanced course already graphed ∣x∣|x| and ∣ax+b∣|ax + b| and solved ∣ax+b∣=k|ax + b| = k; 2024 adds the piecewise definition, domain, range, symmetry and piecewise functions.

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions
  4. Practice questions

What this dot point is asking

Two linked ideas appear in the Mathematics Advanced 11-12 Syllabus (2024) Year 11 Working with functions focus area. Piecewise-defined functions use different rules on different parts of the domain, and students are expected to graph them, decide whether they are even or odd, and talk informally about continuity and about points where the graph "breaks". The absolute value function is built on exactly that idea: NESA asks you to establish the piecewise definition of ∣x∣|x|, show that x2=∣x∣\sqrt{x^2} = |x|, graph y=∣ax+b∣y = |ax + b| (with and without technology), and solve absolute value equations of the form ∣ax+b∣=k|ax + b| = k algebraically and graphically.

The 2017 Advanced course already graphed y=∣x∣y = |x| and y=∣ax+b∣y = |ax + b| and solved ∣ax+b∣=k|ax + b| = k. The 2024 course adds the piecewise definition of ∣x∣|x|, the result x2=∣x∣\sqrt{x^2} = |x|, and the domain, range and symmetry of these graphs, together with piecewise-defined functions and informal continuity.

Some material on this page goes beyond the Advanced dot point and is labelled Extension 1: absolute value inequalities, and equations with the unknown on both sides such as ∣x−1∣=3x−5|x - 1| = 3x - 5. Treat those as extra practice unless you study Extension 1.

Note

The absolute value of a number is its distance from zero, ignoring direction, so ∣−3∣|{-3}| and ∣3∣|3| are both 33. As a function it works like a mirror: anything that would go below the xx-axis is flipped up above it. A piecewise function is a rule book with different instructions for different stretches of the number line. You check which stretch your xx is in, then follow that instruction.

The answer

Key fact

∣x∣={x,x≥0,−x,x<0.|x| = \begin{cases} x, & x \geq 0, \\ -x, & x < 0. \end{cases}

  • ∣a∣|a| is the distance from aa to 00; ∣a−b∣|a - b| is the distance between aa and bb.
  • x2=∣x∣\sqrt{x^2} = |x| (not xx).
  • ∣f(x)∣=k|f(x)| = k (k>0k > 0) means f(x)=kf(x) = k or f(x)=−kf(x) = -k.
  • Extension 1 only: ∣f(x)∣<k|f(x)| < k means −k<f(x)<k-k < f(x) < k; ∣f(x)∣>k|f(x)| > k means f(x)<−kf(x) < -k or f(x)>kf(x) > k.

Graphing y=∣x∣y = |x| and y=∣ax+b∣y = |ax + b|

The graph of y=∣x∣y = |x| is a V with its vertex at the origin. It is even (symmetric about the yy-axis), has domain all reals and range y≥0y \geq 0. For y=∣ax+b∣y = |ax + b|:

  1. Find the vertex where ax+b=0ax + b = 0, that is x=−bax = -\frac{b}{a}.
  2. Plot the yy-intercept ∣b∣|b|.
  3. Draw the V with gradients aa and −a-a either side of the vertex.

Equivalently, sketch y=ax+by = ax + b and reflect the part below the xx-axis upward.

Solving equations

The Advanced dot point covers equations of the form ∣ax+b∣=k|ax + b| = k. There are two reliable methods.

Cases. Split at the point where the inside changes sign, solve each case, and check every candidate against its own condition.

Graphs. Sketch both sides and read off the intersections, which is useful when the equation has an xx outside the modulus, as in ∣x−1∣=3x−5|x - 1| = 3x - 5 (an Extension 1 style equation).

Always test each answer in the original equation. An absolute value is never negative, so if the other side is negative at a candidate, that candidate is extraneous and must be discarded.

Piecewise functions

A piecewise function is written with a brace, one rule per interval. To evaluate, decide which interval the input lies in and use that rule. To graph, sketch each rule only on its own interval, using an open circle where an endpoint is excluded and a closed circle where it is included. Make sure every xx in the domain belongs to exactly one piece, otherwise it is not a function.

Continuity at a join, informally

A function is continuous at a point when you can draw through it without lifting your pen. For a piecewise function at the join x=cx = c, check that the two rules give the same value at cc (the left-hand rule approaching cc and the right-hand rule at cc). If they differ, there is a jump or a hole, and the function is discontinuous there. Note that continuity does not mean smoothness: y=∣x∣y = |x| is continuous everywhere even though it has a corner at the origin.

Worked examples

Graph a modulus function from its piecewise form

Write y=∣x−3∣y = |x - 3| as a piecewise function and state its range.

Cases

∣x−3∣=x−3|x - 3| = x - 3 when x≥3x \geq 3, and ∣x−3∣=3−x|x - 3| = 3 - x when x<3x < 3.

Features

The vertex is (3,0)(3, 0) and the yy-intercept is 33. The graph never goes below the xx-axis, so the range is y≥0y \geq 0.

Solve an absolute value inequality (Extension 1)

Solve ∣2x+1∣>5|2x + 1| > 5.

Split

2x+1>52x + 1 > 5 gives x>2x > 2. 2x+1<−52x + 1 < -5 gives x<−3x < -3.

Combine

The solution is x<−3x < -3 or x>2x > 2. On a number line this is two rays with a gap between −3-3 and 22.

Marker's note: "greater than" gives two pieces joined by "or", while "less than" gives one interval.

Common traps
Writing x2=x\sqrt{x^2} = x
It equals ∣x∣|x|, so (−3)2=3\sqrt{(-3)^2} = 3, not −3-3.
Solving only one case
Every modulus equation has two cases, and each answer must satisfy its own case condition.
Forgetting to reject extraneous solutions
Check each candidate in the original equation, especially when xx appears outside the modulus.
Combining "or" and "and" wrongly (Extension 1 inequalities)
∣x∣<5|x| < 5 is an "and" (between), while ∣x∣>5|x| > 5 is an "or" (outside).
Confusing continuous with smooth
A join can be continuous but have a corner, as in ∣x∣|x|.
Exam technique

When a question includes both a modulus and an xx outside it, draw the two graphs first so you know how many solutions to expect. Write the case condition next to each case ("x≥1x \geq 1") and tick it off when you check the answer. For a piecewise graph, mark the endpoints with open and closed circles so the domain of each piece is clear.

Exam-style questions

Questions in the style of NESA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

HSC-style3 marks
Sketch the graph of y=∣2x−4∣y = |2x - 4| and use it to solve ∣2x−4∣=x|2x - 4| = x (the unknown on both sides makes this an Extension 1 style equation).
Show worked answer →

The graph is a V-shape with vertex (2,0)(2, 0) and yy-intercept 44: for x≥2x \geq 2, y=2x−4y = 2x - 4, and for x<2x < 2, y=4−2xy = 4 - 2x. Setting 2x−4=x2x - 4 = x gives x=4x = 4 (valid since 4≥24 \geq 2). Setting 4−2x=x4 - 2x = x gives x=43x = \frac{4}{3} (valid since 43<2\frac{4}{3} < 2). So x=43x = \frac{4}{3} or x=4x = 4; the line y=xy = x crosses the V twice.

Markers award one mark for the sketch with vertex and intercept, one for each solution with its case checked.

HSC-style3 marks
Show that f(x)=∣x∣+x2f(x) = |x| + x^2 is an even function and sketch its graph for −2≤x≤2-2 \leq x \leq 2.
Show worked answer →

f(−x)=∣−x∣+(−x)2=∣x∣+x2=f(x)f(-x) = |-x| + (-x)^2 = |x| + x^2 = f(x), so ff is even and the graph is symmetric about the yy-axis. For x≥0x \geq 0, f(x)=x+x2f(x) = x + x^2 with f(0)=0f(0) = 0, f(1)=2f(1) = 2 and f(2)=6f(2) = 6. The left half is the mirror image: f(−1)=2f(-1) = 2 and f(−2)=6f(-2) = 6. There is a corner at the origin where the two halves meet.

Markers award one mark for the algebraic test, one for the right half and one for the reflected left half.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation2 marks
Solve ∣2x−3∣=7|2x - 3| = 7.
Show worked solution →

An absolute value equals 77 when the inside equals 77 or −7-7.

2x−3=7⇒x=5,2x−3=−7⇒x=−2.2x - 3 = 7 \Rightarrow x = 5, \qquad 2x - 3 = -7 \Rightarrow x = -2.

Check: ∣2(5)−3∣=7|2(5) - 3| = 7 and ∣2(−2)−3∣=∣−7∣=7|2(-2) - 3| = |-7| = 7. Both work, so x=5x = 5 or x=−2x = -2.

Marker's note: one mark for each solution. Forgetting the negative case loses a mark.

foundation2 marks
Extension 1: solve ∣3x−2∣≤4|3x - 2| \leq 4.
Show worked solution →

"Absolute value at most 44" means the inside lies between −4-4 and 44.

−4≤3x−2≤4  ⇒  −2≤3x≤6  ⇒  −23≤x≤2.-4 \leq 3x - 2 \leq 4 \;\Rightarrow\; -2 \leq 3x \leq 6 \;\Rightarrow\; -\tfrac{2}{3} \leq x \leq 2.

Marker's note: one mark for the double inequality, one for the solution. The graph of ∣3x−2∣|3x - 2| lies on or below y=4y = 4 between its two crossings.

core3 marks
The function ff is defined by f(x)=x+3f(x) = x + 3 for x<1x < 1 and f(x)=x2f(x) = x^2 for x≥1x \geq 1. (a) Find f(−2)f(-2), f(1)f(1) and f(3)f(3). (b) Is ff continuous at x=1x = 1? Explain.
Show worked solution →

(a) −2<1-2 < 1, so f(−2)=−2+3=1f(-2) = -2 + 3 = 1. f(1)=12=1f(1) = 1^2 = 1 (the rule with x≥1x \geq 1 applies). f(3)=9f(3) = 9.

(b) As xx approaches 11 from the left, f(x)=x+3f(x) = x + 3 approaches 44. But f(1)=1f(1) = 1. The graph jumps from height 44 to height 11 at x=1x = 1, so ff is not continuous there (a jump discontinuity of size 33).

Marker's note: one mark for the three values, one for the left-hand approach value and one for the conclusion.

core3 marks
The function f(x)=2x+kf(x) = 2x + k for x≤3x \leq 3 and f(x)=x2−1f(x) = x^2 - 1 for x>3x > 3 is continuous at x=3x = 3. Find kk, and sketch the shape of the graph near x=3x = 3.
Show worked solution →

Match the values at the join. From the left, f(3)=2(3)+k=6+kf(3) = 2(3) + k = 6 + k. From the right, x2−1→9−1=8x^2 - 1 \to 9 - 1 = 8. For continuity, 6+k=86 + k = 8, so k=2k = 2.

Shape. The graph is the line y=2x+2y = 2x + 2 up to and including the point (3,8)(3, 8), then the parabola y=x2−1y = x^2 - 1 continuing from that same point with gradient 66. The line has gradient 22, so there is a corner at (3,8)(3, 8), though no break.

Marker's note: one mark for equating the two values, one for k=2k = 2 and one for the description. Joining at a point makes a function continuous, not smooth.

exam4 marks
(a) Write f(x)=∣x−2∣+∣x+1∣f(x) = |x - 2| + |x + 1| without absolute value signs. (b) Hence solve f(x)=5f(x) = 5.
Show worked solution →

(a) Split at x=−1x = -1 and x=2x = 2, where each modulus changes.

  • x<−1x < -1: ∣x−2∣=2−x|x - 2| = 2 - x and ∣x+1∣=−x−1|x + 1| = -x - 1, so f(x)=1−2xf(x) = 1 - 2x.
  • −1≤x≤2-1 \leq x \leq 2: ∣x−2∣=2−x|x - 2| = 2 - x and ∣x+1∣=x+1|x + 1| = x + 1, so f(x)=3f(x) = 3.
  • x>2x > 2: ∣x−2∣=x−2|x - 2| = x - 2 and ∣x+1∣=x+1|x + 1| = x + 1, so f(x)=2x−1f(x) = 2x - 1.

(b) Solve in each part. For x<−1x < -1: 1−2x=51 - 2x = 5 gives x=−2x = -2, which is less than −1-1, so it is valid. For −1≤x≤2-1 \leq x \leq 2: f(x)=3≠5f(x) = 3 \neq 5, no solution. For x>2x > 2: 2x−1=52x - 1 = 5 gives x=3>2x = 3 > 2, valid.

The solutions are x=−2x = -2 and x=3x = 3.

Marker's note: two marks for the three pieces correctly simplified and two for the solutions with their interval checks. Each answer must fit its own interval.

exam4 marks
Extension 1 style: solve ∣x−1∣=3x−5|x - 1| = 3x - 5 and explain why one candidate must be rejected.
Show worked solution →
Case 1: x≥1x \geq 1
Then ∣x−1∣=x−1|x - 1| = x - 1, so x−1=3x−5x - 1 = 3x - 5, giving 4=2x4 = 2x and x=2x = 2. This satisfies x≥1x \geq 1.
Case 2: x<1x < 1
Then ∣x−1∣=1−x|x - 1| = 1 - x, so 1−x=3x−51 - x = 3x - 5, giving 6=4x6 = 4x and x=32x = \frac{3}{2}. This does not satisfy x<1x < 1, so it is rejected.
Check the survivor
At x=2x = 2: ∣2−1∣=1|2 - 1| = 1 and 3(2)−5=13(2) - 5 = 1. The solution is x=2x = 2 only.

Another way to see why x=32x = \frac{3}{2} fails: the right side 3x−5=−123x - 5 = -\frac{1}{2} is negative, but an absolute value cannot equal a negative number.

Marker's note: one mark for each case set up, one for solving both and one for the justified rejection.

Practise this

Sources & how we know this

ExamExplained