Skip to lesson

Math · Algebra 1

Chapter 3: Functions

Piecewise Functions

Different rules on different stretches.

Lesson
5
Time
About 22 minutes
0 of 11 done

Step 1: Let's Learn

Read it, or press Listen and follow the words.

A piecewise function uses one rule on one stretch of inputs and a different rule elsewhere.

Choose before computing

Decide which condition the input satisfies, then use only that rule.

The boundary belongs to one side

The conditions must not overlap, or one input would have two outputs — and it would not be a function.

Where they appear

Postage, tax bands, and phone tariffs are all piecewise. The rule changes at a threshold.

Different rules on different intervals

A piecewise function uses one formula on part of the domain and another elsewhere. Each piece comes with the interval where it applies, and together the intervals must cover the domain without overlapping.

Choose the piece first

To evaluate f(4), find which interval contains 4, then use that piece's formula. Using the wrong piece is the standard error, and it is avoided by checking the interval before touching the algebra.

Graphing piece by piece

Graph each formula only over its own interval, marking endpoints as open or closed to match the inequalities. The endpoints are where errors hide, so draw them deliberately rather than letting the pieces run together.

Where they occur

Tax brackets, postage rates, phone tariffs and parking charges are all piecewise. Any situation with a threshold that changes the rule is naturally piecewise, which makes them far more common in practice than in textbooks.

Step 2: Try It Yourself

Tap and try it out.

One piece of a piecewise function is just a line on its own stretch.
-10-10-5-5551010
y = 2x

The slope is 2: for every 1 across, the line goes 2 up.

Step 3: Watch an Example

One step at a time.

Watch Priya Pick the Piece

f(x) = 2x for x < 3, and f(x) = x + 10 for x ≥ 3. Priya evaluates at 1 and at 5.

  1. Step 1

    For x = 1: 1 is less than 3, so she uses 2x.

Step 4: Your Turn

Practice makes it stick.

Below the Threshold

Problem 1 of 2

f(x) = 3x for x < 4, else x + 20. What is f(2)?

Above It

Problem 2 of 2

Same function. What is f(10)?

Which Rule Applies

1 of 8

f(x) = 2x for x < 5, else 100. What is f(3)?

2 of 8

Same function. What is f(9)?

3 of 8

Same function. What is f(5)?

4 of 8

May two pieces both claim the same input? 1 for yes, 0 for no.

5 of 8

f(x) = x + 1 for x ≤ 0, else 4x. What is f(0)?

6 of 8

Same function. What is f(2)?

7 of 8

Order the steps for evaluating a piecewise function.

  1. 1Select that rule only
  2. 2Substitute into it
  3. 3Check which condition the input satisfies

8 of 8

Is a postage cost by weight band piecewise? 1 for yes, 0 for no.

Step 5: Quick Check

Show what you know.

Question 1 of 1

f(x) = 5x for x < 2, else x + 50. What is f(1)?

What You Learned

  • A piecewise function applies a different rule on each stretch of inputs.
  • Decide which condition holds before computing anything.
  • The conditions must not overlap, or it would not be a function at all.