Canadian flagMath101 · Independent Ontario learning libraryCreated and edited by Kamran
AlgebraGrades 9–123 min read

Piecewise Functions

A piecewise function uses different formulas on different parts of its domain. The input condition selects exactly which rule to apply.

Cheat sheet
Piecewise functions model tax brackets, rates, shipping costs, control systems, and any process whose rule changes across thresholds.

Intuition and core definition

A piecewise function uses different formulas on different parts of its domain. The input condition selects exactly which rule to apply. Endpoint symbols prevent ambiguity: a well-defined function cannot assign two different outputs to the same included input.

Notation, language, and conditions

$f(x)=\begin{cases}x+2,&x<1\\x^2,&x\ge1\end{cases}$ pairs each formula with a condition. Open and closed endpoints on a graph correspond to strict and inclusive inequalities. The formula’s own restrictions also apply within its stated interval.

Why this idea matters

A piecewise function assigns formulas to stated input regions, so boundary symbols are as important as the formulas themselves.

A dependable method

  1. Locate the requested input on the condition intervals.
  2. Select only the rule whose condition includes that input.
  3. Substitute and evaluate using that rule.
  4. For a graph, draw each formula only over its assigned interval and mark endpoints open or closed.
  5. Check that domain pieces cover intended inputs without conflicting overlaps.

Worked example

Representations and interpretation

A piecewise graph is assembled from restricted pieces of familiar graphs. Tables should include values near and at boundaries. Open and filled points make a potential jump or connection visible without changing the interval rules.

Reasoning about variations

A formula may be continuous at a boundary even when written piecewise, or may jump. For continuity at $x=a$, the left behaviour, right behaviour, and included function value must agree; matching visual endpoints is not automatic.

Common mistakes

How to check your work

  • Substitute boundary values into every applicable rule and inspect inclusion.
  • Compare the symbolic conditions with open/closed graph endpoints.
  • Build a small input-output table on both sides of each break.

Practice

  1. For $f(x)=\begin{cases}x+4,&x<2\\3x,&x\ge2\end{cases}$, find $f(2)$.
  2. Which endpoint marker represents $x<5$ at $5$?
  3. Can two pieces include the same input and give different outputs in a function?

Answers and brief solutions

Show answers
  1. $6$ $2$ belongs to the second condition, so $3(2)=6$.
  2. Open point A strict inequality excludes the boundary.
  3. No That input would have two outputs, violating the function definition.

Synthesis and transfer

A shipping charge with one rate below a weight threshold and another above it becomes piecewise; evaluating at the threshold tests which branch owns equality.

Suppose shipping is $8$ dollars for $0<w\le2$ kg and $8+3(w-2)$ dollars for $w>2$. At $w=2$, only the first branch applies, while values just above two use the second. Both formulas approach $8$ at the boundary, so this model is continuous even though its rate changes. Changing the second formula to begin at $10$ would create a jump. A graph should mark open and closed endpoints accordingly, and a table should never assign two outputs to the same allowed input. Piecewise definitions encode policy decisions as well as algebra, making boundary ownership essential.

Teaching and accessibility note

Check your understanding

Try it yourself

Hints are part of learning. Open one whenever it makes the next step feel possible.

1 practice question
Question 1Evaluate a piecewise function · Gentle

For $f(x)=\begin{cases}x+4,&x<2\\3x,&x\ge2\end{cases}$, find $f(2)$.

End of lesson

Nice work making it this far.

Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.

Lesson complete

That one is yours now.

Piecewise Functions is saved to My Learning. Take the win—you earned it.

1Your Math101 collectionlesson completed
Search 464 published lessons, 123 answer guides, courses, and learning tools.
Your experience

Settings

Ontario math tutoringWork with KamranBook ↗