Tutorials › AP Calculus › Matching Piecewise Functions for Continuity

Differentiability and Continuity · Tutorial 112 of 999

Matching Piecewise Functions for Continuity

Use one-sided limits and the value assigned at a join to find exactly which parameter choices make a piecewise function continuous there.

Beginner 9 min read

What You'll Learn

  • State the continuity test at a piecewise join using both one-sided limits and the defined function value
  • Find parameter values by equating the limits of adjacent formulas
  • Use the branch containing the join to identify the function value there
  • Distinguish a unique parameter choice from a condition with many solutions
  • Check a proposed match by substituting it into both limits and the function value
  • Identify why matching the two limits alone may not establish continuity

Why Matching at a Join Requires Three Checks

A piecewise function uses different formulas on different parts of its domain. Where the formulas meet, the graph may connect smoothly in value, or it may have a gap or a jump. To make the function continuous at that point, it is not enough to inspect the formulas separately: the values approached from both sides must agree with the value the function is actually assigned at the join.

A parameter in one or both formulas can often be chosen to make this happen. The key is to write the continuity conditions before solving for the parameter. That keeps separate three quantities that are easy to confuse: the limit from the left, the limit from the right, and the function’s defined value at the join.

Key takeaway: At an interior join \(x=c\), continuity requires the left-hand limit and right-hand limit to exist as the same finite number, and that number must equal \(f(c)\).

The Continuity Test at a Piecewise Join

Suppose a function is defined near \(c\) by one formula for \(x<c\) and another for \(x\ge c\):

$$ f(x)= \begin{cases} g(x), & x<c,\\ h(x), & x\ge c. \end{cases} $$

Because the second branch includes \(x=c\), the defined value is \(f(c)=h(c)\), provided \(h(c)\) is defined. The left-hand limit is determined by values of \(g(x)\) for \(x<c\); the right-hand limit is determined by values of \(h(x)\) for \(x>c\). The continuity test is therefore:

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

If the join is assigned to the left branch instead, the same test applies, but the left branch supplies \(f(c)\). If the function gives \(f(c)\) in a separate line, that separately stated value must be used. In every case, the formulas determine the one-sided limits, while the piecewise definition determines the value at the point.

Definition: A function \(f\) is continuous at \(x=c\) if \(f(c)\) is defined, \(\lim_{x\to c}f(x)\) exists as a finite number, and \(\lim_{x\to c}f(x)=f(c)\).

Why These Conditions Are Necessary

For a two-sided limit \(\lim_{x\to c}f(x)\) to exist, the values approached from the left and right must approach the same finite number. When the formulas on those sides are different, this means their one-sided limits must agree. Continuity then adds one more requirement: the common limit must equal the actual value \(f(c)\).

Conversely, if both one-sided limits exist and equal \(f(c)\), then the two-sided limit exists and equals \(f(c)\). This is exactly the definition of continuity at \(c\). Thus the test is both necessary and sufficient, not merely a useful check.

$$ f\text{ is continuous at }c \quad\Longleftrightarrow\quad \lim_{x\to c^-}f(x) = \lim_{x\to c^+}f(x) = f(c). $$

For a piecewise function, evaluate each one-sided limit using the formula that applies on that side. If those formulas have ordinary finite limits at \(c\), substitution into each formula often gives the limits directly. If a formula is not defined at \(c\), that does not automatically prevent its one-sided limit from existing; the limit concerns nearby values, not necessarily the value at the endpoint itself.

A Reliable Method for Finding Parameters

Keep the three continuity quantities visible while working. Then solve the resulting equation or equations. If the branch containing \(c\) has a formula that depends on a parameter, its value at \(c\) must be calculated with that parameter included.

1
Locate the join.
Identify the point \(x=c\) and note which branch includes equality.
2
Find the left-hand limit.
Use the formula valid for \(x<c\) and compute its limit as \(x\to c^-\).
3
Find the right-hand limit.
Use the formula valid for \(x>c\) and compute its limit as \(x\to c^+\).
4
Find the defined value.
Substitute \(c\) into the branch that includes \(c\), or use the separately stated value.
5
Set the quantities equal and check.
Solve the conditions, then substitute the result back into both limits and \(f(c)\).

Worked Examples

Worked Example: Choosing a Parameter for a Two-Branch Join

Find the value of \(a\) that makes \(f\) continuous at \(x=2\):

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

First find the left-hand limit using \(ax+1\):

$$ \lim_{x\to 2^-}f(x) = \lim_{x\to 2^-}(ax+1) = 2a+1. $$

Next find the right-hand limit using \(x^2-1\):

$$ \lim_{x\to 2^+}f(x) = \lim_{x\to 2^+}(x^2-1) = 2^2-1 = 3. $$

Since the \(x\ge 2\) branch includes \(x=2\), the defined function value is

$$ f(2)=2^2-1=3. $$

