Tutorials › Real Analysis › Differentiation and Approximation

Differentiation · Tutorial 458 of 1000

Differentiation and Approximation

Use derivative information to build a linear approximation and quantify how far it can be from the function.

Advanced 9 min read

What You'll Learn

  • Interpret the derivative as the slope of a local affine approximation
  • Bound approximation error using the variation of the derivative
  • Derive a quadratic error estimate when the derivative is Lipschitz
  • Apply error bounds to square-root, logarithmic, and exponential approximations
  • Distinguish a useful error estimate from a claim of exact equality

A Derivative Gives a Local Linear Model

The derivative records the limiting slope of secant lines, but it is also useful as a practical approximation tool. Near a point \(a\), the affine function with value \(f(a)\) and slope \(f'(a)\) is a natural model for \(f\). The central question is not only whether this model becomes accurate as \(x\) approaches \(a\), but also how large its error can be at a specified distance from \(a\).

Write \(h=x-a\). The affine approximation to \(f(a+h)\) is \(f(a)+f'(a)h\), and the approximation error is

$$ E_a(h)=f(a+h)-f(a)-f'(a)h. $$

When \(f\) is differentiable at \(a\), the definition of derivative says that \(E_a(h)/h\) tends to zero as \(h\) tends to zero through nonzero values. Earlier in the course, Taylor’s Theorem in Peano form expressed this first-order approximation as a remainder that is negligible compared with \(h\). Here we will obtain a more quantitative estimate: the error can be bounded in terms of how much the derivative varies between \(a\) and \(a+h\).

Definition: The first-order affine approximation to \(f\) at \(a\) is \(L_a(x)=f(a)+f'(a)(x-a)\). Its error at \(x\) is \(f(x)-L_a(x)\). A quantitative error bound estimates the absolute value of this difference in terms of the distance \(|x-a|\) and additional information about \(f'\).

Error Controlled by Derivative Variation

The Mean Value Theorem turns derivative information into a bound on increments. Apply it not directly to \(f\), but to the difference between \(f\) and its affine approximation. That difference is zero at \(a\); its derivative measures exactly the change in slope from \(f'(a)\).

Theorem (Derivative-Oscillation Error Bound): Let \(J\) be an open interval, let \(f:J\to\mathbb{R}\) be differentiable, and let \(a,x\in J\) with \(x\ne a\). If \(K\geq0\) satisfies \(|f'(t)-f'(a)|\leq K\) for every \(t\) between \(a\) and \(x\), then $$ |f(x)-f(a)-f'(a)(x-a)|\leq K|x-a|. $$ In particular, one may take \(K=\sup\{|f'(t)-f'(a)|:t\text{ lies between }a\text{ and }x\}\) whenever this supremum is finite.

Proof. Define \(R(t)=f(t)-f(a)-f'(a)(t-a)\) on the closed interval with endpoints \(a\) and \(x\). The function \(R\) is continuous on that interval and differentiable in its interior, since \(f\) is differentiable on \(J\). Also, \(R(a)=0\) and \(R'(t)=f'(t)-f'(a)\). The Mean Value Theorem gives a point \(c\) strictly between \(a\) and \(x\) such that

$$ R(x)-R(a)=R'(c)(x-a). $$

Since \(R(a)=0\), taking absolute values yields

$$ |f(x)-f(a)-f'(a)(x-a)| =|f'(c)-f'(a)|\,|x-a| \leq K|x-a|. $$

This proves the claimed estimate. The argument works whether \(x>a\) or \(x<a\): the Mean Value Theorem applies on the interval with endpoints \(a\) and \(x\), and the absolute value accounts for either order. \(\square\)

The estimate shows how local changes in slope affect the accuracy of the tangent-line model. If the derivative stays close to \(f'(a)\) throughout the segment, the approximation error is small. In particular, if \(f'\) is continuous at \(a\), then for every positive \(\varepsilon\) there is a neighborhood of \(a\) on which \(|f'(t)-f'(a)|<\varepsilon\). The theorem then gives an error at most \(\varepsilon|x-a|\) within that neighborhood.

Worked Example: Approximating a Square Root Near Four

Take \(f(x)=\sqrt{x}\) and \(a=4\). The derivative is \(f'(x)=1/(2\sqrt{x})\), so the affine approximation is

$$ L_4(x)=2+\frac{x-4}{4}. $$

We can get a quadratic error bound on the whole interval \([1,9]\). For \(u,v\in[1,9]\), rationalizing the difference gives

$$ \left|\frac{1}{2\sqrt{u}}-\frac{1}{2\sqrt{v}}\right| =\frac{|u-v|}{2\sqrt{u}\sqrt{v}(\sqrt{u}+\sqrt{v})} \leq\frac{|u-v|}{4}. $$

The inequality holds because \(\sqrt{u}\geq1\), \(\sqrt{v}\geq1\), and \(\sqrt{u}+\sqrt{v}\geq2\). Thus \(f'\) is Lipschitz with constant \(1/4\) on \([1,9]\). The quadratic estimate proved below gives

$$ \left|\sqrt{x}-2-\frac{x-4}{4}\right| \leq\frac{(x-4)^2}{8},\qquad 1\leq x\leq9. $$

For example, at \(x=5\), the approximation is \(2+1/4=9/4\), and the error is at most \(1/8\). This is a bound, not an identity: the estimate guarantees that the true value lies within \(1/8\) of \(9/4\).

Lipschitz Derivatives Give Quadratic Error

The previous estimate is linear in the distance, multiplied by a bound on the derivative’s variation. If that variation itself is at most a constant times the distance, the resulting approximation error is quadratic. This is a useful quantitative version of the idea that a slowly changing slope produces a particularly accurate tangent-line model.

Theorem (Quadratic Error Bound for a Lipschitz Derivative): Let \(J\) be an open interval, let \(f:J\to\mathbb{R}\) be differentiable, and suppose \(f'\) is \(L\)-Lipschitz on \(J\), meaning \(|f'(u)-f'(v)|\leq L|u-v|\) for all \(u,v\in J\). Then for every \(a,x\in J\), $$ |f(x)-f(a)-f'(a)(x-a)|\leq\frac{L}{2}|x-a|^2. $$

Proof. If \(x=a\), both sides are zero. Suppose \(x\ne a\). As in the preceding proof, apply the Mean Value Theorem to \(R(t)=f(t)-f(a)-f'(a)(t-a)\) on the interval with endpoints \(a\) and \(x\). For some \(c\) strictly between them,

$$ |R(x)|=|f'(c)-f'(a)|\,|x-a|. $$

The Lipschitz condition gives \(|f'(c)-f'(a)|\leq L|c-a|\). Because \(c\) lies between \(a\) and \(x\), we have \(|c-a|\leq|x-a|\). Therefore

$$ |R(x)|\leq L|c-a|\,|x-a| \leq L|x-a|^2. $$

This argument gives the bound with constant \(L\), but a sharper factor follows by applying the Mean Value Theorem to \(R\) on every subinterval from \(a\) to \(t\), or equivalently by accumulating the slope variation across the segment. For completeness, set \(d=|x-a|\) and divide the segment into \(n\) equal pieces with endpoints \(t_0=a,t_1,\ldots,t_n=x\). On each piece, the Mean Value Theorem gives

$$ R(t_j)-R(t_{j-1})=R'(\xi_j)(t_j-t_{j-1}) $$

for some \(\xi_j\) between \(t_{j-1}\) and \(t_j\). Since \(|R'(\xi_j)|=|f'(\xi_j)-f'(a)|\leq L|\xi_j-a|\), summing absolute values yields

$$ |R(x)|\leq \sum_{j=1}^{n}L|\xi_j-a|\frac{d}{n} \leq Ld^2\frac{1}{n}\sum_{j=1}^{n}\frac{j}{n} =\frac{Ld^2(n+1)}{2n}. $$

This inequality holds for every positive integer \(n\). Letting \(n\) tend to infinity gives \(|R(x)|\leq Ld^2/2\), as required. The estimates use only the Lipschitz bound and apply for either orientation of the interval. \(\square\)

There is another common way to obtain the hypothesis: if \(f''\) exists and \(|f''(t)|\leq L\) on an interval, the Mean Value Theorem applied to \(f'\) shows that \(f'\) is \(L\)-Lipschitz there. Thus the quadratic bound applies. This is an error estimate for the first-order affine approximation; it does not require writing down a second-order Taylor polynomial.

Worked Example: Approximating a Logarithm Near One

Let \(f(x)=\ln x\) and \(a=1\). Then \(f(1)=0\), \(f'(1)=1\), and the affine approximation at \(1\) is \(L_1(x)=x-1\). For \(x\in[1/2,3/2]\), the derivative \(f'(x)=1/x\) satisfies

$$ \left|\frac1u-\frac1v\right| =\frac{|u-v|}{uv} \leq4|u-v|,\qquad u,v\in[1/2,3/2], $$

because \(uv\geq1/4\). Hence \(f'\) is \(4\)-Lipschitz on this interval, and the quadratic bound gives

$$ |\ln x-(x-1)|\leq2(x-1)^2,\qquad \frac12\leq x\leq\frac32. $$

At \(x=5/4\), the affine approximation is \(1/4\). The guaranteed error is at most \(2(1/4)^2=1/8\). The interval restriction matters: this particular Lipschitz estimate was established only for inputs between \(1/2\) and \(3/2\).

Worked Example: Approximating the Exponential Near Zero

Let \(f(x)=e^x\) and \(a=0\). Since \(f(0)=1\) and \(f'(0)=1\), the affine approximation is \(1+x\). On \([-1,1]\), the derivative \(f'(x)=e^x\) is \(e\)-Lipschitz: for any \(u,v\) in this interval, the Mean Value Theorem applied to the exponential gives

$$ |e^u-e^v|=e^\xi|u-v|\leq e|u-v| $$

for some \(\xi\) between \(u\) and \(v\), since \(\xi\leq1\). Therefore

$$ |e^x-(1+x)|\leq\frac{e}{2}x^2,\qquad -1\leq x\leq1. $$

For \(x=1/4\), this gives \(|e^{1/4}-5/4|\leq e/32\). The estimate quantifies the accuracy of the linear model using only a bound on how quickly its slope can change.

Choosing the Right Error Estimate

The derivative-oscillation bound and the Lipschitz-derivative bound express related but different information. The first can be useful when the derivative is close to its value at \(a\), even if no uniform Lipschitz constant is known. The second is especially convenient when a single constant controls the change in slope throughout an interval.

Available informationResulting error control
\(|f'(t)-f'(a)|\leq K\) on the segmentError at most \(K|x-a|\)
\(|f'(u)-f'(v)|\leq L|u-v|\) on the intervalError at most \(\frac{L}{2}|x-a|^2\)

A common pitfall is to treat an approximation as an equality. The derivative determines the value and slope of the affine model at \(a\), but away from \(a\) the function may bend. An error bound describes that bend; it does not say the error vanishes. Another pitfall is to use a bound outside the interval on which its hypotheses were checked. Before applying either theorem, verify that the entire segment between \(a\) and \(x\) lies in the region where the derivative estimate holds.

1
Form the affine model.
At the base point \(a\), use \(f(a)+f'(a)(x-a)\).
2
Identify derivative information.
Estimate either the change from \(f'(a)\) along the segment or the Lipschitz constant of \(f'\) on the interval.
3
Apply the corresponding bound.
Derivative oscillation gives a bound proportional to distance; Lipschitz control gives a quadratic bound.
4
Check the domain and interval.
Ensure the whole segment from the base point to the input satisfies the assumptions used in the estimate.

Check Your Understanding

Use the derivative-based approximation ideas to answer these questions.

  1. What is the first-order affine approximation to \(f\) at \(a\)?
  2. In the derivative-oscillation error bound, which function is used with the Mean Value Theorem?
  3. If \(f'\) is \(L\)-Lipschitz, what power of \(|x-a|\) appears in the error estimate?
  4. Why must the interval between \(a\) and \(x\) lie within the region where the derivative bound is valid?
  5. Does a quadratic error bound imply that the affine approximation equals \(f(x)\) whenever \(x\ne a\)? Explain.