Tutorials › AP Calculus › Choosing Parameters for Differentiable Piecewise Joins

Differentiability and Continuity · Tutorial 114 of 999

Choosing Parameters for Differentiable Piecewise Joins

Use value matching and slope matching to determine whether piecewise formulas join differentiably and to solve for unknown parameters.

Beginner 10 min read

What You'll Learn

  • State the continuity and differentiability conditions at a piecewise join.
  • Translate value matching and slope matching into equations for unknown parameters.
  • Solve for unique parameter values, families of solutions, or prove that no solution exists.
  • Verify one-sided difference quotients and the function value at the join.
  • Recognize why matching slopes alone does not guarantee differentiability.

Why Parameters Must Match in Two Ways

A piecewise formula can use one rule to the left of a point and another rule to its right. If the formulas contain unknown parameters, those parameters may be chosen to make the two pieces fit smoothly at the join.

There are two separate requirements. First, the function values must meet: otherwise there is a break in the graph. Second, the one-sided slopes must agree: otherwise the graph may have a corner. To make the function differentiable at the join, both requirements must be satisfied.

The equations for these requirements are often simple to write but easy to confuse. In particular, equating slopes does not automatically ensure that the function is continuous.

Key idea: At a join \(x=c\), differentiability requires the function to be continuous at \(c\) and its left- and right-hand difference quotients to approach the same finite value.

Continuity and Slope Matching

Consider a function defined by \(f(x)=g(x)\) for \(x<c\) and \(f(x)=r(x)\) for \(x\ge c\). In this convention, the value at the join is \(f(c)=r(c)\). The general continuity condition is that the left-hand limit equals the value at the join:

$$ \lim_{x\to c^-}g(x)=f(c)=r(c). $$

The right-hand limit must also equal \(f(c)\). If \(r\) is continuous from the right at \(c\), then \(\lim_{x\to c^+}r(x)=r(c)=f(c)\) already holds. If \(g\) is continuous at \(c\) as a branch formula, then the left condition reduces to \(g(c)=r(c)\). Without that continuity assumption, simply equating the branch formulas at \(c\) is not enough.

For differentiability, the left and right difference quotients at \(c\) must have finite, equal limits:

$$ \lim_{x\to c^-}\frac{g(x)-f(c)}{x-c} = \lim_{x\to c^+}\frac{r(x)-f(c)}{x-c}. $$

When the branch formulas extend continuously and differentiably to \(c\), and their values match there, these limits are their one-sided slopes \(g'(c)\) and \(r'(c)\). In that common setting, the practical equations are:

$$ g(c)=r(c) \qquad\text{and}\qquad g'(c)=r'(c). $$
Practical rule: For differentiable branch formulas at the join, first impose value matching, then impose slope matching. Both equations must hold. The function value at \(c\) must be the common matched value.

A Derivation from the Difference Quotient

The two matching conditions are not arbitrary. They follow directly from the definition of the derivative. Suppose the branch formulas extend to \(c\), are differentiable there, and \(f(c)=r(c)\). If the left branch also has \(g(c)=r(c)\), then for \(x<c\),

$$ \frac{f(x)-f(c)}{x-c} = \frac{g(x)-g(c)}{x-c}. $$

