Why Piecewise Boundaries Need Care
A piecewise function can follow one formula to the left of a boundary and a different formula to the right. At the boundary itself, it may use either formula or a separately assigned value. To understand the limit there, we must keep these roles distinct: the left-hand trend, the right-hand trend, and the value of the function at the boundary.
The key question for a two-sided limit is not which formula supplies the boundary value. It is whether values of the function approach the same number from both sides. A separately defined value at the boundary does not change what happens at nearby inputs.
One-Sided Limits at a Boundary
The notation \(\lim_{x\to c^-} f(x)=L\) means that \(f(x)\) approaches \(L\) as \(x\) approaches \(c\) through inputs less than \(c\). The notation \(\lim_{x\to c^+} f(x)=R\) means that \(f(x)\) approaches \(R\) as \(x\) approaches \(c\) through inputs greater than \(c\). The point \(x=c\) itself is not included in either approach.
For a piecewise function, the branch condition tells us which formula to use on each side. If a formula applies for \(x<c\), it governs the left-hand limit. If another applies for \(x>c\), it governs the right-hand limit. For the simple affine and quadratic branches used below, the earlier material on limits establishes that their limits can be found by substituting the input value into the relevant formula.
The condition \(0<|x-c|\) explicitly leaves out the boundary point. Therefore, the value \(f(c)\), if it is defined, is not part of the test for the limit.
A Test for the Two-Sided Limit
When the left-hand and right-hand limits exist as finite numbers, they provide a direct test for the two-sided limit.
Here is why both directions of this test hold. If the two-sided limit is \(M\), then its defining condition applies to every sufficiently close input with \(x\ne c\). In particular, it applies to inputs on the left and to inputs on the right. Thus both one-sided limits must equal \(M\). A limit cannot have two different values: if a side approached \(A\) and also \(M\), with \(A\ne M\), choosing \(\varepsilon=|A-M|/3\) would require a sufficiently close function value to be within \(\varepsilon\) of both numbers. The triangle inequality would then give \(|A-M|<2|A-M|/3\), which is impossible.
Conversely, suppose both one-sided limits equal the same number \(M\). Given any \(\varepsilon>0\), the left-hand limit supplies a positive distance \(\delta_-\) that works for \(x<c\), and the right-hand limit supplies a positive distance \(\delta_+\) that works for \(x>c\). Take \(\delta=\min(\delta_-,\delta_+)\). If \(0<|x-c|<\delta\), then either \(x<c\) or \(x>c\). In the first case the left-hand condition gives \(|f(x)-M|<\varepsilon\); in the second case the right-hand condition gives the same inequality. Therefore the two-sided limit is \(M\).
Worked Examples
Worked Example: Matching Side Trends, Different Boundary Value
Consider the function
To find the left-hand limit at \(x=1\), use the branch for \(x<1\):
To find the right-hand limit, use the branch for \(x>1\):
Both side trends equal \(5\), so the two-sided limit exists and equals \(5\). Separately, the definition gives \(g(1)=9\). The check is direct: the left branch tends to \(5\), the right branch tends to \(5\), and neither calculation uses the assigned value \(9\) at \(x=1\). Thus \(g(1)\) is not the limit.
Worked Example: A Boundary Value Cannot Repair Unequal Trends
Define
On the left, the applicable branch is \(x+2\), so
On the right, the applicable branch is \(5-x\), so
The one-sided limits are unequal, since \(2\ne5\). Therefore \(\lim_{x\to0}h(x)\) does not exist. Although \(h(0)=17\), changing this boundary value to any other number would leave both nearby branches unchanged. It cannot make the left-hand trend \(2\) agree with the right-hand trend \(5\). The calculation checks the branch choice on each side and confirms that the failure is the unequal trends, not the value assigned at zero.
Worked Example: Different Formulas Can Have the Same Trend
Consider
For the left-hand limit, use \(x^2+2\), the branch for \(x<0\):
For the right-hand limit, inputs satisfy \(x>0\), so use \(3x+2\):
The two trends match, so \(\lim_{x\to0}p(x)=2\). The condition \(x\ge0\) also tells us which formula gives the actual boundary value: \(p(0)=3(0)+2=2\). As a numerical check, the left branch at \(x=-0.1\) gives \((-0.1)^2+2=0.01+2=2.01\), while the right branch at \(x=0.1\) gives \(3(0.1)+2=0.3+2=2.3\). These sample values are consistent with the exact branch limits; the exact calculations, rather than the samples alone, establish the limit.
A Reliable Boundary-Check Procedure
Writing the branch conditions beside each calculation reduces the chance of using the wrong formula. The order below also keeps the limit question separate from the question of what the function equals at the boundary.
Identify the input \(c\) where the branch rule changes, and note whether the function has a separately specified value at \(c\).
Use the formula whose condition applies for inputs just less than \(c\), and evaluate its limit as \(x\to c^-\).
Use the formula whose condition applies for inputs just greater than \(c\), and evaluate its limit as \(x\to c^+\).
If the two finite values agree, that common value is the two-sided limit. If they differ, the two-sided limit does not exist.
Use whichever case includes \(x=c\), or the explicit boundary assignment. Report this value separately from the limit.
Common Pitfall: Substituting into the Boundary Case
A frequent error is to find \(f(c)\) and report it as \(\lim_{x\to c}f(x)\) without checking the side trends. For the function \(h\) above, an incorrect calculation would be:
This uses the boundary value but ignores the values at nearby inputs. The corrected calculation evaluates each side separately:
Since \(2\ne5\), there is no two-sided limit. The fact that \(h(0)=17\) answers a different question. Another version of the same pitfall is to use the formula attached to \(x\le c\) for both sides. The inequality in each case matters: a left-hand limit uses inputs below \(c\), while a right-hand limit uses inputs above \(c\), whether or not the endpoint itself is included in one case.
Why the Distinction Matters
Piecewise definitions often assign a value at a boundary for a reason that is separate from the behavior nearby. A boundary value may match both side trends, differ from a common trend, or fail to resolve two unequal trends. Checking the sides first makes each possibility clear.
In particular, do not infer that two-sided behavior matches merely because a function has a value at the boundary, or because one branch includes equality. Instead, write down the left-hand and right-hand limits explicitly. Then state the two-sided conclusion and the boundary value as separate facts. This habit makes the reasoning transparent and prevents an endpoint convention from being mistaken for evidence about nearby inputs.
Check Your Understanding
For each question, identify the branch conditions before deciding what the limits are.
- For \(q(x)=\begin{cases}2x+1,&x<3,\\8,&x=3,\\x+5,&x>3,\end{cases}\) find both one-sided limits at \(3\). Does the two-sided limit exist, and what is \(q(3)\)?
- For \(r(x)=\begin{cases}4-x,&x<1,\\2x+1,&x\ge1,\end{cases}\) find the left-hand limit, right-hand limit, and boundary value at \(1\).
- If the two one-sided limits at \(c\) are \(6\) and \(6\), what is the two-sided limit? Does the value \(f(c)\) have to equal it?
- A function has left-hand limit \(-2\), right-hand limit \(4\), and boundary value \(0\). Does its two-sided limit exist? Explain why the boundary value does not change the conclusion.
- In your own words, why must a two-sided limit have matching one-sided limits?