Skip to main content
Mathematics LibreTexts

3.2: Numeric Derivatives and Limits

  • Page ID
    83925
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \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{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    In the previous section, we looked at marginal functions, the difference between \(f(x+1)\) and \(f(x)\text{.}\) For functions that are only defined at integer values, this is the obvious way to define a rate of change. However for functions that are defined on an interval, we would like to use the information at values closer to our value of \(x\text{.}\)

    Intuitively, we would like to be able to zoom in on the graph of \(f(x)\) at a point until the graph looks like a straight line, then pick two points on that line, and find the slope as the rise over the run. The rate of change is then the slope of the line we have found. If we could zoom arbitrarily far, this process would give an instantaneous rate of change, or the derivative of the function at that point.

    Definition \(3.2.1\): Formal Derivative at a Point.

    For a function \(f(x)\text{,}\) the instantaneous rate of change of \(f(x)\) at \(x=x_0\text{,}\) or the derivative of \(f(x)\text{,}\) at \(x=x_0\text{,}\) denoted as \(f'(x)\text{,}\) is defined as

    \[ f'(x_0 )=\lim_{(\Delta x\to 0)}\frac{f(x_0+\Delta x)-f(x_0)}{\Delta x}\text{,} \nonumber \]

    where \(\lim_{ x\to a}f(x)\) is understood to be value that \(f(x)\) gets arbitrarily close to by making \(x\) arbitrarily close to \(a\text{.}\)

    The symbol \(\Delta\) is the captial Greek letter Delta, which is commonly used to signify change in the sciences. Since we can't easily enter Greek letters into an Excel worksheet, we will use del x to represent \(\Delta x\) in Excel.

    Our task in this section is to turn our intuitive notion and definition and into a process that lets us find the value, and to find it efficiently.

    Example 3.2.2: A Simple Derivative at a Point.

    Let \(f(x)=x^2\text{.}\) We would like to find \(f'(1)\text{.}\)

    Figure \(3.2.3.\) Video presentation of this example

    Solution

    Solution. 1 Solution A

    We start with our intuitive notion. We want to look at the graph of \(f(x)\text{,}\) zoomed in far enough that the graph looks like a straight line. I set up a worksheet to look at the graph of \((x)=x^2\) near \(x_0=1\text{.}\) Since I want to be able to zoom in, I set up the graph so that it plots points that are multiples of \(\Delta x\) from \(x=x_0\text{.}\) I also want to plot the line connecting the points \((x_0,f(x_0))\) and \((x_0,f(x_0+\Delta x))\) and notice that the slope of the secant line between them is

    \[ \frac{f(x_0+\Delta x)-f(x_0 )}{\Delta x}\text{.} \nonumber \]

    For this example \(x_0=1\text{.}\) If \(\Delta x=1\text{,}\) we can see that the function and the secant line are clearly distinct.

    clipboard_e3714cd5d9eb25a3edebe32426e8ab561.png

    The worksheet is designed to make it easy to change the value of \(\Delta x\text{.}\)

    clipboard_e442171008bf3f72cd2d9b20fce12afe1.png

    As we can see, if we let \(\Delta x=1\text{,}\) the slope is 3, but we have not zoomed in far enough for the graph of \(f(x)\) to look like a straight line. Letting \(\Delta x=0.01\text{,}\) the slope is 2.01, and the graphs of the function and secant line seem to be the same.

    clipboard_e1482fbe6ce0ed81493e72c6840ad7fb6.png

    With some experimentation, taking both positive and negative values of \(\Delta x\text{,}\) we get the following table of values:

    \(\Delta x\) slope \(\ \ \ \) \(\Delta x\) slope
    1 3 \(\ \ \ \) -1 1
    0.1 2.1 \(\ \ \ \) -0.1 1.9
    0.01 2.01 \(\ \ \ \) -0.01 1.99
    0.001 2.001 \(\ \ \ \) -0.001 1.999

    It is clear that as \(\Delta x\) gets very small, the slope of the tangent line gets closer and closer to 2. Thus \(f'(1)=2\text{.}\)

    Solution. 2 Solution B

    The method of the first solution takes too much work and requires us to reset a worksheet and keep track of the slope as we try a number of values for \(\Delta x\text{.}\) We would like to create a worksheet that simply shows the values of the slope of the secant line for values of \(\Delta x\) and takes the value that this approaches. We can set up a worksheet where each line takes \(\Delta x\) from the previous line and divides by 10.

    clipboard_e5219c772ab217dd3d641bee857d92c56.png

    We get the same value whether we start \(\Delta x\) at 1 or -1. Once again, we find \(f'(1)=2\text{.}\)

    Solution. 3 Solution C

    This method of finding the derivative still has a number of difficulties. In the example above, the exact answer we want (in this case 2) did not show up in any of our computations. We also find that if we make \(\Delta x\) too small, we run into a problem called round off error. If the next chapter we will look at methods that compute derivatives symbolically, but for this chapter we want an easy method of approximation. We will use the approximation technique that is used by most graphing calculators when they compute the derivative. They use a “balanced difference quotient” where we find the slope of the secant line between points \(\Delta x\) before and after the point we are interested in. As the picture below shows, compared to either the right secant or the left secant, for most functions the balanced secant is closer to being parallel to the tangent line.

    clipboard_eaf0ca9d31be3f152c3a1593c30f9d23e.png

    We will use the default on calculators, that is we will use \(\Delta x = 0.001\text{.}\)

    clipboard_e66b4af50399980c1b4074b69904110cf.png

    For our example this gives our familiar result that \(f'(1)=2\text{.}\)

    We formalize this last approach.

    Definition \(3.2.4\): Calculator Approximation of the Derivative.

    \[ f'(x)\approx\frac{f(x+.001)-f(x-0.001)}{.002}\text{.} \nonumber \]

    For the rest of this text, when we need to compute a numerical approximation to the derivative we will use the calculator approximation of the derivative.

    We should note that the calculator rule is an approximation technique, rather than a definition. It will give a misleading answer for functions that do not approximate a straight line in a window that is 0.002 wide. In this course, the approximation will only cause a problem with functions that have corners or cusps, like the functions \(f(x)=|x|\) and \(f(x)=x^{(2/3)}\) at \(x=0\text{.}\) The main advantage of the using the calculator rule is that it is straightforward enough to compute to allow us to plot a function and its derivative on a single graph. This allows us to compare the graph of the function with the graph of the derivative.

    Figure \(3.2.5.\) Video presentation of the next two examples

    Example 3.2.6: A Function and its Derivative.

    Compare the graph of \(f(x)=x^2-2 x+1\) and the graph of its derivative, using separate axes for the two graphs. What features of the graph of \(f(x)\) can be located by using the graph of \(f'(x)\text{?}\)

    Solution

    Since this problem will serve as a template for a question we will look at many times, it is worthwhile to look at it in detail. We start by setting up a workbook that will have the structure we need to compute a chart of values for \(f(x)\) and \(f'(x)\text{.}\)

    clipboard_ed1e6b33c42c407c552c44719246508e3.png

    The picture above gives the minimal amount we need to type in. The rest will be done with quick filling. The entry of cell B1 gives the formula for the function. In cell D5 we evaluate the function using the first value of \(x\) from cell A5. We have two values of \(x\) in cells A5 and A6 so that we can quick fill to get a list of \(x\) values. We use absolute references for \(\Delta x\text{,}\) so it will not change on quick fills. We then fill cells E5 and F5 from cell D5, then fill row 6 from row 5, then fill the rest of the chart from rows 5 and 6.

    clipboard_e436743ace22c18d520d01ddd19df1e17.png

    It is then a straightforward task to plot the two curves. We notice that the graph of the function is a parabola. If the derivative is negative, the graph of \(f(x)\) is decreasing. If the derivative is positive, the graph of the function \(f(x)\) is increasing. The graph of \(f(x)\) reaches its minimum at the vertex, which is also where \(f'(x)=0\text{.}\) We also notice that the derivative of this parabola seems to be a straight line.

    Several of our observations from this example work in general. Looking at a single point, the derivative of a function is the slope of the line tangent to the graph at that point. The tangent line is a best linear approximation to the graph at a point. Looking at the derivative at lots of points, the graph of a function is increasing when the derivative is positive, and the graph of a function is decreasing when the derivative is negative. For the graph to have a point that is locally a maximum or minimum, the derivative cannot be positive or negative, so the derivative must either be zero or undefined for the graph of the function to have a maximum or minimum. Finding places where functions reach their highest and lowest values is an important activity in mathematics. We will look at these applications in more depth in upcoming sections. The reader is warned that we can have places where the derivative is zero but the function is still increasing or decreasing.

    Example 3.2.7: The Derivative of a More Complicated Function.

    Compare the graph of \(f(x)=x^3 (x^2-36)\) and the graph of its derivative, using separate axes for the two graphs. What features of the graph of \(f(x)\) can be located by using the graph of \(f'(x)\text{?}\)

    Solution

    The setup for this example is very similar to the last problem.

    clipboard_e0508a8c20ba782759cb5406a7e145568.png

    This time we notice three places where the derivative seems to be zero, when \(x\) is near \(-5\text{,}\) \(0\text{,}\) and \(5\text{.}\) We use goal seek on the derivative and find that the derivative is zero when \(x=-4.648\text{,}\) 0, or 4.648. Looking at the graph of f(x) at those points, we see that \(f(x)\) has a maximum when \(x=-4.648\text{,}\) and a minimum when \(x=-4.648\text{.}\) When \(x=0\text{,}\) \(f(x)\) is neither a maximum nor a minimum.

    In the next chapter we will look at ways to find the derivative of a function symbolically. We can already reason our way to symbolically finding the derivative of simple functions. If our function \(f(x)\) is constant or linear, then the graph of the function is its own tangent line, so the derivative is simply the slope of the graph. For quadratic functions we noticed that the graph of the derivative seems to be linear. If we can guess the form of the derivative, we can use trendlines to produce a formula.

    Example 3.2.8: Using Trendlines to get the Formula of a Derivative.

    Figure \(3.2.9\). Video presentation of this example

    Use trendlines to find a formula for the derivative of \(f(x)=2x^2+5x-7\text{.}\)

    Solution

    The setup for this example is very similar to the last problem. We simply change the function. This involves changing the formulas in cells B1 and D5, then using quick copy to change the formulas for the cells in columns D through F.

    clipboard_e54b35ee186a4a06a6f627c2b6e2b60dc.png

    Once we have points for the derivative we add a trendline using a linear model. We set the options to show both the formula for the trendline and the value of \(R^2\text{.}\) The fact that \(R^2=1\text{,}\) indicates the trendline we found exactly fits the data. In the workbook connected to this section there is a page for Example 6B. It uses parameters for the coefficients on a quadratic formula, so that you can explore the derivative of a general quadratic function.

    A Note on Terminology.

    It is worthwhile to point out some ambiguity in the terms used in this section and the previous section. We have been using the term \(\marginal f(x+1)\) for the change \(f(x+1)-f(x)\text{,}\) where \(f(x)\text{,}\) might be revenue, or cost, or profit. This is the standard definition of a marginal function from finance or economics. However, if you do a web search on “calculus marginal revenue” you will find that most calculus books treat the marginal function as simply another name for the derivative. While they are related, they are not the same thing. In the next chapter we will find that it is often easier to produce a formula for the derivative of a function rather than the related marginal function, which is why the derivative is used for the marginal function. However, in this text, we will stick to the correct definition of marginal functions.

    Summary.

    The notion of derivative is one of the key concepts of calculus. The concept of the derivative of a function is closely connected to the concept of marginal function. We gave three ways of understanding the derivative of a function at a point.

    Intuitive understanding

    The derivative of \(f(x)\text{,}\) at \(x=x_0\) denoted as \(f'(x_0)\text{,}\) is the slope of the line obtained by zooming in on the graph at \((x_0,f(x_0 ))\) until it looks like a straight line.

    Formal definition

    The derivative of \(f(x)\text{,}\) denoted as \(f'(x)\text{,}\) is defined as

    \[ f'(x)=\lim_{\Delta x\to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}\text{.} \nonumber \]

    The calculator approximation

    The derivative of \(f(x)\text{,}\) can be approximated using the formula

    \[ f'(x)\approx \frac{f(x+.001)-f(x-0.001)}{.002}\text{.} \nonumber \]

    class="

    Exercises: Numeric Derivatives and Limits

    • For each specified function and x-value, do the following:
    1. Find a value of \(\Delta x\) small enough that graph of the function looks like a straight line on the region from \(5*\Delta x\) before the x-value to \(5*\Delta x\) after the x-value. Graph the function in this region and find the slope of the corresponding secant line
    2. Estimate the derivative by finding the slope of the secant when \(\Delta x\) takes the values 0.1, 0.01, 0.001, 0.0001, -0.1, -0.01, -0.001, and -0.0001. Give a value of the limit of the slope.
    3. Use the calculator estimate to estimate the slope of the tangent.
    4. Compare the value of the derivative \(f'(x)\) with the corresponding value of the marginal function \(marginal\ f(x+1)\text{.}\)

    Comment: For problems 1-10 it makes sense to set up the table once with parameters that can be easily changed between problems.

    clipboard_e94bca8555157325b5b5107f70f560d13.png

    Excel Commands

    clipboard_e23a4aab726fcfd8bf3db085bd83be18b.png

    Excel Output

    Change \(\Delta x\) (delx) and \(x\)-value given depending on the problem, and adjust the function and the rest will autofill. Once the graph has been added that will update as well.

    Exercise 1:

    Use \(f(x)=x^2+3\) at \(x=2\text{.}\)

    Answer
    1. Using Slope= (B14-B4)/(10*B1) we get the following
      clipboard_ef104b7aefe1c55e72bd07a4b6a8e077c.png

    So the slope for this choice of delx is 4.

    Your may have chosen a slightly different \(\Delta x\text{,}\) and as long as the graph looks roughly linear that would be fine.


    This page titled 3.2: Numeric Derivatives and Limits is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Mike May, S.J. & Anneke Bart via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.