Tutorials › Calculus I › Evaluating Piecewise Functions at Boundary Inputs

Function Notation and Representations · Tutorial 21 of 1495

Evaluating Piecewise Functions at Boundary Inputs

Practice selecting the correct piece at inputs on either side of a boundary and at the boundary itself.

Beginner 9 min read

What You'll Learn

  • Identify the condition that applies to a given input.
  • Distinguish strict inequalities from inclusive inequalities at the boundary.
  • Evaluate a piecewise function just below, exactly at, and just above a boundary.
  • Handle definitions that assign the boundary using a separate equality case.
  • Check that the selected condition and formula match the input.

Why Boundary Inputs Need Care

A piecewise function uses different rules on different parts of its domain. Evaluating it at an ordinary input usually means identifying which rule applies and substituting the input into that rule. The boundary between cases requires extra care: an input equal to the boundary belongs only to the case whose condition includes equality.

For example, the conditions \(x<3\) and \(x\ge 3\) divide the real number line at \(3\). An input just below \(3\) satisfies the first condition, while \(3\) and inputs just above it satisfy the second. The formulas themselves do not decide which case applies; the stated conditions do.

Key idea: To evaluate a piecewise function, first test the input against the conditions. Then use the formula attached to the condition it satisfies. At a boundary, follow the inequality symbols exactly.

Reading the Conditions

A condition such as \(x< c\) includes values smaller than \(c\), but excludes \(c\) itself. A condition such as \(x\le c\) includes both values smaller than \(c\) and \(c\). Similarly, \(x>c\) excludes \(c\), whereas \(x\ge c\) includes it.

In a two-case split using conditions such as \(x<c\) and \(x\ge c\), or \(x\le c\) and \(x>c\), equality is assigned by the condition using \(\le\) or \(\ge\). Equality can also be assigned explicitly by a condition such as \(x=c\), as in a definition with three cases. Do not assume that every piecewise definition uses the same arrangement.

ConditionDoes it include \(x=c\)?
\(x<c\)No
\(x\le c\)Yes
\(x>c\)No
\(x\ge c\)Yes
\(x=c\)Yes, only at the boundary

To say that an input is just below or just above a boundary means that it is smaller or larger, respectively, while remaining near that boundary. The exact distance is not what determines the case. The comparison with the boundary does.

A Reliable Evaluation Procedure

For a piecewise function with boundary \(c\), a useful approach is to evaluate a selected input on each relevant side and at the boundary itself. Keep the condition check separate from the substitution so that a familiar-looking formula does not tempt you into using the wrong case.

1
Locate the boundary.
Identify the value at which a condition changes, such as \(x=3\).
2
Test the input.
Determine which stated inequality or equality the input satisfies.
3
Select that case's formula.
Do not choose a formula based only on whether the input seems close to the boundary.
4
Substitute and calculate.
Evaluate the selected expression using the input.
5
Check the choice.
Confirm that the input satisfies the condition attached to the formula you used.

Worked Examples

Worked Example: Inputs Below, At, and Above a Boundary

Let \(f\) be defined by

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

Evaluate \(f(2.9)\), \(f(3)\), and \(f(3.1)\).

For \(x=2.9\), test the first condition: \(2.9<3\), which is true. Use \(2x+1\):

$$ f(2.9)=2(2.9)+1=5.8+1=6.8. $$

For \(x=3\), the first condition \(3<3\) is false. The second condition \(3\ge 3\) is true, so use \(x^2-4\):

$$ f(3)=3^2-4=9-4=5. $$

For \(x=3.1\), \(3.1<3\) is false and \(3.1\ge3\) is true. Therefore,

$$ f(3.1)=(3.1)^2-4=9.61-4=5.61. $$

Check the choices: \(2.9\) belongs to the \(x<3\) case, while \(3\) and \(3.1\) belong to the \(x\ge3\) case. Each value was calculated using the formula attached to its satisfied condition.

Worked Example: Equality Assigned to the First Case

Let \(g\) be defined by

$$ g(x)= \begin{cases} x+5, & x\le -2,\\ x^2, & x>-2. \end{cases} $$

Evaluate \(g(-2.1)\), \(g(-2)\), and \(g(-1.9)\).

For \(x=-2.1\), the condition \(-2.1\le-2\) is true. Thus,

$$ g(-2.1)=-2.1+5=2.9. $$

At the boundary, \(-2\le-2\) is true, while \(-2>-2\) is false. Equality belongs to the first case, so

$$ g(-2)=-2+5=3. $$

For \(x=-1.9\), the condition \(-1.9\le-2\) is false, but \(-1.9>-2\) is true. Therefore,

