Tutorials › AP Calculus › Derivatives of Piecewise-Defined Functions
← All AP Calculus Tutorials
AP Calculus AB & BC Intermediate

Derivatives of Piecewise-Defined Functions

Learn how to differentiate each piece of a piecewise function and, more importantly, how to determine whether the function is differentiable at the point where the pieces meet.

What Makes Piecewise Functions Different?

A piecewise-defined function uses different formulas on different parts of its domain. For example, one rule might apply when , while another applies when .

The key idea is simple: differentiate each formula on the interval where it applies. But there is one special issue at the point where the pieces meet. At that breakpoint, you cannot automatically differentiate either formula. You must check whether the function is continuous there and whether the left- and right-hand derivatives agree.

The Big Idea

A function can be differentiable on every individual piece and still fail to be differentiable at the point where the pieces join.

Step 1: Differentiate Each Piece

Suppose

For values of , differentiate the first formula normally. For values of , differentiate the second formula normally.

This gives the derivative on each open interval. However, this does not automatically tell us what happens at the breakpoint .

Why the Breakpoint Requires Special Attention

Suppose the pieces meet at . For to exist, the function must satisfy two conditions:

  1. Continuity: the function must actually be continuous at .
  2. Matching slopes: the derivative from the left and the derivative from the right must be equal.

The one-sided derivative conditions are

If either condition fails, the function is not differentiable at that point.

Worked Examples

Example 1: Differentiating Each Piece

Find for the function

Step 1: Differentiate the first piece, , for .
Step 2: Differentiate the second piece, , for .
Step 3: Therefore, away from the breakpoint :

The important point is that differentiating the pieces separately gives the derivative on the open intervals. We still need to examine the breakpoint itself.

Example 2: A Piecewise Function That Is Differentiable

Determine whether the function

is differentiable at .

Step 1 — Continuity: Evaluate the left-hand expression at :
Step 2: Evaluate the right-hand expression at :
Step 3: Since both pieces approach the same value and the function is defined consistently at the breakpoint, the function is continuous at .
Step 4 — Left derivative: Differentiate the left piece and evaluate at :
Step 5 — Right derivative: Differentiate the right piece and evaluate at :
Conclusion: The one-sided derivatives agree, so the function is differentiable at .
Example 3: Continuous but Not Differentiable

Determine whether

is differentiable at .

Step 1 — Continuity: Both pieces give the same value at the breakpoint:

So the function is continuous at .

Step 2 — Left derivative: The derivative of is , so the left-hand derivative at is .
Step 3 — Right derivative: The derivative of is , so the right-hand derivative at is .
Conclusion: The function is continuous but not differentiable because the left- and right-hand derivatives are different.
Example 4: Finding a Constant That Makes a Function Differentiable

Find the value of that makes

continuous and differentiable at .

Step 1 — Continuity: The left piece gives

The right piece must have the same value:

Step 2 — Differentiability: Differentiate both pieces.
Step 3: Set the two derivatives equal at :
Step 4: Solve the equation for .

The constant must satisfy both the continuity and differentiability requirements. On AP Calculus questions, checking only one of these conditions is a common trap.

A Reliable AP Calculus Method

When a question asks whether a piecewise function is differentiable at a breakpoint, use this sequence every time:

  1. Identify the breakpoint. This is the value of where the formula changes.
  2. Check continuity. Compare the left-hand limit, right-hand limit, and actual function value.
  3. Differentiate each piece. Use the appropriate derivative rules on each side.
  4. Evaluate the one-sided derivatives at the breakpoint.
  5. Compare them. If the left and right derivatives are equal, the derivative exists.

Common Mistakes

Assuming continuity means differentiability

A function can be continuous but have a corner or cusp. Continuity is necessary for differentiability, but it is not sufficient. Always compare the one-sided derivatives.

Using the wrong piece at the breakpoint

Pay close attention to inequalities such as versus . The piece that includes the breakpoint determines the actual value of the function there, while the one-sided derivatives come from the appropriate sides.

Checking only the derivative formulas

Two derivative formulas can have matching values at the breakpoint while the original function is discontinuous there. Differentiability requires continuity first.

Forgetting that the derivative itself can be piecewise

If a function has different formulas on different intervals, its derivative will usually have different formulas on those intervals too. That's completely normal.

Practice Problems

Question 1

Find for

Show answer
Question 2

Determine whether the function

is differentiable at .

Show answer
Question 3

Find the value of that makes

continuous and differentiable at .

Show answer
Question 4 (AP-Style)

A function is defined by

Determine whether exists.

Show answer

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon