Piecewise Function Formula

The Formula

f(x) = \begin{cases} f_1(x) & \text{if } x \in D_1 \\ f_2(x) & \text{if } x \in D_2 \end{cases}

When to use: A piecewise function is like a rulebook: look up which rule applies to your input value, then use only that rule to compute the output.

Quick Example

f(x) = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases} This is the absolute value function.

Notation

f(x) = \begin{cases} \text{expr}_1 & \text{if condition}_1 \\ \text{expr}_2 & \text{if condition}_2 \end{cases} uses brace notation to define each piece.

What This Formula Means

A piecewise function is defined by different formulas on different non-overlapping intervals of its domain, with the applicable formula determined by the input value.

A piecewise function is like a rulebook: look up which rule applies to your input value, then use only that rule to compute the output.

Formal View

f(x) = \begin{cases} f_1(x) & x \in D_1 \\ f_2(x) & x \in D_2 \\ \vdots \end{cases} where D_1 \cup D_2 \cup \cdots = \text{Dom}(f) and D_i \cap D_j = \emptyset for i \neq j

Worked Examples

Example 1

easy
Evaluate f(x) = \begin{cases} x^2 & x < 0 \\ 2x + 1 & x \geq 0 \end{cases} at x = -3, x = 0, and x = 4.

Solution

  1. 1
    For x = -3: since -3 < 0, use f(x) = x^2. So f(-3) = (-3)^2 = 9.
  2. 2
    For x = 0: since 0 \geq 0, use f(x) = 2x+1. So f(0) = 2(0)+1 = 1.
  3. 3
    For x = 4: since 4 \geq 0, use f(x) = 2x+1. So f(4) = 2(4)+1 = 9.

Answer

f(-3)=9,\; f(0)=1,\; f(4)=9
In a piecewise function, the domain is partitioned into intervals, each with its own rule. The key skill is identifying which interval the input belongs to before applying the corresponding formula.

Example 2

medium
Determine whether f(x) = \begin{cases} x + 1 & x < 2 \\ 3 & x = 2 \\ 2x - 1 & x > 2 \end{cases} is continuous at x = 2.

Common Mistakes

  • Evaluating the wrong piece โ€” check which interval your x-value falls in before plugging into a formula
  • Forgetting to check continuity at boundary points โ€” the pieces may not connect, creating a jump or gap
  • Including a value in two intervals โ€” each x must belong to exactly one piece; intervals should not overlap

Why This Formula Matters

Piecewise functions model any situation with different regimes โ€” tax brackets, shipping rates, and absolute value are all piecewise in nature.

Frequently Asked Questions

What is the Piecewise Function formula?

A piecewise function is defined by different formulas on different non-overlapping intervals of its domain, with the applicable formula determined by the input value.

How do you use the Piecewise Function formula?

A piecewise function is like a rulebook: look up which rule applies to your input value, then use only that rule to compute the output.

What do the symbols mean in the Piecewise Function formula?

f(x) = \begin{cases} \text{expr}_1 & \text{if condition}_1 \\ \text{expr}_2 & \text{if condition}_2 \end{cases} uses brace notation to define each piece.

Why is the Piecewise Function formula important in Math?

Piecewise functions model any situation with different regimes โ€” tax brackets, shipping rates, and absolute value are all piecewise in nature.

What do students get wrong about Piecewise Function?

Always check which piece to use before computing โ€” substituting into the wrong formula gives the wrong answer even if the algebra is perfect.

What should I learn before the Piecewise Function formula?

Before studying the Piecewise Function formula, you should understand: function definition, domain.

Want the Full Guide?

This formula is covered in depth in our complete guide:

Functions and Graphs: Complete Foundations for Algebra and Calculus โ†’