İnteraktif Dersler

Absolute value and piecewise functions

Lecture notes

Definition

Absolute value

The absolute value |x| is the distance from x to 0 on the number line. A distance is never negative: |x| ≥ 0, and |x| = 0 only for x = 0. For a negative number the bars remove the minus sign.
033
Example
|−7| = 7, |4| = 4 and |0| = 0:
−7−40474
Definition

Distance between two numbers

The distance between x and a is |x − a|. It is the same as |a − x|: take the bigger number minus the smaller one. |x − a| is the distance of x to the centre a.
|x−a|ax
Example
The distance between −2 and 5:
−4−202467
Rule

|x − a| = d

The numbers at distance d from a: walk d to the left and d to the right. So x = a − d or x = a + d (two solutions when d > 0, one when d = 0).
ddaa−da+d
Example
|x − 3| = 4: the numbers 4 away from 3:
−2−101234567844
Rule

|x − a| < d and |x − a| > d

|x − a| < d: closer to a than d, so between a − d and a + d. |x − a| > d: further away, so outside them. ≤ and ≥ include the ends (closed dots), < and > do not (open dots).
a−da+d|x−a|<da−da+d|x−a|>d
Example
|x − 3| < 2 and |x − 3| > 2:
−101234567|x−3|<2−101234567|x−3|>2
Rule

The V graph y = a|x − h| + k

The graph is a V with its vertex at (h, k) and the axis of symmetry x = h. The sign of h turns round: |x − 1| has h = 1, |x + 1| has h = −1. If a > 0 the V opens up and the lowest value is k; if a < 0 it is upside down and the highest value is k. The slope of the arms is a and −a.
xy1a(h,k)
Example
y = 2|x − 1| + 3: the vertex is (1, 3), a = 2 > 0, so the lowest value is 3 and the range is y ≥ 3:
−24812xy13
Rule

Zeros of a V graph

Set y = 0: a|x − h| + k = 0, so |x − h| = −k / a. If that number is positive, walk that far to the left and right of h: two zeros. If it is 0 the vertex is the only zero; if it is negative there is no zero.
xyx₁x₂
Example
y = 2|x − 1| − 6: |x − 1| = 3, so the zeros are 3 to the left and 3 to the right of 1:
xy(1,−6)33−24
Rule

Two arms: the piecewise form

The bars do nothing when the inside is ≥ 0 and flip the sign when it is < 0. So the V is two straight pieces: for x ≥ h the right arm y = a(x − h) + k, for x < h the left arm y = −a(x − h) + k.
xyx≥hx<h
Example
y = |x − 2| + 1: for x ≥ 2 it is x − 2 + 1 = x − 1, for x < 2 it is −(x − 2) + 1 = 3 − x. Both give 1 at x = 2:
−246246xy21x−13−x
Rule

|ax + b| = c

The inside is c or −c: solve both ax + b = c and ax + b = −c. For |ax + b| < c the inside lies between −c and c; for |ax + b| > c it is below −c or above c. Dividing by a negative number turns the signs round.
xycx₁x₂
Example
|2x − 3| = 5:
268xy5−14
Watch out!

Cases and false roots

When the other side has an x too (|ax + b| = cx + d), split into two cases: the inside ≥ 0 (bars do nothing) and the inside < 0 (bars flip the sign). Solve each case and keep only the answers that fit their own case. An answer that does not fit is a false root.
xy✔✘
Example
|x − 2| = 2x − 7. Case x ≥ 2: x − 2 = 2x − 7, so x = 5 fits. Case x < 2: 2 − x = 2x − 7, so x = 3, which is not < 2: a false root. Only x = 5 is a solution:
−22−4xy53
Special case

No solution and every x

An absolute value is never negative. So |expression| = a negative number has no solution, and |expression| > a negative number is true for every x. Also |expression| = 0 has exactly the solutions where the expression itself is 0.
xy
Example
|x − 2| = −3 has no solution, and |x − 2| > −3 is true for every x, because 0 > −3:
xy−3
Watch out!

Do not drop the bars too early

|x − a| is not x − a when x < a, and |a + b| is not always |a| + |b|. First work out what is inside the bars, then take the absolute value.
ab0a+b
Example
For x = 2 and a = 5, |2 − 5| = 3, not −3. And |3 + (−5)| = 2 but |3| + |−5| = 8:
0253|2−5|−2033−52|3+(−5)|
Rule

|f(x)| and f(|x|)

y = |f(x)|: the parts of the graph below the x-axis are flipped up over the x-axis; the zeros stay. y = f(|x|): the right half is copied onto the left (mirror in the y-axis) and the old left half disappears. With a number: |f(a)| is f(a) first, then positive; f(|a|) is |a| first, then into f.
xyf(x)xy|f(x)|xyf(|x|)
Example
f(x) = x − 2 and a = −1: |f(−1)| = |−3| = 3 but f(|−1|) = f(1) = −1:
xy−33−1
Definition

Piecewise function

A piecewise function has a different formula on different intervals. To find f(x), first find the piece whose condition holds for that x; ≤ and ≥ include the end, < and > do not. Every x must get exactly one output.
xyc
Example
f(x) = x + 1 for x < 2 and f(x) = 5 − x for x ≥ 2. For x = 0 use the first piece, for x = 2 the second:
46−1245xy123
Rule

Continuous, a jump or a hole

