3.3: Estimating Derivatives
- Page ID
- 58566
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)In the preceding examples, lumping helped estimate integrals. Because integration and differentiation are closely related, lumping also provides a method for estimating derivatives. The method begins with a dimensional observation about derivatives. A derivative is a ratio of differentials; for example, \(df/dx\) is the ratio of \(df\) to \(dx\). Because \(d\) is dimensionless (Section 1.3.2), the dimensions of \(df/dx\) are the dimensions of \(f/x\).
This useful, surprising conclusion is worth testing with a familiar example: Differentiating height \(y\) with respect to time \(t\) produces velocity \(dy/dt\), whose dimensions of \(LT^{−1}\) are indeed the dimensions of \(y/t\).
What are the dimensions of \(d^{2}f/dx^{2}\)?
Secant Approximation
As \(df/dx\) and \(f/x\) have identical dimensions, perhaps their magnitudes are similar:
\[\frac{df}{dx} ∼ \frac{f}{x}. \label{3.13} \]
Geometrically, the derivative \(df/dx\) is the slope of the tangent line, whereas the approximation \(f/x\) is the slope of the secant line. By replacing the curve with the secant line, we make a lumping approximation.

Let’s test the approximation on an easy function such as \(f(x) = x\). Good news the secant and tangent slopes differ only by a factor of 2:
\[\frac{df}{dx} = 2x \text{ and } \frac{f(x)}{x} = x \label{3.14} \]
Investigate the secant approximation for \(f(x) = x^{n}\).
Use the secant approximation to estimate \(d^{2}f/dx^{2}\) with \(f(x) = x^{2}\). How does the approximation compare to the exact second derivative?
How accurate is the secant approximation for \(f(x) = x^{2} + 100\)?
The secant approximation is quick and useful but can make large errors. When \(f(x) = x^{2} + 100\), for example, the secant and tangent at \(x = 1\) have dramatically different slopes. The tangent slope df/dx is 2, whereas the secant slope f(1)/1 is 101. The ratio of these two slopes, although dimensionless, is distressingly large.
With \(f(x) = x^{2} + 100\), sketch the ratio
\[\frac{ \text{ secant slope }}{\text{ tangent slope } } \label{3.15} \]
as a function of \(x\). The ratio is not constant! Why is the dimensionless factor not constant? (That question is tricky.)
The large discrepancy in replacing the derivative \(df/dx\), which is
\[lim_{Δx \rightarrow 0} \frac{f(x) − f(x − Δx)}{Δx}, \label{3.16} \]
with the secant slope \(f(x)/x\) is due to two approximations. The first approximation is to take \(Δx = x\) rather than \(Δx = 0\). Then \(df/dx ≈ (f(x) − f(0))/x\). This first approximation produces the slope of the line from (0, f(0)) to (x, f(x)). The second approximation replaces f(0) with 0, which produces \(df/dx ≈ f/x\); that ratio is the slope of the secant from (0, 0) to (x, f(x)).
Improved Secant Approximation
The second approximation is fixed by starting the secant at (0, f(0)) instead of (0, 0).
With that change, what are the secant and tangent slopes when \(f(x) = x^{2} + C\)?
Call the secant starting at (0,0) the origin secant; call the new secant the \(x = 0\) secant. Then the \(x = 0\) secant always has one-half the slope of the tangent, no matter the constant \(C\). The \(x = 0\) secant approximation is robust against is unaffected by vertical translation.
How robust is the \(x = 0\) secant approximation against horizontal translation?
To investigate how the \(x = 0\) secant handles horizontal translation, translate \(f(x) = x^{2}\) rightward by 100 to make \(f(x) = (x − 100)^{2}\). At the parabola’s vertex \(x = 100\), the \(x = 0\) secant, from (0, 104) to (100, 0), has slope −100; however, the tangent has zero slope. Thus the \(x = 0\) secant, although an improvement on the origin secant, is affected by horizontal translation.
Significant-change Approximation
The derivative itself is unaffected by horizontal and vertical translation, so a derivative suitably approximated might be translation invariant. An approximate derivative is
\[\frac{df}{dx} ≈ \frac{f(x+ Δx) - f(x)}{Δx}, \label{3.17} \]
where \(Δx\) is not zero but is still small.
How small should \(Δx\) be? Is \(Δx = 0.01\) small enough?
The choice \(Δx = 0.01\) has two defects. First, it cannot work when x has dimensions. If x is a length, what length is small enough? Choosing \(Δx = 1 mm\) is probably small enough for computing derivatives related to the solar system, but is probably too large for computing derivatives related to falling fog droplets. Second, no fixed choice can be scale invariant. Although \(Δx = 0.01\) produces accurate derivatives when \(f(x) = \sin x\), it fails when \(f(x) = \sin 1000x\), the result of simply rescaling \(x\) to \(1000x\).
These problems suggest trying the following significant-change approximation:
\[\frac{df}{dx} ∼ \frac{\text{ significant }Δf \text{ (change in f) } at x}{\text{ Δx that produces a significant Δf }} \label{3.18} \]
Because the \(Δx\) here is defined by the properties of the curve at the point of interest, without favoring particular coordinate values or values of \(Δx\), the approximation is scale and translation invariant.

