Tutorials › Calculus I › Piecewise Function Notation

Function Notation and Representations · Tutorial 20 of 1495

Piecewise Function Notation

Learn to match each formula in a piecewise definition to its input condition and present those pairings clearly using inequalities or intervals.

Beginner 9 min read

What You'll Learn

  • Recognize the formula-and-condition structure of piecewise notation
  • Match each case to the inputs that satisfy its condition
  • Write cases using inequalities or interval notation
  • Check whether case conditions cover the stated domain without overlap
  • Spot and correct a formula paired with the wrong condition

Introduction

A function does not have to use one formula for every input. Sometimes its rule changes according to which condition the input satisfies. Piecewise notation displays these different rules together, with each formula paired to the inputs where it applies.

The key is to read each formula and its condition as one matched case. The condition tells you which inputs belong to that case; the formula tells you the rule used there. Keeping those two parts together makes a piecewise definition clear and precise.

The Structure of a Piecewise Definition

A piecewise definition lists formulas in a column, with a corresponding condition beside each one. The braces indicate that the cases together define the function.

$$ f(x)= \begin{cases} \text{first formula}, & \text{first condition},\\ \text{second formula}, & \text{second condition},\\ \vdots & \vdots \end{cases} $$

Read across each row: the formula and condition on that row belong together. For example, in \(f(x)=2x+1\) if \(x<3\), the condition \(x<3\) identifies the inputs for which the formula \(2x+1\) is the rule.

Definition: A piecewise definition specifies a function by giving a formula for each of several input conditions. Each formula applies to the inputs that satisfy its paired condition.

The condition may be written as an inequality, such as \(x<3\) or \(x\geq 3\), or using interval notation, such as \(x\in(-\infty,3)\) or \(x\in[3,\infty)\). These forms describe the same sets of real inputs. In particular, \(x\in[a,b)\) means \(a\leq x<b\), while \(x\in(a,b]\) means \(a<x\leq b\).

Conditions do not need to look alike. One case might use an inequality and another an interval. What matters is that each condition is clearly attached to its formula.

Writing the Cases Clearly

When writing a piecewise definition, put the formulas in one column and their conditions in a matching column. The order of the cases is a matter of presentation, but the formula-condition pairings must stay intact. If the function is defined on a domain \(D\), the cases should account for every input in \(D\), and ordinarily exactly one case should apply to each such input.

For a function whose domain is all real numbers, conditions such as \(x<3\) and \(x\geq 3\) cover the entire domain: together they include every real input, and no input satisfies both conditions. For a restricted domain, the cases need cover only that stated domain. For instance, a definition on \([-2,5]\) need not include inputs outside that interval.

Worked Example: Writing Cases with Inequalities

Worked Example: Writing Cases with Inequalities

Write the following rule in piecewise notation: use \(2x+1\) for inputs less than \(3\), and use \(x^2-4\) for inputs greater than or equal to \(3\). The domain is \(\mathbb{R}\).

Step 1: Record the first formula and its condition. The first formula is \(2x+1\), and its condition is \(x<3\).

Step 2: Record the second formula and its condition. The second formula is \(x^2-4\), and its condition is \(x\geq 3\).

Step 3: Place each formula beside its matching condition.

$$ f(x)= \begin{cases} 2x+1, & x<3,\\ x^2-4, & x\geq 3. \end{cases} $$

Check: The two conditions describe \((-\infty,3)\) and \([3,\infty)\). Their union is \(\mathbb{R}\), and their intersection is empty. Thus every real input belongs to exactly one case, and the written definition covers the stated domain without a gap or overlap.

Writing Cases with Interval Conditions

An interval condition can be placed directly beside its formula. This is often a compact way to describe a range of inputs, especially when an endpoint is included on one side and excluded on the other.

Worked Example: Using Intervals to Write the Cases

Let \(g\) have domain \([-2,5]\). Its rule is \(3-x\) for inputs from \(-2\) up to, but not including, \(1\), and \(4\) for inputs from \(1\) through \(5\). Write the definition using interval notation.

Step 1: Convert the first input description to an interval. “From \(-2\) up to, but not including, \(1\)” means that \(-2\) is included and \(1\) is excluded. The condition is \(x\in[-2,1)\).

Step 2: Convert the second input description to an interval. “From \(1\) through \(5\)” includes both endpoints, so the condition is \(x\in[1,5]\).

Step 3: Match each condition to its formula. The first interval stays with \(3-x\), and the second stays with \(4\):

$$ g(x)= \begin{cases} 3-x, & x\in[-2,1),\\ 4, & x\in[1,5]. \end{cases} $$

Check: The first interval covers the part of the domain from \(-2\) to \(1\), excluding \(1\); the second starts at \(1\) and continues through \(5\). Their union is \([-2,5]\), and they have no input in common. The cases therefore cover exactly the stated domain, with each formula attached to its intended interval.

