Lesson 1.5 · Unit 1 · F-IF.7b

Functions with different rules on different intervals

Tax brackets, postage, phone plans and the absolute value itself all change their rule at a boundary. A piecewise function states the rule for each interval and says where the switch happens. The absolute value turns out to be the simplest example, and understanding it as a distance makes equations and inequalities with it straightforward.

The method
  1. A piecewise function lists a rule for each interval, with a condition saying which rule applies.
  2. To evaluate, find which condition the input satisfies, then use only that rule.
  3. At a boundary, exactly one piece includes the endpoint. A filled dot marks that piece; an open dot marks the other.
  4. \( |x| \) is the distance from \( x \) to 0, and \( |x - a| \) is the distance from \( x \) to \( a \).
  5. As a piecewise rule: \( |x| = x \) when \( x \ge 0 \), and \( -x \) when \( x \lt 0 \).
  6. \( |A| = c \) (with \( c \gt 0 \)) means \( A = c \) or \( A = -c \). Solve both and check.
  7. \( |A| \lt c \) means \( -c \lt A \lt c \); \( |A| \gt c \) means \( A \lt -c \) or \( A \gt c \).
  8. Equations with the variable outside as well must be checked, since a distance cannot equal a negative number.

Where students lose marks: forgetting the second case. The equation \( |x - 3| = 2 \) has two solutions, 1 and 5, both at distance 2 from 3. Writing only \( x = 5 \) answers half the question.

Worked example

The problem. (a) For \( f(x) = \begin{cases} x + 2 & x \lt 1 \\ x^2 & x \ge 1 \end{cases} \), find \( f(-3) \), \( f(1) \) and \( f(4) \), and describe the graph at \( x = 1 \). (b) Solve \( |2x - 5| = 9 \). (c) Solve \( |x - 3| \lt 4 \) and \( |x - 3| \ge 4 \). (d) A tax is 10 percent of the first \$10,000 and 12 percent of the amount above that, up to \$40,000. Write the tax function and find the tax on \$25,000.

Step one: evaluate (a). For \( f(-3) \): \( -3 \lt 1 \), so use \( x + 2 \), giving \( -1 \). For \( f(1) \): \( 1 \ge 1 \), so use \( x^2 \), giving 1. For \( f(4) \): \( 4^2 = 16 \).

Step two: describe the boundary. As \( x \) approaches 1 from the left the value approaches \( 1 + 2 = 3 \) but never reaches it, so there is an open dot at \( (1, 3) \). At \( x = 1 \) the function equals 1, a filled dot at \( (1, 1) \). The graph jumps by 2 at \( x = 1 \): it cannot be drawn without lifting the pencil.

Step three: solve (b) in two cases. \( 2x - 5 = 9 \) gives \( 2x = 14 \), so \( x = 7 \). \( 2x - 5 = -9 \) gives \( 2x = -4 \), so \( x = -2 \). Check: \( |2(7) - 5| = 9 \) and \( |2(-2) - 5| = |-9| = 9 \). Both correct.

Step four: interpret (c) as distance. \( |x - 3| \lt 4 \) says \( x \) is within 4 of 3, so \( -4 \lt x - 3 \lt 4 \), which gives \( -1 \lt x \lt 7 \). The complement, \( |x - 3| \ge 4 \), is at least 4 away: \( x \le -1 \) or \( x \ge 7 \). Test \( x = 0 \): distance 3, inside the first set. Test \( x = 8 \): distance 5, in the second.

Step five: set up the tax function for (d). On the first \$10,000, \( T(x) = 0.10x \). Above \$10,000, the first \$10,000 still costs \$1,000, and the excess is taxed at 12 percent: \( T(x) = 1000 + 0.12(x - 10000) \).

Step six: write it piecewise. \( T(x) = \begin{cases} 0.10x & 0 \le x \le 10000 \\ 1000 + 0.12(x - 10000) & 10000 \lt x \le 40000 \end{cases} \).

Step seven: compute and check continuity. \( T(25000) = 1000 + 0.12(15000) = 1000 + 1800 = 2800 \). At the boundary the two pieces agree: \( 0.10(10000) = 1000 \) and the second piece gives \( 1000 + 0 = 1000 \). A well-designed tax schedule has no jump.

Step eight: read the slopes. The slope of each piece is its marginal rate, 0.10 then 0.12. A common belief is that moving into a higher bracket taxes all income at the higher rate; the function shows that only the excess is taxed at the higher rate, and the graph has a corner at \$10,000 and no jump.

Practice · 10 problems

Problems 1 to 5 are routine. Problems 6 to 10 are multi-step or ask for reasoning.

  1. For \( f(x) = \begin{cases} 2x & x \lt 0 \\ x + 1 & x \ge 0 \end{cases} \), find \( f(-2) \), \( f(0) \) and \( f(3) \).
    Show the full solution

    \( f(-2) = 2(-2) = -4 \). At 0 the second rule applies: \( f(0) = 1 \). \( f(3) = 3 + 1 = 4 \). \( -4, 1, 4 \)

  2. Solve \( |x| = 7 \).
    Show the full solution

    Two numbers are at distance 7 from 0. \( x = 7 \) or \( x = -7 \)

  3. Solve \( |x - 2| = 5 \).
    Show the full solution

    \( x - 2 = 5 \) gives 7, and \( x - 2 = -5 \) gives \( -3 \). \( x = 7 \) or \( x = -3 \)

  4. Solve \( |x + 1| \lt 3 \).
    Show the full solution

    \( -3 \lt x + 1 \lt 3 \), so subtract 1 throughout. \( -4 \lt x \lt 2 \)

  5. Evaluate \( |-8| - |3 - 10| \).
    Show the full solution

    \( 8 - |-7| = 8 - 7 \). 1

  6. Solve \( |3x - 1| = 11 \).
    Show the full solution

    \( 3x - 1 = 11 \) gives \( x = 4 \). \( 3x - 1 = -11 \) gives \( x = -\dfrac{10}{3} \). Check the second: \( 3\left(-\dfrac{10}{3}\right) - 1 = -11 \), and \( |-11| = 11 \). \( x = 4 \) or \( x = -\dfrac{10}{3} \)

  7. Solve \( |2x - 4| \ge 6 \).
    Show the full solution

    \( 2x - 4 \ge 6 \) gives \( x \ge 5 \). \( 2x - 4 \le -6 \) gives \( x \le -1 \). Test \( x = 0 \): \( |-4| = 4 \), not at least 6, so 0 is correctly outside. \( x \le -1 \) or \( x \ge 5 \)

  8. Solve \( |x - 3| = 2x \), and identify any extraneous solution.
    Show the full solution

    Case 1: \( x - 3 = 2x \) gives \( x = -3 \). Case 2: \( 3 - x = 2x \) gives \( x = 1 \). Check \( x = -3 \): the left side is \( |-6| = 6 \), the right side is \( 2(-3) = -6 \). They are not equal, so \( x = -3 \) is extraneous: a distance cannot equal a negative number. Check \( x = 1 \): \( |-2| = 2 \) and \( 2(1) = 2 \). Correct. \( x = 1 \) only

  9. Write \( g(x) = |x - 4| + |x + 1| \) as a piecewise function and check it at \( x = -2 \).
    Show the full solution

    The pieces change at \( x = -1 \) and \( x = 4 \). For \( x \lt -1 \): \( (4 - x) + (-x - 1) = 3 - 2x \). For \( -1 \le x \le 4 \): \( (4 - x) + (x + 1) = 5 \). For \( x \gt 4 \): \( (x - 4) + (x + 1) = 2x - 3 \). Check at \( x = -2 \): directly \( |-6| + |-1| = 7 \), and \( 3 - 2(-2) = 7 \). Correct. \( g(x) = 3 - 2x \) for \( x \lt -1 \); \( 5 \) for \( -1 \le x \le 4 \); \( 2x - 3 \) for \( x \gt 4 \)

  10. Extend the tax function of the worked example: above \$40,000 the rate is 22 percent on the excess. Find the tax on \$50,000 and explain why the function is continuous.
    Show the full solution

    At \$40,000 the tax is \( 1000 + 0.12(30000) = 1000 + 3600 = 4600 \). For \( x \gt 40000 \): \( T(x) = 4600 + 0.22(x - 40000) \). \( T(50000) = 4600 + 0.22(10000) = 4600 + 2200 = 6800 \). Continuity: at \$40,000 the third piece gives \( 4600 + 0 \), matching the second. Each new piece starts from the total accumulated so far, which is why the function has corners and no jumps. \$6,800

← 1.4 Symmetry: even and odd functions1.6 Composition and inverse functions →

Keep going in the full Precalculus course

All of U1 (Unit 1: Functions and Their Transformations) is free to everyone, with no account. The course has 75 lessons, each with worked examples and practice problems that come with full solutions. A free account can also start a free month of the whole course, with no card.

Open this lesson in the courseSee the whole course