Why continuity determines the parameters
A piecewise function can use a different formula on each part of its domain. At the point where two parts meet, the formulas must fit together if the whole function is to be continuous there. Unknown constants in those formulas can often be found by requiring that the left-hand limit, right-hand limit, and function value agree at every join.
The essential work is to treat each joining point separately. Write down what the function approaches from each side, identify the formula that actually defines the function at the point, and then impose equality. With more than one join, each point contributes its own condition.
In this tutorial, the unknown constants appear in the formulas defining \(f\). The conditions above turn continuity into equations for those constants. Solving the equations finds candidate values; checking each limit and the function value confirms whether those values work.
How to translate a join into an equation
Suppose the formula to the left of \(c\) is \(L(x)\), and the formula to the right is \(R(x)\). If the left-hand and right-hand limits exist, continuity at \(c\) requires both limits to equal the value assigned at \(c\). The branch containing the equality sign tells you which formula supplies \(f(c)\), but it does not change either one-sided limit.
When each branch formula is continuous up to the relevant side of the boundary, the one-sided limits can be found by substituting \(c\) into those formulas. For example, if \(x<c\) uses \(L(x)\), then \(\lim_{x\to c^-}f(x)=\lim_{x\to c^-}L(x)\). Do not substitute into a formula outside its branch or confuse the value at the point with a limit from one side.
Every boundary between adjacent pieces is a possible point where continuity must be checked.
Use the formula valid on each side and evaluate its limit as \(x\) approaches the boundary.
Use the branch that includes the boundary point.
Repeat at every join, then check the resulting parameter values in all three quantities.
Worked Example: One unknown at one join
Worked Example: One unknown at one join
Find \(a\) so that the function is continuous at \(x=2\):
For the left-hand limit, use the first branch. As \(x\) approaches 2 from below, \(x^2+1\) approaches \(2^2+1=5\). Thus \(\lim_{x\to2^-}f(x)=5\).
For the right-hand limit, use the second branch. As \(x\) approaches 2 from above, \(ax+3\) approaches \(2a+3\). The point \(x=2\) is included in this branch, so \(f(2)=2a+3\) as well.
Continuity requires the left-hand limit to equal the right-hand limit and the function value. Therefore, solve:
Check: With \(a=1\), the left-hand limit is \(5\), the right-hand limit is \(2(1)+3=5\), and the function value is \(f(2)=2(1)+3=5\). All three agree, so the function is continuous at \(x=2\).
More than one join means more than one condition
A piecewise function with three branches usually has two joining points. Continuity at the first join gives one condition, and continuity at the second gives another. If the same unknowns appear in both conditions, solve them as a system rather than treating the joins independently.
Worked Example: Two parameters and two joining points
Find \(a\) and \(b\) so that \(f\) is continuous at both \(x=0\) and \(x=2\):
At \(x=0\): From the left, \(x^2+1\) approaches \(1\). From the right, \(ax+b\) approaches \(b\). Since the middle branch includes \(0\), the function value is \(f(0)=b\). Continuity at zero therefore requires \(1=b\), so \(b=1\).
At \(x=2\): From the left, the middle branch approaches \(2a+b\). From the right, the last branch approaches \(3(2)=6\). Since the last branch includes \(2\), \(f(2)=3(2)=6\). Continuity at two requires \(2a+b=6\).
Substitute \(b=1\) into the second condition:
Check at \(x=0\): The left-hand limit is \(1\). The right-hand limit is \(a(0)+b=0+1=1\). Also, \(f(0)=1\).
Check at \(x=2\): The left-hand limit is \(2a+b=2\left(\frac52\right)+1=5+1=6\). The right-hand limit is \(3(2)=6\), and \(f(2)=6\). Both joins satisfy the continuity condition.
Why matching the limits is the right test
The one-sided limits describe the values of the function arbitrarily close to the boundary from each side. A two-sided limit at \(c\) exists exactly when those one-sided limits exist and are equal. Continuity additionally requires that this common limit equal the actual value \(f(c)\). This explains why parameter equations must match all three quantities, not just the two formulas’ outputs at a convenient nearby point.
For piecewise formulas whose relevant one-sided limits can be evaluated, the condition can be expressed directly as equations. At a boundary \(c\), if the left and right expressions are \(L(x)\) and \(R(x)\), the conditions are:
This criterion is both necessary and sufficient. If \(f\) is continuous at \(c\), its limit equals \(f(c)\); approaching from either side must therefore give that same value. Conversely, if both one-sided limits exist and equal \(f(c)\), the two-sided limit exists with value \(f(c)\), which is precisely continuity at \(c\).
Worked Example: A rational branch and two joins
Worked Example: A rational branch and two joins
Find \(a\) and \(b\) so that the function below is continuous at \(x=1\) and \(x=3\):
At \(x=1\): The left branch is defined for \(x<1\), so its limit is evaluated as \(x\) approaches 1, not by substituting \(x=1\) into the original fraction. For \(x\ne1\), factor the numerator and simplify:
Therefore the left-hand limit at 1 is \(1+1=2\). The middle branch gives the right-hand limit \(a+b\), and it also defines \(f(1)=a+b\). Continuity at 1 requires \(a+b=2\).
At \(x=3\): The middle branch approaches \(3a+b\) from the left. The last branch approaches \(2(3)+1=7\) from the right, and it defines \(f(3)=7\). Continuity at 3 requires \(3a+b=7\).
Solve the two equations. Subtract the first equation from the second:
Substitute this value into \(a+b=2\):
Check at \(x=1\): The left-hand limit is \(2\). The middle branch gives \(a+b=\frac52-\frac12=2\), so the right-hand limit and \(f(1)\) are both \(2\).
Check at \(x=3\): The left-hand limit is \(3a+b=3\left(\frac52\right)-\frac12=\frac{15}{2}-\frac12=\frac{14}{2}=7\). The right-hand limit is \(2(3)+1=7\), and \(f(3)=7\). The function is continuous at both joins.
Common mistake: substituting into a formula that is undefined
In the last example, a tempting but incorrect calculation is to substitute \(x=1\) into the left-hand fraction and claim that the limit is \(0/0\), so continuity cannot be achieved. The expression \(\frac{0}{0}\) is undefined, but that does not determine the limit. A limit concerns values near the point, and the fraction simplifies to \(x+1\) for \(x\ne1\). Its left-hand limit is \(2\).
When the conditions cannot be satisfied
Not every piecewise function can be made continuous by choosing its parameters. If the required equations contradict each other, there is no parameter choice that produces continuity at all the specified joins. It is important to report that conclusion rather than forcing a value from just one of the conditions.
Worked Example: A boundary that no parameter can repair
Can any value of \(a\) make the following function continuous at \(x=0\)?
From the left, \(x+1\) approaches \(1\), so \(\lim_{x\to0^-}f(x)=1\). From the right, \(ax+2\) approaches \(2\), regardless of \(a\), since \(a(0)+2=2\). The second branch includes zero, so \(f(0)=2\).
Continuity would require \(1=2\), which is false. The parameter \(a\) cannot change either one-sided limit at zero. Therefore, no value of \(a\) makes the function continuous there.
Check: For every real \(a\), the one-sided limits remain \(1\) and \(2\), while the function value remains \(2\). The disagreement persists for all choices of \(a\).
A reliable final check
After solving the equations, verify each join from the original piecewise definition. For every boundary \(c\), record the left-hand limit, the right-hand limit, and \(f(c)\). A solution is valid only if all three are finite and equal at every join being tested. Also check that the formulas themselves are defined on the intervals where they are used; continuity equations at joins do not fix a formula that is undefined elsewhere in its stated domain.
Check Your Understanding
For each question, set up the continuity conditions before solving or deciding whether a solution exists.
- Find \(k\) so that \(f(x)=x+4\) for \(x<2\) and \(f(x)=kx\) for \(x\ge2\) is continuous at \(x=2\).
- For \(f(x)=x^2\) when \(x<1\) and \(f(x)=ax+b\) when \(x\ge1\), what equation must \(a\) and \(b\) satisfy for continuity at \(x=1\)?
- Find \(a\) and \(b\) so that \(f(x)=2x+1\) for \(x<0\), \(f(x)=ax+b\) for \(0\le x<2\), and \(f(x)=x+5\) for \(x\ge2\) is continuous at both joins.
- Why is substituting the boundary into a branch that excludes that boundary not necessarily a valid way to find the one-sided limit?