A piecewise function
is built from two smooth formulas and that meet at the breakpoint . Away from each piece is as smooth as you like, so the only place smoothness can fail is at the seam. The question is always: how many matching conditions at make belong to (i.e. have a continuous -th derivative)?
The matching principle
at the two pieces agree at in value and in every derivative up to order :
That is equations (orders through ). The logic chains downward: a continuous forces and to be continuous too, because a function with a derivative is automatically continuous. So you never check continuity of the lower derivatives separately — matching the top order plus all the ones beneath it is exactly the full list.
Intuitively, at a breakpoint each piece supplies a one-sided value from the left and from the right. The derivative exists and is continuous at only when these one-sided values coincide for that order and all lower ones.
How to apply it
- Identify the breakpoint and the two pieces (used for ) and (used for ).
- Decide the target order : "continuous" is (match ); "differentiable" / "continuous first derivative" is (match ); "continuous second derivative" is (match ); and so on.
- Differentiate each piece up to order and evaluate at . Watch the product, chain, and quotient rules — most slips happen here.
- Set for , giving equations, then solve for the unknown constants.
Worked mini-example
Choose and so that
is (continuously differentiable). Here , so we match orders and at .
Left piece :
Right piece :
Matching:
| Order | Equation | Result |
|---|---|---|
| (value) | ||
| (slope) |
So is exactly when , i.e. the right piece is the tangent line . (For a glue we would additionally need , i.e. , which already holds — but a generic quadratic right piece would pin a third condition.)
This is the same machinery the konkur problem uses: there the left piece is and the right is , and demanding a continuous second derivative () gives the three equations from the product rule.
Exam trick: Translate the wording into a number first — "" means "match orders through ," giving equations, no more, no less. The biggest trap is matching only the top order (e.g. just ) and forgetting that you still need the value and first-derivative equations; conversely, do not waste time re-checking continuity of once you have matched a higher derivative, since that comes for free.