On this page
When you are given a piecewise function with unknown constants — usually named a and b — and told that it is differentiable across its entire domain, you are expected to find the exact values of those constants. This is a standard problem type in calculus courses and engineering entrance exams like the JEE.
Because the function's formula changes at a specific boundary point (for instance, x = c), that junction is where the function is at risk of breaking or having a sharp corner. You must force the two pieces to join smoothly.
Why does differentiability imply continuity?
To find two unknowns, you need a system of two equations. But the problem only tells you one fact: the function is differentiable. Where does the second equation come from?
According to Theorem 3.1 in OpenStax Calculus Volume 1, if a function is differentiable at a specific point, it must also be continuous at that point. Differentiability is a stronger condition than continuity. A function cannot have a derivative where it has a gap, a hole or a jump.
Therefore, you actually know two things about the function at the boundary point:
It is continuous (the left-hand limit equals the right-hand limit).
It is differentiable (the left-hand derivative equals the right-hand derivative).
This gives you the two equations you need to solve for a and b.
How to find a and b if a piecewise function is differentiable?
To find the unknowns, evaluate the limits and the derivatives of both pieces exactly at the boundary point where the function changes its rule.
First, set up the continuity equation. Substitute the boundary x-value into the left-hand piece and the right-hand piece. Set these two expressions equal to each other. This ensures there are no jumps, which is useful when telling removable and jump discontinuities apart.
Second, set up the differentiability equation. Take the derivative of the left-hand piece and the derivative of the right-hand piece with respect to x. Substitute the boundary x-value into both derivatives, and set them equal.
Finally, solve the resulting system of linear equations simultaneously.
A worked example: finding a and b
Suppose you have a function f(x) defined as:
f(x) = x² for x ≤ 1
f(x) = ax + b for x > 1
You are told f(x) is differentiable at x = 1. Let us find a and b.
Step 1: Match the values (Continuity) Substitute x = 1 into both pieces. Left piece: 1² = 1 Right piece: a(1) + b = a + b Since the function must be continuous at x = 1, these values must be equal. Equation 1: a + b = 1
Step 2: Match the slopes (Differentiability) Find the derivative of each piece. Derivative of the left piece: d/dx(x²) = 2x. At x = 1, the slope is 2(1) = 2. Derivative of the right piece: d/dx(ax + b) = a. Since the function is differentiable at x = 1, the left and right derivatives must be equal. Equation 2: a = 2
Step 3: Solve the equations Substitute a = 2 into Equation 1. 2 + b = 1 b = -1
The correct constants are a = 2 and b = -1. The right-hand piece of the function is therefore the line y = 2x - 1, which perfectly touches the parabola y = x² at x = 1 and shares its tangent slope.
How can you check your calculus work?
Exam problems often use more complex expressions, such as trigonometric functions or exponentials, requiring you to carefully apply the chain rule before substituting the boundary value. For example, differentiating parametric functions: dy/dx and d²y/dx² or applying L'Hôpital's rule to evaluate the limits may be necessary if the pieces are complicated fractions.
If you are stuck on a difficult piecewise function problem, you can bring it to the Fermi Problem Library. Instead of just printing the final answers for a and b, the AI tutor works out what you already know, builds a plan for the session, and teaches through it. It checks your understanding as it goes, drawing the figure and guiding you to set up the two equations yourself. If you are struggling with the underlying limits, you can switch to the Fermi Concept Library to review the foundations of continuity and derivatives.



