Tutorials › Calculus I › Continuity at Piecewise-Defined Boundaries

Continuity and the Intermediate Value Theorem · Tutorial 266 of 1495

Continuity at Piecewise-Defined Boundaries

Use the formulas on either side of a boundary to find the one-sided limits, and compare them with the function’s actual value there.

Beginner 9 min read

What You'll Learn

  • Identify the boundary input where a piecewise formula changes.
  • Find left- and right-hand limits using the formula valid on each side.
  • Determine the function’s actual value from the branch that includes the boundary.
  • Apply the three-condition test for continuity at the boundary.
  • Recognize why evaluating only one branch can give the wrong conclusion.

Why Piecewise Boundaries Need a Careful Check

A piecewise-defined function may use one formula to the left of an input and another formula to its right. Away from the point where the rule changes, evaluating the function may be routine. At the boundary, however, the formulas on the two sides and the rule assigning the value at the boundary may not agree.

To test continuity there, keep three quantities distinct: the limit approached from the left, the limit approached from the right, and the value the function actually takes at the boundary. A function is continuous at the boundary only when all three agree.

Key idea: At a piecewise boundary, use the left-hand formula to find the left-hand limit, the right-hand formula to find the right-hand limit, and the branch that includes the boundary to find the function value.

The Continuity Test at a Boundary

Let \(c\) be a boundary where a function has one formula for inputs less than \(c\) and another for inputs greater than \(c\). The value at \(c\) may be specified by either branch, or by a separate case. The function is continuous at \(c\) if its two-sided limit at \(c\) exists and equals its value there.

For a piecewise boundary, the two-sided limit exists precisely when the left-hand and right-hand limits both exist as finite numbers and are equal. Thus the continuity test becomes three comparisons:

$$ \lim_{x\to c^-}f(x) = \lim_{x\to c^+}f(x) = f(c). $$

Here, \(x\to c^-\) means that \(x\) approaches \(c\) through values less than \(c\), and \(x\to c^+\) means that \(x\) approaches \(c\) through values greater than \(c\). The notation \(f(c)\) means the function’s assigned value at the boundary itself; it is not a limit.

Definition: A function \(f\) is continuous at \(c\) when \(f(c)\) is defined, the limit \(\lim_{x\to c} f(x)\) exists, and \(\lim_{x\to c} f(x)=f(c)\). At a piecewise boundary, this is equivalent to requiring that both one-sided limits exist and that $$ \lim_{x\to c^-}f(x)=\lim_{x\to c^+}f(x)=f(c). $$

In precise terms, \(\lim_{x\to c^-}f(x)=L\) means that for every \(\varepsilon>0\), there is a \(\delta>0\) such that \(0<c-x<\delta\) implies \(|f(x)-L|<\varepsilon\). For the right-hand limit, the corresponding condition is \(0<x-c<\delta\). The key difference is which side of \(c\) the input comes from.

A Reliable Procedure

Write down each quantity separately before deciding whether the function is continuous. This helps prevent a common mix-up: substituting \(c\) into a formula to calculate a limit does not automatically tell you what value the piecewise function assigns at \(c\).

1
Locate the boundary.
Identify the input \(c\) where the rule changes.
2
Find the left-hand limit.
Use the formula that applies for inputs just less than \(c\).
3
Find the right-hand limit.
Use the formula that applies for inputs just greater than \(c\).
4
Find the boundary value.
Read the piecewise definition at \(x=c\), paying attention to which inequality includes equality.
5
Compare all three results.
The function is continuous at \(c\) exactly when the two one-sided limits and \(f(c)\) are equal finite numbers.

For polynomial formulas, the one-sided limit can be evaluated by substitution into the formula used on that side. This follows from the standard limit rule for polynomials. Even when substitution is valid for both limits, still calculate \(f(c)\) separately from the piecewise definition.

Worked Examples

Worked Example: A Boundary Where All Three Values Agree

Consider $$ f(x)= \begin{cases} x^2, & x<2,\\ 3x-2, & x\ge 2. \end{cases} $$ Test continuity at \(x=2\).

For the left-hand limit, use \(x^2\), the formula for \(x<2\): $$ \lim_{x\to 2^-}f(x)=\lim_{x\to 2^-}x^2=2^2=4. $$

For the right-hand limit, use \(3x-2\), the formula for \(x\ge 2\), which also applies to inputs just greater than 2: $$ \lim_{x\to 2^+}f(x)=\lim_{x\to 2^+}(3x-2)=3(2)-2=6-2=4. $$

Since the second branch includes equality, the actual boundary value is $$ f(2)=3(2)-2=6-2=4. $$ Therefore, $$ \lim_{x\to 2^-}f(x)=\lim_{x\to 2^+}f(x)=f(2)=4. $$ The function is continuous at \(x=2\). As a check, the left formula approaches 4, the right formula approaches 4, and evaluating the branch assigned at 2 gives 4.

Worked Example: Unequal One-Sided Limits

Consider $$ g(x)= \begin{cases} x+2, & x<0,\\ x^2+1, & x\ge 0. \end{cases} $$ Test continuity at \(x=0\).

For inputs less than 0, use \(x+2\): $$ \lim_{x\to 0^-}g(x)=\lim_{x\to 0^-}(x+2)=0+2=2. $$

For inputs greater than 0, use \(x^2+1\): $$ \lim_{x\to 0^+}g(x)=\lim_{x\to 0^+}(x^2+1)=0^2+1=1. $$

