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.

The Formula

f(x)={f1(x)if xD1f2(x)if xD2f(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)={xif x0xif x<0f(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)={expr1if condition1expr2if condition2f(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)={f1(x)xD1f2(x)xD2f(x) = \begin{cases} f_1(x) & x \in D_1 \\ f_2(x) & x \in D_2 \\ \vdots \end{cases} where D1D2=Dom(f)D_1 \cup D_2 \cup \cdots = \text{Dom}(f) and DiDj=D_i \cap D_j = \emptyset for iji \neq j

Worked Examples

Example 1

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

Answer

f(3)=9,  f(0)=1,  f(4)=9f(-3)=9,\; f(0)=1,\; f(4)=9

First step

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

Full solution

  1. 2
    For x=0x = 0: since 000 \geq 0, use f(x)=2x+1f(x) = 2x+1. So f(0)=2(0)+1=1f(0) = 2(0)+1 = 1.
  2. 3
    For x=4x = 4: since 404 \geq 0, use f(x)=2x+1f(x) = 2x+1. So f(4)=2(4)+1=9f(4) = 2(4)+1 = 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)={x+1x<23x=22x1x>2f(x) = \begin{cases} x + 1 & x < 2 \\ 3 & x = 2 \\ 2x - 1 & x > 2 \end{cases} is continuous at x=2x = 2.

Example 3

medium
Find the value of aa that makes f(x)={ax+1x2x21x>2f(x) = \begin{cases} ax + 1 & x \le 2 \\ x^2 - 1 & x > 2 \end{cases} continuous at x=2x = 2.

Common Mistakes

  • Evaluating with the wrong piece - first locate which interval the input falls in, then use only that formula.
  • Ignoring the endpoint inequality - \le versus << decides which piece owns a boundary value.
  • Letting intervals overlap - each input must belong to exactly one piece, or it is not a function.

Why This Formula Matters

Piecewise functions model the real world's threshold rules — phone-plan overages, tax brackets, parking rates — that no single formula captures. The whole answer hinges on first deciding which piece your input lands in. Recognizing it by "Does the formula used depend on which interval the input falls into?" — rather than by familiar numbers — is what lets a student tell it apart from single-formula function and step function and absolute value function in a mixed problem set.

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)={expr1if condition1expr2if condition2f(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 the real world's threshold rules — phone-plan overages, tax brackets, parking rates — that no single formula captures. The whole answer hinges on first deciding which piece your input lands in. Recognizing it by "Does the formula used depend on which interval the input falls into?" — rather than by familiar numbers — is what lets a student tell it apart from single-formula function and step function and absolute value function in a mixed problem set.

What do students get wrong about Piecewise Function?

The procedure for piecewise function is the easy part; the trap is evaluating with the wrong piece. Asking "Does the formula used depend on which interval the input falls into?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

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 →