Piecewise Functions

TipLearning Objectives

By the end of this lesson, you’ll be able to:

  • Read and interpret piecewise-defined functions.
  • Evaluate a piecewise function at specific inputs.
  • Graph basic piecewise functions using domain restrictions.
  • Identify jumps, removable discontinuities, and matching endpoints.

Key Ideas

A piecewise function is defined by different rules on different parts of the domain.

Example: \[ f(x) = \begin{cases} 2x + 1 & x < 0 \\ x^2 & x \ge 0 \end{cases} \]

To evaluate:

  • Pick the correct piece based on the domain restriction.
  • Plug in the value using only that rule.

To graph:

  • Graph each “piece” on its restricted domain.
  • Use open/closed circles to show endpoints.

Common Problem Types

Evaluating Piecewise Functions

Choose the correct branch using the inequality, then substitute.

Example:
If
\[ f(x) = \begin{cases} 3x & x < 2 \\ x+4 & x \ge 2 \end{cases} \] then \(f(5)=9\) and \(f(1)=3\).


Determining Which Piece Applies

Many mistakes occur by plugging into the wrong rule.

Tip: Check inequalities carefully (strict vs. non-strict).


Graphing Piecewise Functions

Plot each expression on its domain.

Example: linear on one side, quadratic on the other.


Checking Continuity at Breakpoints

Compare left-hand and right-hand values.

Example:
If left-end value is 5 and right-end value is 7 → jump discontinuity.


Describing Features from Graphs

Identify:

  • where the function switches
  • whether endpoints are open or closed
  • increasing/decreasing behavior of each piece

Strategies

  • Always start by circling the inequality that includes your input.
  • For graphing: write a small domain table for each piece.
  • Use open circles for \(<\) or \(>\) and filled circles for \(\le\) or \(\ge\).
  • Check continuity by evaluating both sides of the boundary.
  • Don’t mix rules — use one piece at a time.

Worked Examples

Example 1 — Evaluate a Piecewise Function

Evaluate \(f(-3)\) and \(f(2)\) for: \[ f(x) = \begin{cases} -x & x < 0 \\ x^2 - 1 & x \ge 0 \end{cases} \]

For \(-3\): use \(-x\)\(f(-3)=3\)
For \(2\): use \(x^2 - 1\)\(f(2)=3\)


Example 2 — Graph a Piecewise Function

Graph: \[ g(x) = \begin{cases} 1 & x \le -1 \\ x + 2 & -1 < x < 2 \\ 4 & x \ge 2 \end{cases} \]

  • Horizontal line at \(y=1\) with closed dot at \(x=-1\)
  • Slanted line \(y=x+2\) between \(-1\) and \(2\), open circles at both ends
  • Horizontal line \(y=4\) with closed dot at \(x=2\)

Example 3 — Continuity Check

Is \(h(x)\) continuous at \(x=1\)?

\[ h(x)= \begin{cases} 2x & x < 1 \\ 5 & x \ge 1 \end{cases} \]

Left-hand value: \(2(1)=2\)
Right-hand value: \(5\)
Not equal → jump discontinuity.

WarningCommon Mistakes
  • Plugging into the wrong piece by ignoring the inequality.
  • Forgetting open vs. closed circles when graphing.
  • Trying to use both rules at the boundary.
  • Assuming all piecewise functions are continuous (many are not!).
  • Not rewriting answers clearly after evaluating.

Practice Problems

  1. Evaluate \(f(0)\):
    \[ f(x)= \begin{cases} x+3 & x < 0 \\ x^2 & x \ge 0 \end{cases} \]

  2. Evaluate \(g(4)\):
    \[ g(x)= \begin{cases} -x & x < 2 \\ 3x - 5 & x \ge 2 \end{cases} \]

  3. Determine if the function is continuous at \(x=2\):
    \[ h(x)= \begin{cases} x^2 - 4 & x < 2 \\ 0 & x = 2 \\ x - 1 & x > 2 \end{cases} \]

  4. Describe the graph of:
    \[ p(x)= \begin{cases} 5 & x \le 1 \\ -x+2 & x > 1 \end{cases} \]

1.
Use \(x^2\) for \(x=0\):
\[ f(0)=0 \]


2.
Use \(3x - 5\):
\[ g(4)=12 - 5 = 7 \]


3.
Left-hand: \(2^2 - 4 = 0\)
Right-hand: \(2 - 1 = 1\)
Middle value: \(0\)
Left = middle but middle \(\ne\) right → not continuous.


4.
Horizontal line at \(5\) up to \(x=1\) (closed).
Downward line \(-x+2\) for \(x>1\) with open circle at the breakpoint.

Summary

  • Piecewise functions use different rules on different domain intervals.
  • Evaluate by choosing the correct branch.
  • Graph using open/closed endpoints.
  • Continuity is checked by comparing left and right values at boundaries.
  • Always check which inequality includes your input.
  • Open circle: \(<\) or \(>\); closed: \(\le\) or \(\ge\).
  • Evaluate both sides of boundaries when testing continuity.
  • Draw mini-tables for each piece when graphing.