Why Piecewise Joins Need Special Attention
A piecewise formula can be smooth on each branch and still fail to be differentiable where the branches meet. At such a point, the two formulas may assign different values, meet continuously but have different slopes, or meet with matching slopes. These possibilities must be distinguished by checking the function’s value and its one-sided difference quotients.
Suppose a piecewise function changes formula at \(x=a\). Away from \(a\), a sufficiently small change in the input stays within one branch, so the branch formula determines the local behavior. At \(a\), inputs on the left and right may use different formulas. The derivative at the join exists only when the difference quotient approaches the same finite value from both sides.
Both quotients use the actual value \(f(a)\), even if that value is assigned by only one branch. This matters: the difference quotient measures changes relative to the function’s value at the join, not merely relative to the limiting value of a neighboring branch.
A Reliable Classification Procedure
At every join, first check continuity. Differentiability implies continuity, so a discontinuity rules out a derivative immediately. If the function is continuous, calculate the left- and right-hand difference-quotient limits separately. Equal finite limits mean the function is differentiable at the join; unequal limits mean it is not.
Identify the input \(a\) where the formula changes, then determine \(f(a)\) from the branch that includes \(a\).
Compare the left-hand limit and right-hand limit of \(f(x)\) at \(a\) with \(f(a)\). If they do not all agree, \(f\) is not differentiable there.
Use \(h<0\) for inputs to the left and \(h>0\) for inputs to the right. Substitute the appropriate branch formula for \(f(a+h)\).
If both limits are finite and equal, their common value is \(f'(a)\). Otherwise, \(f\) is not differentiable at the join.
For a rational branch, also check that its formula is defined at the inputs being used. Algebraic cancellation can simplify a quotient on its domain, but it does not automatically define the original quotient at a point where its denominator is zero.
Worked Examples at Piecewise Joins
Worked Example: A Differentiable Polynomial Join
Classify differentiability at \(x=1\) for $$ f(x)= \begin{cases} x^2+1, & x<1,\\ 2x, & x\geq 1. \end{cases} $$
The value comes from the second branch: $$ f(1)=2(1)=2. $$ The limit from the left is $$ \lim_{x\to 1^-}(x^2+1)=1^2+1=2, $$ and from the right it is $$ \lim_{x\to 1^+}2x=2(1)=2. $$ Both limits equal \(f(1)\), so the function is continuous at \(1\).
For the left-hand derivative, let \(h<0\). Then \(1+h<1\), so the first branch applies: $$ \frac{f(1+h)-f(1)}{h} = \frac{(1+h)^2+1-2}{h} = \frac{1+2h+h^2+1-2}{h} = \frac{2h+h^2}{h} = 2+h. $$ Therefore, $$ f'_{-}(1)=\lim_{h\to0^-}(2+h)=2. $$
For the right-hand derivative, let \(h>0\). The second branch applies: $$ \frac{f(1+h)-f(1)}{h} = \frac{2(1+h)-2}{h} = \frac{2+2h-2}{h} = 2. $$ Thus \(f'_{+}(1)=2\). The one-sided derivatives agree, so \(f'(1)=2\). Substituting into the two quotient expressions confirms that both approach \(2\).
Worked Example: An Absolute-Value Corner
Classify differentiability at \(x=0\) for $$ f(x)=|x|= \begin{cases} -x, & x<0,\\ x, & x\geq 0. \end{cases} $$
Here \(f(0)=0\). On either side, the function tends to \(0\), so it is continuous at \(0\). For \(h<0\), the left branch gives $$ \frac{f(0+h)-f(0)}{h} = \frac{-h-0}{h} = -1. $$ Hence \(f'_{-}(0)=-1\). For \(h>0\), the right branch gives $$ \frac{f(0+h)-f(0)}{h} = \frac{h-0}{h} = 1, $$ so \(f'_{+}(0)=1\). Since \(-1\neq 1\), the derivative at \(0\) does not exist. The function is continuous there, but its two one-sided slopes do not match.
For \(x<0\), the function is locally the line \(-x\); for \(x>0\), it is locally the line \(x\). Thus the only point requiring this join check is \(0\), and that point is not differentiable.
Worked Example: A Rational Branch That Meets a Polynomial Branch
Classify differentiability at \(x=1\) for $$ f(x)= \begin{cases} \dfrac{x^2-1}{x-1}, & x<1,\\ x+1, & x\geq 1. \end{cases} $$
The rational expression is defined on its branch, since that branch excludes \(x=1\). For \(x<1\), factor the numerator: $$ \frac{x^2-1}{x-1} = \frac{(x-1)(x+1)}{x-1} = x+1. $$ This cancellation is valid for \(x\neq1\), which holds throughout the left branch. The value at the join is given by the second branch: \(f(1)=1+1=2\). From the left, the simplified expression tends to \(2\); from the right, \(x+1\) also tends to \(2\). The function is continuous at \(1\).
For \(h<0\), the rational branch applies at \(1+h\). Its denominator is \(h\), which is nonzero, and $$ f(1+h) = \frac{(1+h)^2-1}{(1+h)-1} = \frac{1+2h+h^2-1}{h} = \frac{2h+h^2}{h} = 2+h. $$ Therefore, $$ \frac{f(1+h)-f(1)}{h} = \frac{2+h-2}{h} = 1, $$ so \(f'_{-}(1)=1\). For \(h>0\), the polynomial branch applies: $$ \frac{f(1+h)-f(1)}{h} = \frac{(1+h)+1-2}{h} = \frac{h}{h} = 1. $$ Thus \(f'_{+}(1)=1\), and \(f'(1)=1\). As a final check, both one-sided difference quotients are exactly \(1\) for their allowed \(h\), so each has limit \(1\).
Why the Join Test Works
The derivative at \(a\) is defined by the two-sided limit of the difference quotient. A two-sided limit exists with a finite value exactly when the left- and right-hand limits both exist as finite numbers and agree. This gives the one-sided derivative criterion directly from the definition.
Continuity is an important preliminary check because differentiability forces continuity. To see why, if the derivative exists, then for \(h\neq0\), $$ f(a+h)-f(a) = h\left(\frac{f(a+h)-f(a)}{h}\right). $$ As \(h\to0\), the first factor tends to \(0\), while the second tends to the finite number \(f'(a)\). Their product therefore tends to \(0\), which means \(f(a+h)\to f(a)\). Consequently, if the function is discontinuous at the join, its derivative cannot exist there.
Common Pitfall: Ignoring the Sign of the Increment
A frequent error is to calculate the difference quotient for an absolute-value function as though the same branch applied on both sides. For \(f(x)=|x|\) at \(0\), the incorrect calculation is $$ \frac{|0+h|-|0|}{h}=\frac{|h|}{h}=1. $$ That last equality is true only when \(h>0\). If \(h<0\), then \(|h|=-h\), so $$ \frac{|h|}{h}=\frac{-h}{h}=-1. $$ The correction is to retain the side condition throughout the calculation: the right-hand quotient is \(1\), the left-hand quotient is \(-1\), and the two-sided derivative does not exist.
Another related error is to cancel a zero denominator and then claim the original rational formula is defined at the cancelled point. In the rational example, cancellation showed how the left branch behaves for \(x<1\); the value at \(1\) still came from the explicitly assigned polynomial branch. Checking the function’s actual value prevents this domain mistake.
Classifying All Points of a Piecewise Function
To classify differentiability throughout a piecewise domain, separate ordinary points from joins. At an ordinary point, the input lies strictly inside one branch, so use that branch’s formula and check any restrictions such as a zero denominator. At each join, apply the continuity and one-sided derivative test.
For a function with several branches, repeat the test at every boundary between adjacent formulas. A function may be differentiable at one join and not another. Also, an absolute-value expression can have a point needing special attention inside a branch if its input reaches zero there; the absolute-value example illustrates why the sign must be checked on either side of such a point.
Check Your Understanding
For each question, explain which limits or values you would compare.
- What must be checked before calculating one-sided derivatives at a join?
- For \(f(x)=|x-3|\), what are the left- and right-hand difference-quotient limits at \(x=3\)?
- If both one-sided derivatives exist and are finite but unequal, what can you conclude?
- Why does cancelling a factor in a rational branch not by itself determine the function’s value at the join?
- A piecewise function is continuous at a join and both one-sided derivatives equal \(4\). What is its derivative at that point?