Lesson 4 of 8 · 16 min

Piece-wise functions

Evaluate, graph and interpret piece-wise functions — sub-functions on restricted domains — with correct open and closed endpoints and joins.

What you will be able to do

  • Read a piece-wise rule and evaluate it, choosing the correct piece at a boundary.
  • Sketch a piece-wise function with correct open and closed endpoints.
  • Decide whether the pieces join, and find a constant that makes them join.
  • Write the rule of a piece-wise function from its graph, and state its domain and range.

Some relationships change their rule partway along. Postage is one price up to 500 g and another above it. A phone plan charges nothing extra until you pass your data limit, then charges for every gigabyte. A single formula cannot describe these — you need a different rule on each part of the domain.

Definition

Piece-wise function

A piece-wise function is made of two or more sub-functions, each with its own restricted domain. The domains do not overlap, so every input uses exactly one rule. A brace collects the pieces, with each domain written beside its rule.

A piece-wise function with three pieces
f(x)={x+3,x<−1x2,−1≤x≤26−x,x>2f(x) = \begin{cases} x + 3, & x < -1 \\ x^2, & -1 \le x \le 2 \\ 6 - x, & x > 2 \end{cases}

The graph of ff. The first piece stops at an open circle (−1,2)(-1, 2) because x<−1x < -1 excludes −1-1; the middle piece starts with a closed dot at (−1,1)(-1, 1). At x=2x = 2 the middle and right pieces meet at (2,4)(2, 4).

To evaluate a piece-wise function, first decide which piece the input belongs to, then use only that rule:

  • f(−3)f(-3): since −3<−1-3 < -1, use x+3x + 3, so f(−3)=0f(-3) = 0.
  • f(1)f(1): since −1≤1≤2-1 \le 1 \le 2, use x2x^2, so f(1)=1f(1) = 1.
  • f(5)f(5): since 5>25 > 2, use 6−x6 - x, so f(5)=1f(5) = 1.

Boundary values need care. x=−1x = -1 satisfies −1≤x≤2-1 \le x \le 2, not x<−1x < -1, so it belongs to the middle piece.

For the function ff above, find f(−1)f(-1).

Key idea

Open and closed endpoints

Draw a closed dot where an endpoint belongs to the piece (≤\le or ≥\ge) and an open circle where it does not (<< or >>).

At any xx-value there can be at most one closed dot. Two closed dots one above the other would give one input two outputs — and the relation would not be a function.

Worked example

Evaluate, sketch and describe a piece-wise function

  • Complex familiar
  • Technology free
f(x)={x+3,x<−1x2,−1≤x≤26−x,x>2f(x) = \begin{cases} x + 3, & x < -1 \\ x^2, & -1 \le x \le 2 \\ 6 - x, & x > 2 \end{cases}

(a) Find f(−3)f(-3), f(−1)f(-1), f(2)f(2) and f(4)f(4). (b) Sketch the graph of y=f(x)y = f(x). (c) State the domain and range of ff.

6 steps

Try it yourself first, then check the working one step at a time.

Method

  1. For each input, find the piece whose domain contains it, then use that rule only.

  2. Sketch each piece only over its own domain, with open or closed endpoints.

  3. The domain is the union of the pieces' domains; the range is the union of their outputs.

Watch out for

  • Using x+3x + 3 for f(−1)f(-1) and getting 22.

  • Stating the range as [0,4][0, 4] by looking at the middle piece only.

If two neighbouring pieces give the same value at their boundary, the graph joins up there with no jump — the function is continuous at that point. If they give different values, the graph jumps. In the function above there is a jump at x=−1x = -1 (from 22 down to 11) and a join at x=2x = 2 (both pieces give 44).

Interactive

Make the pieces join

The right-hand piece y=3−xy = 3 - x (for x≥1x \ge 1) is fixed. Slide aa to move the left-hand piece up or down. Before you find it, predict the value of aa from the equations.

To make the pieces join algebraically, substitute the boundary value into both rules and set the results equal.

Worked example

Find the constant that makes the pieces join

  • Simple familiar
  • Technology free
f(x)={x2−1,x≤2kx−5,x>2f(x) = \begin{cases} x^2 - 1, & x \le 2 \\ kx - 5, & x > 2 \end{cases}

(a) Find the value of kk for which the graph of ff has no jump at x=2x = 2. (b) Using this value of kk, find f(3)f(3).

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Substitute the boundary value into both rules.

  2. Set the two results equal and solve for the unknown.

Watch out for

  • Substituting a value other than the boundary, such as x=3x = 3, into both rules.

Find the value of aa for which g(x)={2x+a,x<3x2−4,x≥3g(x) = \begin{cases} 2x + a, & x < 3 \\ x^2 - 4, & x \ge 3 \end{cases} has no jump at x=3x = 3.

To write a rule from a graph, treat each piece separately: find its equation (for a line, the gradient and yy-intercept), then write its domain from where it starts and stops, using ≤\le for a closed dot and << for an open circle.

Which rule gives the function hh graphed below?

Choose one answer

Common mistake

Where marks go at the boundaries

  • Using the wrong piece at a boundary value. Check each inequality: does it include the boundary?
  • Drawing closed dots on both pieces at the same xx-value, or forgetting the dots entirely.
  • Drawing a sub-function beyond its own domain. Each piece stops at its endpoints.

Summary

  • A piece-wise function uses different sub-functions on non-overlapping restricted domains.

  • To evaluate it, find the piece whose domain contains the input, then use that rule only.

  • Closed dots for ≤\le and ≥\ge, open circles for << and >>; never two closed dots at the same xx-value.

  • Pieces join (no jump) when both rules give the same value at the boundary; set them equal to find an unknown constant.

  • The domain is the union of the pieces' domains; the range is the union of the outputs of every piece.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 4 of 80% read

Save your progress with a free account