Tutorials › Real Analysis › One-Sided Derivatives

Differentiation · Tutorial 407 of 1000

One-Sided Derivatives

Learn how one-sided difference quotients capture behavior from each direction and how their limits determine differentiability.

Advanced 9 min read

What You'll Learn

  • Define right and left derivatives using one-sided limits of the difference quotient
  • Compute one-sided derivatives at endpoints and interior points
  • Decide differentiability by comparing finite left and right derivatives
  • Analyze piecewise functions with different slopes on either side of a point
  • Use one-sided derivative signs to test necessary conditions at a local maximum or minimum

Slopes from Each Direction

The derivative of a function at an interior point uses increments approaching zero from both sides. The previous tutorial showed how the absolute-value function can have different limiting slopes on the two sides of a point, preventing an ordinary derivative from existing. To describe this behavior precisely, we separate the difference quotient into its right-hand and left-hand limits.

This distinction is also useful at endpoints. A function defined on a closed interval has no domain points beyond either endpoint, so an ordinary two-sided derivative there is not defined by the usual interior-point definition. A one-sided derivative can still describe the slope as we approach from within the interval.

Definition (One-Sided Derivatives): Let \(f\) be defined on an interval \(I\), and let \(a\in I\). If \(I\) contains points greater than \(a\) arbitrarily close to \(a\), the right derivative of \(f\) at \(a\), when it exists as a finite real number, is $$ f'_+(a)=\lim_{h\to0^+}\frac{f(a+h)-f(a)}{h}. $$ If \(I\) contains points less than \(a\) arbitrarily close to \(a\), the left derivative of \(f\) at \(a\), when it exists as a finite real number, is $$ f'_-(a)=\lim_{h\to0^-}\frac{f(a+h)-f(a)}{h}. $$

The notation \(h\to0^+\) means that \(h\) approaches zero through positive values; \(h\to0^-\) means it approaches through negative values. In either quotient, \(h\) is nonzero and \(a+h\) must belong to the domain. At an interior point of an interval, both one-sided derivatives can be considered. At a left endpoint only the right derivative is available, and at a right endpoint only the left derivative is available.

The sign of the denominator matters. For negative \(h\), the left difference quotient still uses the same numerator \(f(a+h)-f(a)\) as the ordinary derivative, but divides by a negative increment. One should not replace the left quotient by a quotient with denominator \(|h|\): that would change its sign and would no longer be the left derivative.

Computing One-Sided Derivatives

Worked Example: A Right Derivative at an Endpoint

Let \(f:[0,3]\to\mathbb{R}\) be given by \(f(x)=3x^2-2x\). At the left endpoint \(a=0\), only a right derivative is defined relative to this domain. For \(h>0\) sufficiently small, \(0+h\in[0,3]\), and

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