$$ g(-1.9)=(-1.9)^2=3.61. $$

Check: both \(-2.1\) and \(-2\) satisfy \(x\le-2\), so both use \(x+5\). The input \(-1.9\) satisfies \(x>-2\), so it uses \(x^2\). This example shows why the direction of the inclusive inequality matters: here equality is included in the first case, not the second.

Worked Example: Equality as Its Own Case

A piecewise definition can assign the boundary separately. Let \(h\) be defined by

$$ h(x)= \begin{cases} 3-x, & x<1,\\ 7, & x=1,\\ x+4, & x>1. \end{cases} $$

Evaluate \(h(0.9)\), \(h(1)\), and \(h(1.1)\).

Since \(0.9<1\), use the first formula:

$$ h(0.9)=3-0.9=2.1. $$

For \(x=1\), neither \(1<1\) nor \(1>1\) is true. Instead, the equality condition \(x=1\) applies, giving

$$ h(1)=7. $$

Since \(1.1>1\), use the third formula:

$$ h(1.1)=1.1+4=5.1. $$

Check: \(0.9\) satisfies only the first condition, \(1\) satisfies the explicit equality condition, and \(1.1\) satisfies only the third condition. In particular, it would be incorrect to force the boundary value into either neighboring strict-inequality case.

Why the Condition Check Works

The evaluation method relies on a simple fact about the real numbers. For any real input \(x\) and boundary \(c\), exactly one of the statements \(x<c\), \(x=c\), or \(x>c\) is true. This comparison tells us where \(x\) lies relative to \(c\).

For a two-case split using \(x<c\) and \(x\ge c\), every real \(x\) satisfies exactly one of the two conditions. If \(x<c\), the first condition applies and \(x\ge c\) is false. If \(x\) is not less than \(c\), then \(x\ge c\), so the second condition applies. The two conditions cannot both hold, because \(x<c\) and \(x\ge c\) cannot both be true. In particular, substituting \(x=c\) makes \(x<c\) false and \(x\ge c\) true.

The same reasoning explains a split using \(x\le c\) and \(x>c\): equality satisfies the first condition, and every value above \(c\) satisfies the second. If equality is written as a separate case, the conditions \(x<c\), \(x=c\), and \(x>c\) assign inputs below, at, and above the boundary, respectively. Once the applicable case is identified, evaluation is ordinary substitution into its formula.

Takeaway: A boundary is not an invitation to guess which expression “looks right.” The inequalities and equalities in the definition specify exactly which expression to use.

Common Mistake: Treating a Strict Inequality as Inclusive

Consider the definition of \(f\) in the first example. A common error at \(x=3\) is to use the first formula because it is written first or because it describes values below the boundary. That produces the incorrect calculation

$$ f(3)\ \text{(incorrectly)}=2(3)+1=7. $$

The problem is not the arithmetic: \(2(3)+1\) does equal \(7\). The problem is the condition. The first formula applies only when \(x<3\), and \(3<3\) is false. The second condition includes equality, because \(3\ge3\), so the correct calculation is

$$ f(3)=3^2-4=9-4=5. $$

To correct this kind of mistake, write down the truth of the condition before substituting. “At the boundary, test the symbol” is more reliable than assuming that the boundary belongs to the case on the left or the case on the right.

What to Keep in Mind

When a question asks for values on either side of a boundary and at the boundary, treat each input separately. A value below the boundary may satisfy a strict “less than” condition; the boundary itself does not. An inclusive condition may take equality, or equality may be assigned its own case. A value just above the boundary must satisfy the appropriate greater-than condition.

The formulas can produce equal or different outputs at nearby inputs; that does not change which formula is prescribed. For the purpose of evaluating a piecewise function, the condition check comes first, and the arithmetic comes second. This careful separation is useful whenever function rules depend on ranges of inputs.

Check Your Understanding

For each question, identify the applicable condition before evaluating or explaining your answer.

  1. Suppose \(p(x)=x+2\) for \(x<4\) and \(p(x)=2x\) for \(x\ge4\). Which formula gives \(p(4)\), and what is its value?
  2. For \(q(x)=5-x\) when \(x\le0\), and \(q(x)=x^2+1\) when \(x>0\), evaluate \(q(-0.1)\), \(q(0)\), and \(q(0.1)\).
  3. In a definition with conditions \(x<2\), \(x=2\), and \(x>2\), which condition applies at \(x=2\)?
  4. Explain why using the formula attached to \(x<c\) at \(x=c\) is invalid, even if that formula can be evaluated at \(c\).
  5. For a two-case split using \(x\le c\) and \(x>c\), which case includes the boundary, and how can you verify your choice?

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