Continuity requires \(2a+1=3\). Solving gives \(2a=2\), so \(a=1\). Check the result: with \(a=1\), the left-hand limit is \(2(1)+1=3\), the right-hand limit is \(3\), and \(f(2)=3\). All three quantities agree, so \(f\) is continuous at \(x=2\).

Worked Example: Matching Both Sides to a Separately Defined Value

Find the condition on \(a\), \(b\), and \(c\) that makes \(f\) continuous at \(x=0\):

$$ f(x)= \begin{cases} 2x+a, & x<0,\\ c, & x=0,\\ x^2+b, & x>0. \end{cases} $$

On the left, the formula \(2x+a\) gives

$$ \lim_{x\to 0^-}f(x) = \lim_{x\to 0^-}(2x+a) = 2(0)+a = a. $$

On the right, the formula \(x^2+b\) gives

$$ \lim_{x\to 0^+}f(x) = \lim_{x\to 0^+}(x^2+b) = 0^2+b = b. $$

The definition states separately that \(f(0)=c\). Therefore, all three quantities must agree:

$$ a=b=c. $$

This is a condition on the parameters, rather than one unique triple. For example, choose \(a=b=c=4\). Then the left-hand limit is \(4\), the right-hand limit is \(4\), and \(f(0)=4\), confirming continuity. More generally, any common real value for \(a\), \(b\), and \(c\) makes the function continuous at zero.

Worked Example: Using a Simplified One-Sided Limit

Find \(n\) so that the following function is continuous at \(x=1\), given that \(m=3\):

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

For \(x\ne 1\), factor the numerator and simplify the expression in the left branch:

$$ \frac{x^2-1}{x-1} = \frac{(x-1)(x+1)}{x-1} = x+1. $$

This simplification is valid for values in the left branch, where \(x<1\), so \(x\ne 1\). It gives the left-hand limit:

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

The right-hand limit uses \(mx+n\). Since \(m=3\),

$$ \lim_{x\to 1^+}f(x) = \lim_{x\to 1^+}(3x+n) = 3(1)+n = 3+n. $$

The right branch includes \(x=1\), so \(f(1)=3(1)+n=3+n\) as well. Continuity requires \(2=3+n\), giving \(n=-1\). Check: the left-hand limit is \(2\); with \(n=-1\), the right-hand limit and \(f(1)\) are both \(3-1=2\). The three required quantities match.

Common Pitfall: Matching the Limits but Ignoring the Defined Value

Equal one-sided limits are not by themselves enough. The function might be assigned a different value at the join. For example, consider

$$ f(x)= \begin{cases} x+2, & x<0,\\ 5, & x=0,\\ x+2, & x>0. \end{cases} $$

Both one-sided limits equal \(2\):

$$ \lim_{x\to 0^-}f(x)=0+2=2, \qquad \lim_{x\to 0^+}f(x)=0+2=2. $$

A mistaken conclusion would be: “The limits match, so the function is continuous.” But the defined value is \(f(0)=5\), and \(2\ne 5\). The function is not continuous at zero. To be continuous, the value assigned at the join would need to be \(2\).

A different error is to substitute \(c\) into the formula from the left and treat that result as \(f(c)\), even when the definition assigns \(c\) to the right branch or to a separate line. A branch used to compute a one-sided limit does not automatically determine the function’s value at the join.

What the Parameter Equation Tells You

The continuity conditions may produce different kinds of answers. A single equation can determine one parameter, as in the first example. It can also leave multiple parameters related by a condition, as in the second example. And sometimes no parameter choice can make the conditions agree. In that case, continuity at the join is impossible within the given family of formulas.

The useful habit is to keep the full condition in view:

$$ \text{left-hand limit} = \text{right-hand limit} = \text{defined value at the join}. $$

Solving only an equation between the two limits checks that the two sides approach the same height. The final comparison with \(f(c)\) checks that the graph’s actual point at the join is at that height too. Continuity describes agreement in value at the join; it does not, by itself, establish that the function has matching slopes there.

Summary: At a piecewise join \(x=c\), calculate the limit from each side using the appropriate formula, identify \(f(c)\) from the definition, and require all three values to be equal. Solve the resulting parameter conditions and substitute the answer back to verify them.

Check Your Understanding

For each question, write down the one-sided limits and the defined value at the join before deciding whether the function is continuous.

  1. For \(f(x)=\begin{cases}kx+2,&x<1,\\x+4,&x\ge 1,\end{cases}\) find \(k\) so that \(f\) is continuous at \(x=1\).
  2. For \(g(x)=\begin{cases}x+a,&x<0,\\b,&x=0,\\2x+1,&x>0,\end{cases}\) state the condition on \(a\) and \(b\) for continuity at zero.
  3. In a piecewise definition with the right-hand branch applying for \(x\ge c\), which branch determines \(f(c)\)?
  4. Can equal left- and right-hand limits guarantee continuity if the separately defined value at the join is different? Explain.
  5. If the continuity equations allow several parameter choices, what does each choice have in common at the join?

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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
Clinical Biostats