As \(x\to c^-\), this quotient approaches \(g'(c)\). For \(x>c\),

$$ \frac{f(x)-f(c)}{x-c} = \frac{r(x)-r(c)}{x-c}, $$

which approaches \(r'(c)\) as \(x\to c^+\). The two-sided derivative exists precisely when these one-sided limits are finite and equal. Thus value matching makes the quotients measure the branch slopes at the same function value, and slope matching makes their limits agree.

Why continuity is necessary: Differentiability implies continuity. At a piecewise join, a value mismatch prevents continuity, so no choice of equal slopes can make the function differentiable there.

Worked Example: Solve for a Unique Pair of Parameters

Worked Example: Solve for a Unique Pair of Parameters

Find \(a\) and \(b\) so that the function below is differentiable at \(x=1\):

$$ f(x)= \begin{cases} ax+b, & x<1,\\ x^2+1, & x\ge 1. \end{cases} $$

Step 1: Match the values. The right branch gives \(f(1)=1^2+1=2\). The left branch approaches \(a+b\) as \(x\to1^-\). Continuity requires

$$ a+b=2. $$

Step 2: Match the slopes. For the left branch, its difference quotient at \(1\) is

$$ \frac{(ax+b)-(a+b)}{x-1} = \frac{a(x-1)}{x-1} = a, \qquad x\ne1. $$

Its left-hand limit is therefore \(a\). For the right branch, the difference quotient is

$$ \frac{(x^2+1)-2}{x-1} = \frac{x^2-1}{x-1} = \frac{(x-1)(x+1)}{x-1} = x+1, \qquad x\ne1. $$

As \(x\to1^+\), this approaches \(2\). Slope matching gives \(a=2\).

Step 3: Solve. Substitute \(a=2\) into \(a+b=2\):

$$ 2+b=2 \quad\Longrightarrow\quad b=0. $$

Check: At \(x=1\), the function value from the right is \(2\), and the left branch tends to \(2(1)+0=2\). The left difference quotient is \(2\), and the right difference quotient tends to \(2\). Therefore \(f'(1)=2\), so the function is differentiable at the join.

Worked Example: A Family of Valid Parameters

Worked Example: A Family of Valid Parameters

For which values of \(a\) and \(b\) is the following function differentiable at \(x=2\)?

$$ f(x)= \begin{cases} ax, & x<2,\\ x^2+bx+4, & x\ge2. \end{cases} $$

Step 1: Match the values. The left-hand value approaches \(2a\). At the join, the right branch gives

$$ f(2)=2^2+2b+4=8+2b. $$

Thus continuity requires \(2a=8+2b\).

Step 2: Match the slopes using difference quotients. The left branch has slope \(a\), since \(\frac{ax-a(2)}{x-2}=a\). For the right branch, the difference quotient at \(2\) is

$$ \frac{(x^2+bx+4)-(8+2b)}{x-2} = \frac{x^2+bx-4-2b}{x-2} = \frac{(x-2)(x+2+b)}{x-2} = x+2+b. $$

As \(x\to2^+\), the right-hand slope approaches \(4+b\). Hence slope matching requires \(a=4+b\).

Step 3: Solve the system. The value equation is \(2a=8+2b\), or \(a=4+b\). This is exactly the slope equation. Therefore there is not a unique pair: every pair satisfying \(a=4+b\) works.

Check with one choice: Let \(b=1\), so \(a=5\). Both branch values at the join are \(10\): the left limit is \(5(2)=10\), and the right value is \(4+2+4=10\). The left slope is \(5\), and the right difference quotient approaches \(4+1=5\). Thus this choice is differentiable at \(x=2\), with derivative \(5\).

Worked Example: When No Parameters Can Work

Worked Example: When No Parameters Can Work

Determine whether any values of \(a\) and \(b\) make this function differentiable at \(x=2\):

$$ f(x)= \begin{cases} ax+1, & x<2,\\ x^2+bx+4, & x\ge2. \end{cases} $$

Step 1: Write the value condition. The left limit at \(2\) is \(2a+1\). The function value from the right branch is \(4+2b+4=8+2b\). Continuity requires

$$ 2a+1=8+2b. $$

Step 2: Write the slope condition. The left branch has slope \(a\). The right difference quotient is

$$ \frac{(x^2+bx+4)-(8+2b)}{x-2} = x+2+b, $$

so its limit at \(2\) is \(4+b\). Slope matching requires \(a=4+b\).

Step 3: Test whether the equations are compatible. Substituting \(a=4+b\) into the value equation gives

$$ 2(4+b)+1=8+2b \quad\Longrightarrow\quad 9+2b=8+2b \quad\Longrightarrow\quad 9=8. $$

This is impossible. Therefore no choices of \(a\) and \(b\) make the function differentiable at \(x=2\). The contradiction shows that even though parameters can be chosen to match slopes, the value requirement cannot be met at the same time.

Check: The failed equation \(9=8\) does not depend on the parameter values, so there is no exceptional choice left to test.

A Common Mistake: Matching Slopes but Not Values

Consider \(f(x)=x\) for \(x<0\) and \(f(x)=x+1\) for \(x\ge0\). Both branches have slope \(1\). A mistaken argument might say, “The slopes agree, so the function is differentiable at \(0\).” But the left-hand limit is \(0\), while \(f(0)=1\). The function is not continuous at \(0\), and therefore it is not differentiable there.

$$ \lim_{x\to0^-}f(x)=0 \ne f(0)=1. $$

The correction is to check the value condition before concluding differentiability. Equal one-sided slopes are not sufficient when the function has a jump at the join.

A Reliable Procedure for Choosing Parameters

1
Identify the join and the assigned value.
For the convention \(x<c\) and \(x\ge c\), the right branch determines \(f(c)\). Use limits to check the other side.
2
Write the continuity equation.
Set the left-hand limit equal to \(f(c)\); also ensure the right-hand limit equals \(f(c)\).
3
Find each one-sided slope.
Use the difference quotient at the join, or the branch derivative when the branch is differentiable there.
4
Write the slope equation and solve.
Combine it with the value equation. The system may have one solution, many solutions, or no solution.
5
Verify the result.
Substitute the parameter values into the function values and the one-sided slope limits.

Why the Method Matters

Parameter conditions turn a visual idea—two pieces meeting smoothly—into a precise algebra problem. The value equation controls whether the graph joins continuously. The slope equation controls whether its local rates of change agree. Solving both gives a reliable test rather than a guess based on the appearance of a graph.

Always state what the equations mean and check the resulting parameters in the original piecewise definition. A system may be inconsistent, as in the third example, or dependent, as in the second. Either outcome is mathematically meaningful.

Check Your Understanding

For each question, distinguish the value condition from the slope condition.

  1. For \(f(x)=ax+1\) when \(x<1\), and \(f(x)=x^2+b\) when \(x\ge1\), write the equations required for differentiability at \(x=1\).
  2. Why is \(g(c)=r(c)\) not, by itself, the general continuity condition for a piecewise join?
  3. Can two branches have equal one-sided slopes while the piecewise function is not differentiable? Explain with a value mismatch.
  4. What does it mean if the value and slope equations reduce to the same equation?
  5. What must be checked after solving parameter equations?

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
Clinical Biostats