Testing a Piecewise Join
A piecewise formula can change at a particular input \(c\). The formula on the left of \(c\) may differ from the formula on the right, and the value assigned at \(c\) may be specified separately. To decide whether the function has a derivative at the join, examine how the function changes from each side using difference quotients.
The essential test is precise: the left-hand and right-hand difference quotients must each approach a finite value, and those values must be equal. Comparing branch formulas informally, or merely checking that the function is continuous, does not settle the derivative question.
Here \(h\) is the increment from \(c\), so \(c+h\) is the input being compared with \(c\). When \(h<0\), the input is to the left of \(c\); when \(h>0\), it is to the right. In either quotient, the numerator must use the actual value \(f(c)\), not a value obtained by extending whichever branch seems convenient.
Set Up the Quotients Before Taking Limits
Suppose a piecewise function uses a formula \(L(x)\) for \(x<c\), a formula \(R(x)\) for \(x>c\), and assigns the value \(f(c)\) at the join. The two tests are
The left quotient uses \(L\) because \(c+h<c\) when \(h<0\). The right quotient uses \(R\) because \(c+h>c\) when \(h>0\). After simplifying each quotient, evaluate its limit from the indicated side. A finite limit on only one side is not enough for a two-sided derivative.
If the one-sided limits are finite and equal, their common value is \(f'(c)\). If they are finite but unequal, the two-sided derivative does not exist. If either one-sided limit fails to exist as a finite real number, the two-sided derivative also does not exist.
Worked Example: Matching Finite One-Sided Derivatives
Worked Example: Matching Finite One-Sided Derivatives
Let \(f(x)=x^2\) for \(x\leq 1\), and \(f(x)=2x-1\) for \(x>1\). Test differentiability at the join \(c=1\).
First, the value at the join comes from the branch that includes \(x=1\):
For \(h<0\), \(1+h<1\), so the left branch applies. Its difference quotient is
Therefore the left-hand derivative is
For \(h>0\), \(1+h>1\), so the right branch applies. The quotient is
Thus the right-hand derivative is \(\lim_{h\to 0^+}2=2\). Both one-sided derivatives exist as finite values and agree, so
As a check, the left quotient simplifies to \(2+h\), which approaches \(2\) from the left, and the right quotient is identically \(2\) for \(h>0\). Both calculations use \(f(1)=1\), as required.
Why Agreement Gives the Derivative
The two-sided derivative is defined by one limit in which \(h\) can approach zero through either negative or positive values. A two-sided limit exists with value \(m\) exactly when the limits from both sides exist and are equal to \(m\). The derivative quotient is a particular function of \(h\), namely \(\frac{f(c+h)-f(c)}{h}\), so the same limit criterion applies directly.
To justify the criterion, write \(Q(h)=\frac{f(c+h)-f(c)}{h}\) for nonzero \(h\) sufficiently close to zero. If the two-sided limit of \(Q(h)\) is \(m\), then restricting \(h\) to negative values or positive values leaves that limit unchanged. Consequently, both one-sided limits exist and equal \(m\).
Conversely, suppose the left-hand limit and right-hand limit of \(Q(h)\) both equal the same finite number \(m\). Given any positive tolerance \(\varepsilon\), the left-hand limit ensures that \(Q(h)\) is within \(\varepsilon\) of \(m\) for all negative \(h\) sufficiently close to zero. The right-hand limit ensures the same for all positive \(h\) sufficiently close to zero. Choose a positive bound small enough to satisfy both conditions. Then whenever \(0<|h|\) is smaller than that bound, either \(h<0\) or \(h>0\), and in either case \(|Q(h)-m|<\varepsilon\). This is the definition of the two-sided limit \(Q(h)\to m\), so \(f'(c)=m\).
Worked Example: Finite One-Sided Derivatives That Do Not Agree
Worked Example: Finite One-Sided Derivatives That Do Not Agree
Let \(g(x)=x^2\) for \(x\leq 0\), and \(g(x)=3x\) for \(x>0\). Test differentiability at \(c=0\).
The value at the join is \(g(0)=0^2=0\). For \(h<0\), use the left branch:
Its left-hand limit is \(\lim_{h\to 0^-}h=0\). For \(h>0\), use the right branch:
Its right-hand limit is \(\lim_{h\to 0^+}3=3\). Both limits are finite, but \(0\neq 3\). Therefore \(g'(0)\) does not exist. The quotients show that the function's change per unit increment approaches different values on opposite sides of the join.
Check the conclusion against the criterion: a derivative requires equal finite one-sided limits, while these are \(0\) and \(3\). The criterion fails, so there is no two-sided derivative at \(0\).
Worked Example: A Failure to Obtain a Finite Limit
Worked Example: A Failure to Obtain a Finite Limit
Let \(p(x)=x+1\) for \(x<0\), and \(p(x)=x^2\) for \(x\geq 0\). Test differentiability at \(c=0\).
The value at the join is \(p(0)=0^2=0\). For \(h<0\), the left branch gives
As \(h\to 0^-\), \(\frac{1}{h}\) decreases without bound, so the quotient does not approach a finite real number. In particular, the left-hand derivative does not exist as a finite value. No calculation of the right-hand derivative can make the two-sided derivative exist. Thus \(p'(0)\) does not exist.
For completeness, the right-hand quotient is
and its limit is \(0\). The right-hand limit is finite, but the left-hand limit is not; the required pair of equal finite one-sided values is absent. This example also illustrates why it is important to test both sides rather than stop after finding one finite limit.
A Common Mistake: Substituting Zero Too Soon
A difference quotient has \(h\) in its denominator. Directly setting \(h=0\) therefore produces division by zero, often in an expression that appears to be \(0/0\). That does not show that the derivative fails to exist; it means the quotient must be simplified before taking the limit.
For example, for the left branch \(x^2\) at \(c=1\), the incorrect calculation is
The correction is to expand and factor while \(h\neq 0\):
Now the one-sided limit is \(\lim_{h\to 0^-}(2+h)=2\). The quotient is evaluated for nonzero \(h\), then its limit is taken; the increment is never set equal to zero inside the original fraction.
A Reliable Test at a Join
For a piecewise function at an interior join, organize the calculation in this order:
Evaluate the branch that defines \(f(c)\), or use an explicitly assigned value. Keep this value in both numerators.
Use the left formula when \(h<0\) and the right formula when \(h>0\).
Do the algebra for nonzero \(h\) before taking either limit.
Each one-sided limit must be finite, and the two resulting values must be equal.
Continuity at the join is necessary for differentiability at an interior point: if the difference quotient has a finite limit, then \(f(c+h)-f(c)\) is the product of \(h\) and a quantity approaching a finite number, so this difference approaches zero. But continuity alone does not ensure that the two one-sided quotients agree. The quotient test checks the stronger condition directly.
Why the Test Matters
A piecewise function may have different formulas on either side while still having a derivative at the join. What matters is not whether the formulas look alike, but whether their difference quotients approach the same finite value. Conversely, a shared function value at the join does not guarantee matching slopes. The one-sided test turns both questions into explicit limits, with a clear decision at the end.
Check Your Understanding
For each question, set up the relevant difference quotient before deciding whether the derivative exists.
- For a join at \(c\), which branch formula belongs in the left-hand quotient when \(h<0\)?
- Suppose the left- and right-hand difference quotients approach \(4\) and \(4\). What is \(f'(c)\), and why?
- Suppose the one-sided limits are finite but equal to \(-2\) and \(5\). Does \(f'(c)\) exist?
- Why is substituting \(h=0\) into the original difference quotient not a valid derivative test?
- If one one-sided quotient has no finite limit, can the two-sided derivative exist? Explain using the criterion.