Tutorials › AP Calculus › One-Sided Derivative Tests at Piecewise Joins

Differentiability and Continuity · Tutorial 113 of 999

One-Sided Derivative Tests at Piecewise Joins

Use one-sided difference quotients at a piecewise join to determine whether a finite derivative exists.

Beginner 9 min read

What You'll Learn

  • Write the left- and right-hand difference quotients at a piecewise join.
  • Use the function's actual value at the join in both quotients.
  • Compute one-sided limits directly from the relevant branch formulas.
  • Decide whether the one-sided derivatives exist as finite values.
  • Apply the criterion that the two finite one-sided derivatives must agree.
  • Recognize why a zero denominator at the initial substitution is not a differentiability test.

Testing a Piecewise Join

A piecewise formula can change at a particular input \(c\). The formula on the left of \(c\) may differ from the formula on the right, and the value assigned at \(c\) may be specified separately. To decide whether the function has a derivative at the join, examine how the function changes from each side using difference quotients.

The essential test is precise: the left-hand and right-hand difference quotients must each approach a finite value, and those values must be equal. Comparing branch formulas informally, or merely checking that the function is continuous, does not settle the derivative question.

Definition: Suppose \(f\) is defined on an interval containing \(c\). Its left-hand derivative at \(c\), if it exists as a finite real number, is the limit of \(\frac{f(c+h)-f(c)}{h}\) as \(h\to 0^-\). Its right-hand derivative is the corresponding limit as \(h\to 0^+\). The two-sided derivative \(f'(c)\) exists if and only if both one-sided derivatives exist as finite real numbers and are equal.

Here \(h\) is the increment from \(c\), so \(c+h\) is the input being compared with \(c\). When \(h<0\), the input is to the left of \(c\); when \(h>0\), it is to the right. In either quotient, the numerator must use the actual value \(f(c)\), not a value obtained by extending whichever branch seems convenient.

Set Up the Quotients Before Taking Limits

Suppose a piecewise function uses a formula \(L(x)\) for \(x<c\), a formula \(R(x)\) for \(x>c\), and assigns the value \(f(c)\) at the join. The two tests are

$$ \lim_{h\to 0^-}\frac{L(c+h)-f(c)}{h} \qquad\text{and}\qquad \lim_{h\to 0^+}\frac{R(c+h)-f(c)}{h}. $$

The left quotient uses \(L\) because \(c+h<c\) when \(h<0\). The right quotient uses \(R\) because \(c+h>c\) when \(h>0\). After simplifying each quotient, evaluate its limit from the indicated side. A finite limit on only one side is not enough for a two-sided derivative.

If the one-sided limits are finite and equal, their common value is \(f'(c)\). If they are finite but unequal, the two-sided derivative does not exist. If either one-sided limit fails to exist as a finite real number, the two-sided derivative also does not exist.

Worked Example: Matching Finite One-Sided Derivatives

Worked Example: Matching Finite One-Sided Derivatives

Let \(f(x)=x^2\) for \(x\leq 1\), and \(f(x)=2x-1\) for \(x>1\). Test differentiability at the join \(c=1\).

First, the value at the join comes from the branch that includes \(x=1\):

$$ f(1)=1^2=1. $$

For \(h<0\), \(1+h<1\), so the left branch applies. Its difference quotient is

$$ \frac{f(1+h)-f(1)}{h} = \frac{(1+h)^2-1}{h} = \frac{1+2h+h^2-1}{h} = \frac{2h+h^2}{h} = 2+h. $$

Therefore the left-hand derivative is

$$ \lim_{h\to 0^-}(2+h)=2. $$

For \(h>0\), \(1+h>1\), so the right branch applies. The quotient is

$$ \frac{f(1+h)-f(1)}{h} = \frac{[2(1+h)-1]-1}{h} = \frac{2+2h-1-1}{h} = \frac{2h}{h} = 2. $$

Thus the right-hand derivative is \(\lim_{h\to 0^+}2=2\). Both one-sided derivatives exist as finite values and agree, so

$$ f'(1)=2. $$

As a check, the left quotient simplifies to \(2+h\), which approaches \(2\) from the left, and the right quotient is identically \(2\) for \(h>0\). Both calculations use \(f(1)=1\), as required.

Why Agreement Gives the Derivative

The two-sided derivative is defined by one limit in which \(h\) can approach zero through either negative or positive values. A two-sided limit exists with value \(m\) exactly when the limits from both sides exist and are equal to \(m\). The derivative quotient is a particular function of \(h\), namely \(\frac{f(c+h)-f(c)}{h}\), so the same limit criterion applies directly.

Theorem: At an interior point \(c\), \(f'(c)\) exists as a finite real number if and only if both one-sided difference-quotient limits exist as finite real numbers and have the same value. When they agree, their common value is \(f'(c)\).

To justify the criterion, write \(Q(h)=\frac{f(c+h)-f(c)}{h}\) for nonzero \(h\) sufficiently close to zero. If the two-sided limit of \(Q(h)\) is \(m\), then restricting \(h\) to negative values or positive values leaves that limit unchanged. Consequently, both one-sided limits exist and equal \(m\).

Conversely, suppose the left-hand limit and right-hand limit of \(Q(h)\) both equal the same finite number \(m\). Given any positive tolerance \(\varepsilon\), the left-hand limit ensures that \(Q(h)\) is within \(\varepsilon\) of \(m\) for all negative \(h\) sufficiently close to zero. The right-hand limit ensures the same for all positive \(h\) sufficiently close to zero. Choose a positive bound small enough to satisfy both conditions. Then whenever \(0<|h|\) is smaller than that bound, either \(h<0\) or \(h>0\), and in either case \(|Q(h)-m|<\varepsilon\). This is the definition of the two-sided limit \(Q(h)\to m\), so \(f'(c)=m\).

Worked Example: Finite One-Sided Derivatives That Do Not Agree

Worked Example: Finite One-Sided Derivatives That Do Not Agree

Let \(g(x)=x^2\) for \(x\leq 0\), and \(g(x)=3x\) for \(x>0\). Test differentiability at \(c=0\).

The value at the join is \(g(0)=0^2=0\). For \(h<0\), use the left branch:

$$ \frac{g(0+h)-g(0)}{h} = \frac{h^2-0}{h} = h. $$

Its left-hand limit is \(\lim_{h\to 0^-}h=0\). For \(h>0\), use the right branch:

$$ \frac{g(0+h)-g(0)}{h} = \frac{3h-0}{h} = 3. $$

Its right-hand limit is \(\lim_{h\to 0^+}3=3\). Both limits are finite, but \(0\neq 3\). Therefore \(g'(0)\) does not exist. The quotients show that the function's change per unit increment approaches different values on opposite sides of the join.

Check the conclusion against the criterion: a derivative requires equal finite one-sided limits, while these are \(0\) and \(3\). The criterion fails, so there is no two-sided derivative at \(0\).

Worked Example: A Failure to Obtain a Finite Limit

Worked Example: A Failure to Obtain a Finite Limit

Let \(p(x)=x+1\) for \(x<0\), and \(p(x)=x^2\) for \(x\geq 0\). Test differentiability at \(c=0\).

The value at the join is \(p(0)=0^2=0\). For \(h<0\), the left branch gives

$$ \frac{p(0+h)-p(0)}{h} = \frac{(h+1)-0}{h} = \frac{1}{h}+1. $$

As \(h\to 0^-\), \(\frac{1}{h}\) decreases without bound, so the quotient does not approach a finite real number. In particular, the left-hand derivative does not exist as a finite value. No calculation of the right-hand derivative can make the two-sided derivative exist. Thus \(p'(0)\) does not exist.

For completeness, the right-hand quotient is

$$ \frac{p(0+h)-p(0)}{h} = \frac{h^2-0}{h} = h \qquad (h>0), $$

and its limit is \(0\). The right-hand limit is finite, but the left-hand limit is not; the required pair of equal finite one-sided values is absent. This example also illustrates why it is important to test both sides rather than stop after finding one finite limit.

A Common Mistake: Substituting Zero Too Soon

A difference quotient has \(h\) in its denominator. Directly setting \(h=0\) therefore produces division by zero, often in an expression that appears to be \(0/0\). That does not show that the derivative fails to exist; it means the quotient must be simplified before taking the limit.

For example, for the left branch \(x^2\) at \(c=1\), the incorrect calculation is

$$ \frac{(1+h)^2-1}{h} \mathrel{\overset{\text{wrong}}{=}} \frac{0}{0} \quad\Longrightarrow\quad \text{the derivative does not exist}. $$

The correction is to expand and factor while \(h\neq 0\):

$$ \frac{(1+h)^2-1}{h} = \frac{2h+h^2}{h} = 2+h. $$

Now the one-sided limit is \(\lim_{h\to 0^-}(2+h)=2\). The quotient is evaluated for nonzero \(h\), then its limit is taken; the increment is never set equal to zero inside the original fraction.

A Reliable Test at a Join

For a piecewise function at an interior join, organize the calculation in this order:

1
Find the join value.
Evaluate the branch that defines \(f(c)\), or use an explicitly assigned value. Keep this value in both numerators.
2
Choose the branch on each side.
Use the left formula when \(h<0\) and the right formula when \(h>0\).
3
Simplify each quotient.
Do the algebra for nonzero \(h\) before taking either limit.
4
Evaluate and compare.
Each one-sided limit must be finite, and the two resulting values must be equal.

Continuity at the join is necessary for differentiability at an interior point: if the difference quotient has a finite limit, then \(f(c+h)-f(c)\) is the product of \(h\) and a quantity approaching a finite number, so this difference approaches zero. But continuity alone does not ensure that the two one-sided quotients agree. The quotient test checks the stronger condition directly.

Why the Test Matters

A piecewise function may have different formulas on either side while still having a derivative at the join. What matters is not whether the formulas look alike, but whether their difference quotients approach the same finite value. Conversely, a shared function value at the join does not guarantee matching slopes. The one-sided test turns both questions into explicit limits, with a clear decision at the end.

Check Your Understanding

For each question, set up the relevant difference quotient before deciding whether the derivative exists.

  1. For a join at \(c\), which branch formula belongs in the left-hand quotient when \(h<0\)?
  2. Suppose the left- and right-hand difference quotients approach \(4\) and \(4\). What is \(f'(c)\), and why?
  3. Suppose the one-sided limits are finite but equal to \(-2\) and \(5\). Does \(f'(c)\) exist?
  4. Why is substituting \(h=0\) into the original difference quotient not a valid derivative test?
  5. If one one-sided quotient has no finite limit, can the two-sided derivative exist? Explain using the criterion.

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