You’ve Built a Function Piece by Piece, But Does It Have a Smooth Connection?
You’re working through a calculus problem, and you’ve carefully defined a function using different rules for different intervals. You’ve graphed it, and it looks okay—the pieces seem to meet. But now you need to take its derivative. A nagging question arises: is this piecewise function even differentiable at the points where the rules change? You can’t just apply the derivative rules to each piece and call it a day. The function might be continuous, but a sharp corner or a cusp at the junction point can make the derivative undefined there, breaking your calculations.
This is a common stumbling block in calculus, from introductory courses to more advanced analysis. Knowing how to definitively check for differentiability in piecewise functions is not just an academic exercise; it’s essential for ensuring the integrity of models in physics, economics, and engineering where smooth rates of change are critical. Let’s break down the exact, step-by-step process to remove the guesswork.
Differentiability Is More Than Just Continuity
First, it’s crucial to understand the hierarchy. All differentiable functions are continuous, but not all continuous functions are differentiable. Continuity is about the function’s value—the graph has no holes or jumps. Differentiability is about the function’s behavior—the graph has a well-defined, non-vertical tangent line at a point, meaning the instantaneous rate of change exists.
For a piecewise function, the points of interest are always the “boundary points” or “junction points” where the defining rule switches. We don’t need to worry about differentiability in the middle of a piece (assuming the rule there is a standard differentiable function like a polynomial or sine function). The entire question boils down to: what happens at that specific x-value where the pieces meet?
The Two-Part Test for Differentiability at a Point
To determine if a piecewise function f(x) is differentiable at a specific point x = c (the junction), you must pass two consecutive checks. Failure at either step means the function is not differentiable at that point.
Step 1: Check for Continuity at the Junction
This is the gateway. If the function isn’t continuous at x = c, it automatically cannot be differentiable there. The logic is simple: a jump discontinuity means the function doesn’t even have a single, agreed-upon value at that point, so talking about its instantaneous rate of change is meaningless.
To check continuity at x = c:
– Evaluate the limit of f(x) as x approaches c from the left (using the “left piece” rule).
– Evaluate the limit of f(x) as x approaches c from the right (using the “right piece” rule).
– Find the actual function value f(c). This is usually defined by one of the piecewise rules.
For continuity, all three of these numbers must be equal: Left-hand limit = Right-hand limit = f(c).
If they are not equal, stop. The function is not continuous and therefore not differentiable at x = c. If they are equal, proceed to the true test.
Step 2: Check for Equal Left-Hand and Right-Hand Derivatives
Passing the continuity test means the pieces meet at a point. Now, we need to see how they meet. Do they meet smoothly, forming a single tangent line? Or do they meet at an angle, creating a corner?
This is checked by comparing the derivatives from each side. You must calculate the derivative of the left piece’s rule and the derivative of the right piece’s rule. Then, evaluate each derivative at the junction point x = c.
– The left-hand derivative is the limit of the difference quotient as x approaches c from the left. In practice, you compute f'(x) for the left piece and plug in x = c.
– The right-hand derivative is the limit of the difference quotient as x approaches c from the right. Compute f'(x) for the right piece and plug in x = c.
For differentiability at x = c: Left-hand derivative = Right-hand derivative.
If these two derivative values are the same finite number, then the function is differentiable at x = c, and that common value is f'(c). If they are different, or if one is infinite (indicating a vertical tangent), the function is not differentiable at that point.
Walking Through a Classic Example
Let’s make this concrete with a standard textbook example. Consider the absolute value function, which can be written as a piecewise function:
f(x) = |x| = { x, if x ≥ 0; -x, if x < 0 }
The junction point is x = 0. Is f differentiable at x = 0?
First, check continuity at x = 0.
– Left-hand limit (x → 0⁻): Use rule -x. Limit is 0.
– Right-hand limit (x → 0⁺): Use rule x. Limit is 0.
– f(0): Use rule for x ≥ 0, so f(0) = 0.
All three are 0. The function is continuous at x = 0. Good.
Now, check the derivatives from each side.
– For the left piece (x < 0): f(x) = -x, so f'(x) = -1. The left-hand derivative is -1.
– For the right piece (x ≥ 0): f(x) = x, so f'(x) = 1. The right-hand derivative is 1.
-1 ≠ 1. Therefore, the left-hand and right-hand derivatives are not equal. The function is NOT differentiable at x = 0. Graphically, this is the famous sharp corner (or “cusp”) at the vertex of the V-shaped absolute value graph.
Identifying Common Failure Patterns
When a piecewise function fails to be differentiable, it usually fails in one of these recognizable ways. Learning to spot them saves time.
The Corner (Kink)
This is the |x| case described above. The function is continuous, but the slopes from the left and right are different finite numbers. The graph has a distinct V-shape or kink. The derivative does not exist because there is no single tangent line; you could draw two distinct “half-tangents.”
The Cusp
A cusp is more extreme. Here, the function is continuous, but the slopes from the left and right approach positive and negative infinity (or vice-versa). Imagine the graph of f(x) = x^(2/3). At x=0, the left-hand derivative approaches -∞ and the right-hand derivative approaches +∞, creating a sharp point where the tangent line is vertical on both sides. This is also non-differentiable.
The Vertical Tangent
In this case, the left-hand and right-hand derivatives are the same, but they are both infinite. The graph is smooth and continuous, but it becomes perfectly vertical at the point. The derivative is undefined because the slope is infinite. An example is f(x) = x^(1/3) at x=0.
The Discontinuity
As established, if the function has a jump, gap, or hole at the junction point (the limits or function value don’t match), it fails the continuity prerequisite and is immediately non-differentiable. You don’t even need to compute the derivatives.
Troubleshooting Your Approach
Even with the steps, subtle errors can creep in. Here are the most common mistakes and how to avoid them.
– Deriving the Wrong Piece: The most frequent error is using the wrong formula when evaluating the derivative at the junction point. Remember: to find the left-hand derivative, you take the derivative of the piece defined for x < c, then evaluate it at x=c. You do not take the limit of the original function. You are taking the limit of the difference quotient, which is equivalent to evaluating the derivative formula.
– Assuming Continuity Implies Differentiability: This is the fundamental conceptual trap. The absolute value example is the perfect antidote to this assumption. Always perform both steps.
– Misplacing the Junction Point: Double-check which piece’s rule actually defines the function AT the point x = c (for the f(c) value in the continuity test). Sometimes the point is included with the left piece, sometimes with the right. This affects the continuity check but does not change the derivative comparison step, as derivatives are based on the open intervals to the left and right of c.
Applying the Test to More Complex Functions
The logic scales perfectly. Consider a function defined by a quadratic and a linear piece:
g(x) = { x² + 1, if x ≤ 2; 5x – 3, if x > 2 }
Junction at x = 2. Check continuity:
– Left-hand limit (x→2⁻): Use x²+1. (2)²+1 = 5.
– Right-hand limit (x→2⁺): Use 5x-3. 5(2)-3 = 7.
– g(2): Use rule for x ≤ 2, so g(2) = (2)²+1 = 5.
Left limit (5) = f(2) (5), but the right limit is 7. Since 5 ≠ 7, the function is not continuous at x=2. Therefore, it is immediately not differentiable at x=2. No need to check derivatives.
Now, let’s modify it to be continuous:
h(x) = { x² + 1, if x ≤ 2; 5x – 5, if x > 2 }
Check continuity at x=2:
– Left-hand limit: 5.
– Right-hand limit: 5(2)-5 = 5.
– h(2): 5.
Continuous. Good.
Now check differentiability:
– Left-hand derivative: Derivative of (x²+1) is 2x. At x=2, value is 4.
– Right-hand derivative: Derivative of (5x-5) is 5. At x=2, value is 5.
4 ≠ 5. Therefore, h(x) is continuous but NOT differentiable at x=2. It has a corner.
Strategic Next Steps for Mastery
To solidify this skill, build a systematic practice routine. Start by visually sketching piecewise functions and predicting where differentiability will fail before doing the algebra. Then, run the two-step test to confirm. Pay special attention to functions involving absolute values, roots, and rational expressions, as these often create tricky junction points.
When you encounter a problem, always ask: 1) What is the junction point? 2) Is it continuous there? 3) If yes, do the left and right derivatives agree? This mental checklist will transform a vague challenge into a clear, procedural verification. By mastering this test, you move from hoping your derivative is correct to knowing it is, which is the true power of understanding calculus fundamentals.