The branch \(x\ge 0\) includes \(0\), so $$ g(0)=0^2+1=1. $$ The one-sided limits are unequal: \(2\ne 1\). Therefore, the two-sided limit does not exist, and \(g\) is not continuous at \(0\). The boundary value agrees with the right-hand limit, but that alone is not enough: the left-hand limit must agree as well.

Worked Example: Matching Limits but a Different Boundary Value

Consider $$ h(x)= \begin{cases} x^2, & x<0,\\ 4, & x=0,\\ x, & x>0. \end{cases} $$ Test continuity at \(x=0\).

Approaching from the left, use \(x^2\): $$ \lim_{x\to 0^-}h(x)=\lim_{x\to 0^-}x^2=0^2=0. $$

Approaching from the right, use \(x\): $$ \lim_{x\to 0^+}h(x)=\lim_{x\to 0^+}x=0. $$

The separate middle case assigns the value \(h(0)=4\). Thus the one-sided limits agree with each other, but they do not equal the function value: $$ \lim_{x\to 0^-}h(x)=\lim_{x\to 0^+}h(x)=0 \qquad\text{while}\qquad h(0)=4. $$ The function is not continuous at \(0\). This example shows why comparing only the two limits is insufficient; the assigned value must be checked too.

Why the Three-Value Test Works

The test follows from the definition of a two-sided limit and continuity. A two-sided limit at \(c\) exists with value \(L\) exactly when both one-sided limits exist with that same value \(L\). Continuity then requires that this limit equal \(f(c)\).

Theorem: Suppose the left-hand and right-hand limits of \(f\) at \(c\) exist as finite numbers. Then \(f\) is continuous at \(c\) if and only if both one-sided limits equal \(f(c)\).

To see why, first suppose both one-sided limits equal \(f(c)\), and write their common value as \(L=f(c)\). Given any \(\varepsilon>0\), the left-hand limit provides a positive distance \(\delta_-\) such that \(0<c-x<\delta_-\) implies \(|f(x)-L|<\varepsilon\). The right-hand limit provides a positive distance \(\delta_+\) such that \(0<x-c<\delta_+\) implies the same inequality. Choose \(\delta\) to be the smaller of \(\delta_-\) and \(\delta_+\). Then, whenever \(0<|x-c|<\delta\), \(x\) lies on one side or the other, and the corresponding one-sided condition gives \(|f(x)-L|<\varepsilon\). Hence \(\lim_{x\to c}f(x)=L=f(c)\), so \(f\) is continuous at \(c\).

Conversely, suppose \(f\) is continuous at \(c\). By definition, for every \(\varepsilon>0\), inputs sufficiently close to \(c\) satisfy \(|f(x)-f(c)|<\varepsilon\). Restricting those inputs to \(x<c\) gives the left-hand limit \(f(c)\); restricting them to \(x>c\) gives the right-hand limit \(f(c)\). Thus both one-sided limits equal \(f(c)\), as required. This proves the equivalence.

A Common Boundary-Value Mistake

A frequent error is to assume that the formula written first in a piecewise definition must also determine the value at the boundary. The inequality signs decide which formula applies there. A strict inequality such as \(x<1\) excludes \(1\); an inequality such as \(x\ge 1\) includes it.

Worked Example: Do Not Use an Excluded Branch for the Boundary Value

Let $$ p(x)= \begin{cases} x+1, & x<1,\\ 2, & x\ge 1. \end{cases} $$ Check continuity at \(x=1\).

The left-hand limit uses \(x+1\): $$ \lim_{x\to 1^-}p(x)=1+1=2. $$ The right-hand limit uses the constant formula: $$ \lim_{x\to 1^+}p(x)=2. $$ The boundary belongs to the second branch, so \(p(1)=2\). All three values are 2, and \(p\) is continuous at 1.

Incorrect calculation: Substituting \(1\) into the first branch and claiming \(p(1)=1+1=2\) uses a formula whose condition \(x<1\) is false at \(x=1\). The numerical answer happens to match here, but the reasoning is invalid. The correct value comes from the branch with \(x\ge 1\): \(p(1)=2\). A coincidentally correct number does not make an incorrect branch choice reliable.

What to Keep Separate

When checking a boundary, it is useful to write the results in three separate lines before drawing a conclusion. The limits answer what the function values approach from either side; \(f(c)\) answers what value the definition assigns at the boundary. Neither kind of quantity can replace the other.

QuantityHow to obtain itQuestion it answers
\(\lim_{x\to c^-}f(x)\)Use the formula valid to the left of \(c\).What value is approached from below?
\(\lim_{x\to c^+}f(x)\)Use the formula valid to the right of \(c\).What value is approached from above?
\(f(c)\)Use the case that includes \(c\), or the separate case at \(c\).What value is assigned at the boundary?

The test matters because piecewise functions are defined by rules that may interact differently at and near a boundary. Checking all three quantities establishes whether the function behaves continuously at that point, rather than relying on the appearance of a formula or on a graph alone.

Check Your Understanding

For each question, identify the formula that applies on the relevant side before calculating.

  1. For a piecewise function with boundary \(c\), which formula determines the left-hand limit?
  2. What does the notation \(x\to c^+\) mean?
  3. If both one-sided limits equal 5 but \(f(c)=3\), is the function continuous at \(c\)? Explain using the three-value test.
  4. If \(f(c)\) agrees with the right-hand limit but the left-hand limit is different, can \(f\) be continuous at \(c\)? Why?
  5. For a branch defined only when \(x<c\), does that branch determine \(f(c)\)? What should you check instead?

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