To illustrate this approximation, let’s try \(f(x) = \cos x\) and estimate \(df/dx\) at \(x = 3\pi/2\) with the three approximations: the origin secant, the \(x = 0\) secant, and the significant-change approximation. The origin secant goes from (0, 0) to (3\pi/2, 0), so it has zero slope. It is a poor approximation to the exact slope of 1. The \(x = 0\) secant goes from (0, 1) to (3\pi/2, 0), so it has a slope of \(−2/3 \pi\), which is worse than predicting zero slope because even the sign is wrong!

The significant-change approximation might provide more accuracy. What is a significant change in \(f(x) = \cos x\)? Because the cosine changes by 2(from −1 to 1), call 1/2 a significant change in \(f(x)\). That change happens when \(x\) changes from \(3\pi/2\), where \(f(x) = 0\), to \(3\pi/2 + \pi/6\), where \(f(x) = 1/2\). In other words, \(Δx\) is \(\pi/6\). The approximate derivative is therefore
\[\frac{df}{dx} ∼ \frac{\text{ significant Δf near x }}{Δx} ∼ \frac{1/2}{\pi/6} = \frac{3}{\pi}. \label{3.19} \]
This estimate is approximately 0.955 amazingly close to the true derivative of 1.
Problem 3.14 Derivative of a quadratic
With \(f(x) = x^{2}\), estimate df/dx at \(x = 5\) using three approximations: the origin secant, the \(x = 0\) secant, and the significant-change approximation. Compare these estimates to the true slope.
Problem 3.15 Derivative of the logarithm
Use the significant-change approximation to estimate the derivative of \(lnx\) at \(x = 10\). Compare the estimate to the true slope.
Problem 3.16 Lennard–Jones potential
The Lennard–Jones potential is a model of the interaction energy between two nonpolar molecules such as \(N_{2}\) or \(CH_{4}\). It has the form
\[V(r) = 4\mathcal{E} [ (\frac{\sigma}{r}^{12}) - (\frac{\sigma}{r}^{6})], \label{3.20} \]
where r is the distance between the molecules, and ε and σ are constants that depend on the molecules. Use the origin secant to estimate \(r_{0}\), the separation \(r\) at which \(V(r)\) is a minimum. Compare the estimate to the true \(r_{0}\) found using calculus.
Problem 3.17 Approximate maxima and minima
Let \(f(x)\) be an increasing function and \(g(x)\) a decreasing function. Use the origin secant to show, approximately, that \(h(x) = f(x) + g(x)\) has a minimum where \(f(x) = g(x)\). This useful rule of thumb, which generalizes Problem 3.16, is often called the balancing heuristic.