As \(h\to0^+\), the expression \(3h-2\) tends to \(-2\). Therefore \(f'_+(0)=-2\). The computation uses only points to the right of zero, as required by the domain.

Worked Example: Different Slopes at a Join

Define \(g:\mathbb{R}\to\mathbb{R}\) by

$$ g(x)= \begin{cases} 2x+1,&x\leq 1,\\ 4x-1,&x>1. \end{cases} $$

At \(a=1\), both formulas give the same function value: the first gives \(2(1)+1=3\), and the second approaches \(4(1)-1=3\). For \(h<0\), \(1+h\leq1\), so the left difference quotient is

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

Thus \(g'_-(1)=2\). For \(h>0\), \(1+h>1\), and the right difference quotient is

$$ \frac{g(1+h)-g(1)}{h} = \frac{[4(1+h)-1]-3}{h} = \frac{4h}{h} =4. $$

Thus \(g'_+(1)=4\). The two one-sided slopes exist but differ, so they cannot be the two sides of a single derivative.

Worked Example: Matching One-Sided Slopes

Define \(q:\mathbb{R}\to\mathbb{R}\) by

$$ q(x)= \begin{cases} (x-2)^2,&x\leq2,\\ (x-2)^2+(x-2)^3,&x>2. \end{cases} $$

At \(a=2\), the function value is \(q(2)=0\). If \(h<0\), then

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

If \(h>0\), then

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

The left quotient tends to zero as \(h\to0^-\), and the right quotient tends to zero as \(h\to0^+\). Both one-sided derivatives are therefore zero. The formulas for \(q\) differ on the two sides, but their first-order slopes at the join agree.

When Do the One-Sided Derivatives Give a Derivative?

At an interior point, the two one-sided limits together determine the two-sided limit. The key requirement is that both one-sided derivatives exist as finite real numbers and have the same value. If either side is missing or the values differ, the ordinary derivative does not exist.

Theorem (Two-Sided Derivative Criterion): Let \(I\) be an interval, let \(a\) be an interior point of \(I\), and let \(f:I\to\mathbb{R}\). The derivative \(f'(a)\) exists if and only if both \(f'_-(a)\) and \(f'_+(a)\) exist as finite real numbers and are equal. When they are equal, $$ f'(a)=f'_-(a)=f'_+(a). $$

Proof. Suppose first that \(f'(a)=L\) exists. By definition,

$$ \lim_{h\to0}\frac{f(a+h)-f(a)}{h}=L. $$

A two-sided limit has the same value when restricted to positive increments and when restricted to negative increments. Therefore \(f'_+(a)=L\) and \(f'_-(a)=L\); both exist and are equal.

Conversely, suppose both one-sided derivatives exist and equal \(L\). We verify the two-sided limit from its definition. Let \(\varepsilon>0\). Because the right-hand limit is \(L\), there is a number \(\delta_+>0\) such that whenever \(0<h<\delta_+\),

$$ \left|\frac{f(a+h)-f(a)}{h}-L\right|<\varepsilon. $$

Because the left-hand limit is also \(L\), there is a number \(\delta_->0\) such that whenever \(-\delta_-<h<0\),

$$ \left|\frac{f(a+h)-f(a)}{h}-L\right|<\varepsilon. $$

Set \(\delta=\min\{\delta_+,\delta_-\}\). For every \(h\) with \(0<|h|<\delta\), either \(h>0\) or \(h<0\), and the corresponding inequality applies. Hence

$$ \left|\frac{f(a+h)-f(a)}{h}-L\right|<\varepsilon. $$

This is exactly the definition of the two-sided difference quotient tending to \(L\). Thus \(f'(a)\) exists and equals \(L\), proving the criterion. \(\square\)

The theorem makes a useful distinction: existence of two one-sided derivatives is not enough by itself. Their equality is essential. Conversely, matching one-sided slopes establish differentiability even if the defining formulas differ on either side, as in the example for \(q\).

One-Sided Slopes at Local Extrema

One-sided derivatives also give necessary conditions for a local maximum or minimum. At an interior local maximum, values to either side are no greater than the value at the point. The signs of the difference quotients then point in opposite directions because the left quotient has a negative denominator.

Theorem (One-Sided Derivative Signs at a Local Maximum): Suppose \(a\) is an interior point of an interval \(I\), and \(f\) has a local maximum at \(a\). If the one-sided derivatives exist as finite real numbers, then $$ f'_-(a)\geq0 \qquad\text{and}\qquad f'_+(a)\leq0. $$

Proof. Since \(a\) is a local maximum, there is a \(\delta>0\) such that \(f(a+h)\leq f(a)\) whenever \(|h|<\delta\) and \(a+h\in I\). For \(0<h<\delta\), the numerator \(f(a+h)-f(a)\) is nonpositive and the denominator \(h\) is positive. Therefore

$$ \frac{f(a+h)-f(a)}{h}\leq0. $$

Taking the right-hand limit preserves this inequality, so \(f'_+(a)\leq0\). For \(-\delta<h<0\), the numerator is still nonpositive, but the denominator is negative. Thus

$$ \frac{f(a+h)-f(a)}{h}\geq0. $$

Taking the left-hand limit gives \(f'_-(a)\geq0\). Both conclusions follow. \(\square\)

At a local minimum the inequalities reverse: the numerator is nonnegative on both sides, so the left quotient is nonpositive and the right quotient is nonnegative. These conditions are necessary, not sufficient; signs of one-sided derivatives alone do not guarantee a local extremum without additional information.

Worked Example: A Corner at a Local Minimum

Let \(r(x)=|x-3|\), and consider \(a=3\). Since \(r(3)=0\) and \(r(x)\geq0\) for every \(x\), \(r\) has a local (indeed, global) minimum at \(3\). For \(h<0\), \(3+h<3\), so \(r(3+h)=-(h)= -h\). Hence

$$ \frac{r(3+h)-r(3)}{h} = \frac{-h}{h} =-1, \qquad h<0. $$

For \(h>0\), \(r(3+h)=h\), and therefore

$$ \frac{r(3+h)-r(3)}{h} = \frac{h}{h} =1, \qquad h>0. $$

Thus \(r'_-(3)=-1\) and \(r'_+(3)=1\), consistent with the reversed inequalities for a local minimum. Since the values differ, the Two-Sided Derivative Criterion also shows that \(r\) is not differentiable at \(3\).

Reading the Result Carefully

One-sided derivatives answer directional questions, while the ordinary derivative requires agreement between the two directions. At an endpoint, the available one-sided derivative can describe the slope from within the domain, but it does not by itself constitute a two-sided derivative. At an interior point, a mismatch rules out differentiability; agreement of finite one-sided limits proves it.

A common error is to infer differentiability from a graph that appears to have a single tangent direction, or from formulas that look similar near the joining point. The difference quotients provide the precise test. Another error is to use the local-extremum sign conditions as if they were sufficient. They are necessary consequences of an extremum, but a derivative sign pattern or further information is needed to establish that an extremum actually occurs.

Check Your Understanding

Use the definitions and results in this tutorial to answer the following.

  1. Which increments are used to define the left derivative at an interior point?
  2. At an interior point, what condition on the two one-sided derivatives is equivalent to existence of the ordinary derivative?
  3. If the one-sided derivatives of a function at a point are \(3\) and \(3\), what is the ordinary derivative there, provided both limits exist?
  4. At an interior local maximum, why is the left difference quotient nonnegative while the right difference quotient is nonpositive?
  5. What does a right derivative at the left endpoint of a closed interval describe, and why is it not a two-sided derivative?