At a join compare the two pieces. Same value and the point belongs to the graph: continuous. Different values: a jump. Same value but no piece includes the point: a hole (f is not defined there). To make a graph continuous with a number p, make the two pieces equal at the join and solve for p.
xy=xy≠xy?
Example
f(x) = px for x ≤ 2 and f(x) = x + 4 for x > 2. The right piece gives 2 + 4 = 6 at the join, so 2p = 6:
448xy26
Tip

Tolerance and bundles

A tolerance |x − T| ≤ t means x may be at most t away from the target T: from T − t to T + t. A bundle with extra costs is a piecewise rule: flat up to the bundle, then rising. A capped price is a step function that stops at the maximum.
TT−tT+txyBG
Example
A bolt of 50 mm may be 0.3 mm off: from 49.7 to 50.3. A plan of 10 euros with 5 GB and 2 euros per extra GB, 8 GB used: 3 extra GB:
49.75050.30.30.35101020xy816
Tip

Tax brackets

With brackets every part of the income is taxed at its own rate: work out the tax of each bracket on its own part only, then add the parts. The graph of the tax is piecewise linear and rises faster in each higher bracket.
xy123
Example
0 % up to 10 000, 20 % up to 40 000, 40 % above. Income 50 000: the second bracket has 30 000, the third has 10 000:
2040604812xy501010

Exercises

Give the distance between −4 and 6, and solve . Easy
Show solution
Distance: .
−40610
: the numbers at distance 5 from 0.
So or .
−50555
Answer → distance 10; or
Check: from −4 up to 6 is steps.
Solve and . Easy
Show solution
The centre is 2 and the distance is 5.
, so or .
−32755
: closer than 5 to 2, so between −3 and 7.
−327
Answer → or ;
Check: is in between and .
For give the vertex, the highest value, the zeros and the range. Medium
Show solution
The vertex is . Since the V is upside down, so the highest value is 8.
xy38(3,8)
Zeros: , so .
or .
The range is .
xy−17
Answer → vertex , highest value 8, zeros −1 and 7, range
Check: for both zeros.
Solve . Medium
Show solution
means .
xy−1767
Add 5 to every part: .
Divide by 2: .
−106
Answer →
Check: gives and gives , so both ends are included.
A phone plan costs 12 euros a month and includes 4 GB. Every extra GB costs 3 euros. What is the bill for 7 GB, and for 3 GB? Medium
Show solution
7 GB: the extra GB are , so the extra cost is .
The bill is euros.
3 GB is within the bundle: no extra GB, the bill stays 12 euros.
1030xy312721
Answer → 21 euros for 7 GB, 12 euros for 3 GB
Check: .
Solve with the case method and check each answer. Hard
Show solution
Case (the bars do nothing): , so . It fits .
Case (the bars flip the sign): , so and .
But is not < −1: it does not fit its case, a false root.
−33−6−339xy67✘
Only is left.
Answer → ( is a false root)
Check: and .
for and for . Find p so that the graph is continuous at , and say what the graph does for . Hard
Show solution
The right piece at gives .
The left piece at gives . Make them equal: .
So and .
6510xy37
For the left piece gives , the right piece 7: different values, a jump.
6612xy316
Answer → ; for there is a jump
Check: .
Income tax: 0 % up to 10 000 euros, 20 % on the part from 10 000 to 40 000, 40 % on the part above 40 000. How much tax on an income of 55 000 euros? Hard
Show solution
Bracket 1: 0 % of 10 000 is 0.
Bracket 2: the part from 10 000 to 40 000 is 30 000, and 20 % of it is 6 000.
Bracket 3: the part above 40 000 is , and 40 % of it is 6 000.
Add the parts: .
xy5512
Answer → 12 000 euros tax
Check: is about 22 %, between 20 % and 40 %.
Are you a teacher?

Start live lessons with these applications for your whole class. Free to try for one month.

Try it free

Fits these school years

IB (MYP, Diploma): MYP 5, Diploma, year 1, Diploma, year 2

Cambridge International: AS Level, A Level

Netherlands: Vwo · Mathematics B

Türkiye (MEB): Year 7 (MEB), Year 9 (MEB), Year 11 (MEB)

England (GCSE, A Level): Year 12 (A Level), Year 13 (A Level)

USA (Common Core): Grade 6, Grade 7, Algebra 1, Algebra 2

What the applications of this topic teach 7 applications

|x − a| is a distance

  • Seeing |x − a| as the distance between x and a on the number line
  • Solving |x − a| = d, < d and > d with two points at distance d
  • Writing the answer as two points, a stretch or the outside parts

The V graph y = a|x − h| + k

  • Reading the vertex and slope from y = a|x − h| + k
  • Giving the axis, the extreme value, the zeros and the range of a V graph
  • Writing the V as two straight pieces

|f(x)| and f(|x|)

  • Sketching y = |f(x)|: parts below the x-axis flip up
  • Sketching y = f(|x|): the right half is copied to the left
  • Solving |f(x)| = k

Absolute value equations and inequalities

  • Solving |ax + b| = c, < c and > c by rewriting
  • Solving |ax + b| = cx + d in two cases and rejecting false roots
  • Reading solutions from two graphs

Build a piecewise function

  • Finding f(x) for a piecewise rule by choosing the piece
  • Telling what the graph does at a join: continuous, jump or hole
  • Finding the number p that makes a piecewise graph continuous

Absolute value and pieces in everyday life

  • Using |x − T| ≤ t to decide whether a measured part is allowed
  • Working out a capped parking price and income tax in brackets
  • Saying what the answer means and reading it on the graph

V puzzles: ghosts and descriptions

  • Making the V graph y = a|x − h| + k that lies on a given V
  • Making the V that fits a description