Reading an Existing Piecewise Definition

To read a piecewise definition, do not scan only the formulas or only the conditions. Read across each case, pairing the formula with its condition. Then identify the part of the domain each condition describes.

Worked Example: Reading Formula-Condition Pairs

Consider the function \(h\) defined on \(\mathbb{R}\) by the following piecewise rule. Describe which formula belongs to each set of inputs.

$$ h(x)= \begin{cases} 5-x, & x\in(-\infty,0),\\ x^2+1, & x\in[0,2],\\ 7, & x\in(2,\infty). \end{cases} $$

Step 1: Read the first row as a pair. The condition \(x\in(-\infty,0)\) means \(x<0\). On those inputs, the formula is \(5-x\).

Step 2: Read the second row as a pair. The condition \(x\in[0,2]\) means \(0\leq x\leq 2\). On those inputs, the formula is \(x^2+1\).

Step 3: Read the third row as a pair. The condition \(x\in(2,\infty)\) means \(x>2\). On those inputs, the formula is the constant \(7\).

Check: The three intervals are \((-\infty,0)\), \([0,2]\), and \((2,\infty)\). Together they cover \(\mathbb{R}\), and no input is in more than one of them. The description accounts for the full domain and preserves all three formula-condition pairings.

Why the Conditions Matter

The conditions are not extra decoration. They determine which formula is part of the function’s rule for a given input. Without them, a list of formulas alone would not tell you how to assign a rule to inputs.

There is a simple reason disjoint, exhaustive conditions make a piecewise definition a function. A function assigns exactly one output to each input in its domain. If the conditions cover the domain, every input has a case. If no input satisfies two different case conditions, every input has just one selected formula. That formula then specifies one output.

Why the standard condition applies: Suppose the conditions divide a stated domain \(D\) into sets \(C_1,\dots,C_n\), so that every \(x\in D\) belongs to exactly one \(C_i\). Assign formula \(F_i(x)\) to condition \(C_i\). For any \(x\in D\), exactly one condition selects exactly one formula, and that formula has one value. Thus the rule assigns exactly one output to every input in \(D\), as required for a function.

If a condition is missing some inputs in the stated domain, those inputs have no specified formula. If conditions overlap, an input may appear to have more than one applicable formula. A definition must make its intended domain and case assignments clear.

A Common Pairing Mistake

A frequent mistake is to copy the right formulas and the right conditions but attach each formula to the wrong condition. Consider the intended rule that uses \(x+2\) when \(x<0\), and \(x^2\) when \(x\geq 0\).

$$ \text{Intended: }\quad f(x)= \begin{cases} x+2, & x<0,\\ x^2, & x\geq 0. \end{cases} $$

A mistaken arrangement might reverse the conditions while leaving the formulas in place:

$$ \text{Incorrect: }\quad f(x)= \begin{cases} x+2, & x\geq 0,\\ x^2, & x<0. \end{cases} $$

This is not the same rule. For example, at \(x=-2\), the intended condition \(x<0\) selects \(x+2\), giving \((-2)+2=0\). The incorrect arrangement selects \(x^2\), giving \((-2)^2=4\). At \(x=3\), the intended condition \(x\geq 0\) selects \(x^2\), giving \(3^2=9\). The incorrect arrangement selects \(x+2\), giving \(3+2=5\).

Correction: Keep each formula beside the condition that describes where it applies. A useful check is to read each row aloud as one sentence: “Use this formula when this condition holds.”

Keeping a Definition Unambiguous

Before treating a piecewise rule as a complete function definition, check three things:

  • Pairing: Each formula is visibly matched to its own condition.
  • Coverage: The conditions account for every input in the stated domain.
  • Unambiguity: Exactly one case applies to each input in that domain.

These checks are about the structure of the definition, not about whether the formulas happen to produce similar outputs. Even if two formulas agree for some inputs, their conditions still communicate which rule is intended on each part of the domain.

Piecewise notation is useful whenever a function follows different rules on different input sets. Its central convention is straightforward: read each formula together with its condition, and preserve that pairing when you write or interpret the definition.

Check Your Understanding

Use the formula-condition pairings and domain coverage ideas from this tutorial to answer these questions.

  1. In a piecewise definition, what information does the condition beside a formula provide?
  2. Rewrite the condition \(x\in(-\infty,4]\) as an inequality.
  3. Write a piecewise definition for a function that uses \(x-1\) when \(x<2\) and \(3x\) when \(x\geq 2\), on domain \(\mathbb{R}\).
  4. Do the conditions \(x\in[-3,1)\) and \(x\in[1,4]\) cover the domain \([-3,4]\) without overlap?
  5. What can go wrong if formulas are paired with the wrong conditions?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon