Mathematics.

functions

Piecewise Functions

Algebra II20 minDifficulty3 out of 10

You should know: functions

Overview

A piecewise function is defined by different formulas on different parts of its domain, stitched together into a single function. Common real-world examples — tax brackets, shipping rates by weight, absolute value — all change their rule depending on which interval the input falls into.

Formal Definition

Definition

A piecewise function assigns a different sub-formula to each of several non-overlapping domain intervals:

f(x)={f1(x)xI1f2(x)xI2f(x) = \begin{cases} f_1(x) & x \in I_1 \\ f_2(x) & x \in I_2 \\ \vdots \end{cases}

Each interval Iₖ is disjoint from the others, together covering the whole domain

General piecewise definition

Properties

Continuity at boundaries

f is continuous at a boundary point a    limxaf(x)=limxa+f(x)=f(a)f \text{ is continuous at a boundary point } a \iff \lim_{x\to a^-}f(x) = \lim_{x\to a^+}f(x) = f(a)

Absolute value as piecewise

x={xx0xx<0|x| = \begin{cases} x & x \geq 0 \\ -x & x < 0 \end{cases}

Worked Examples

  1. x=-2 is less than 0, so use the first rule: x².

    f(2)=(2)2=4f(-2) = (-2)^2 = 4
  2. x=3 is at least 0, so use the second rule: 2x+1.

    f(3)=2(3)+1=7f(3) = 2(3)+1 = 7

Answer: f(-2) = 4, f(3) = 7

Practice Problems

Difficulty 3/10

Determine whether f(x) = {x+1 if x<2; 5 if x≥2} is continuous at x=2.

Common Mistakes

Common Mistake

Using the wrong sub-formula because of a mistake reading the inequality (e.g. using ≤ vs < at a boundary point).

Always check exactly which interval an input belongs to, paying close attention to whether the boundary itself is included (≤/≥) or excluded (</>) in each piece — this determines which single formula applies at that exact point.

Summary

  • A piecewise function uses different formulas on different, non-overlapping parts of its domain.
  • To evaluate f(a), first determine which interval a belongs to, then apply that piece's formula only.
  • Continuity at a boundary point requires the left and right pieces to meet at the same value.
  • Absolute value, tax brackets, and step-based pricing are everyday piecewise functions.

References