Derivative Function Limits

by
K. D.  Stroyan
University of Iowa

copyright 1997 by Academic Press, Inc. - All rights reserved.

Special Mathematica Functions used in this NoteBook

Needs["Graphics`Colors`"];

\(\(fctLimit[f_, g_, a_, b_]\  := \ 
      Module[{functions, graylevels}, 
		
        \(Do[functions = 
            Table[\((f[x + 1\/2\^i] - f[x])\)\ 2\^i, {i, n, 1, \(-1\)}]; 
          AppendTo[functions, g[x]]; 
	
          graylevels = Table[{GrayLevel[j]}, {j, 0.5\/n, 0.5, 0.5\/n}]; 
          AppendTo[graylevels, Red]; 
          \(Plot[Evaluate[functions], {x, a, b}, 
            PlotStyle -> graylevels, AspectRatio -> 1, 
            PlotRange -> {g[\((a + b)\)/2] - \((b - a)\)/2, 
                g[\((a + b)\)/2] + \((b - a)\)/2}]; \)
		, {n, 1, 7}]; 
        \)]; \)\)

Notebook Overview

This NoteBook shows the function limit

(lim_(Δx -> 0)) (f[x + Δx] - f[x])/Δx = f'[x]
		
that defines the derivative.  You need to type the function f[x] as well as your guess g[x] for the limit.  The pre-computed case is for

y = f[x] = (x^3)  and  dy = g[x] dx = 3 (x^2) dx

Run the animation for  y = (x^3) and then try this yourself.

(To animate, highlight the cell containing the graphs and
press <Command> + <y>  at the same time.)

References to the Text

This NoteBook goes with Chapter 5 of the text.

f'[x] = (Underscript[Limit, Δx -> 0])[(f[x+Δx]-f[x])/Δx] = 3 (x^2),
when  f[x] = (x^3)

The next cell graphs the difference quotient functions for several values of  dx  getting closer to 0.  You can run an animation on the output by highlighting the cell containing the graphs and pressing <Command> and <y> (or choosing "Animate Selected Graphics" from the Graph menu.)

\(Clear[f, g, x, a, b]; 
f[x_] := x\^3; 
\(g[x_] := 3\ x\^2; \)\)a = -1.5; \(b = 1.5; 
Print["Convergence of the function"]; 

    \(Print["F[x] = (f[x+dx]-f[x])/dx to g[x]"]; \)\)\(Print["over the interval [", a, ",", b, "]"]; 

    fctLimit[f, g, a, b]; \)

The next cell plots the difference between the difference quotient and the symbolic derivative.  This difference is the microscopic gap  ϵ  plotted as a function of the focus point of a microscope of power  1/dx.

Clear[epsilon];
epsilon[x_,dx_] := ((f[x+dx] - f[x])/dx - f'[x])
dx = N[1/2^7];
Print["Error between \!\(Δf\/Δx\)[x] & f'[x] "];
Print["over the interval [",a,",",b,"]"];
Print["when  Δx = ",dx];
Plot[ epsilon[x,dx] , {x,a,b}];

Exercises

Exercises 5.2.1: Epsilon as the microscope moves

Run the fctLimit[f,g,a,b] function and plot epsilon[x] as above for the functions:

y = 
      f[x] = (x^2)  =>  (dy/dx) = g[x]  = 2 (x^1)

y = 
      f[x] = (x^4)  =>  (dy/dx) = g[x] = 4 (x^3)

y = 
      f[x] = (1/x)  =>  (dy/dx) = 
          g[x] = -(1/(x^2))

y = 
      f[x] = (1/(x^2))  =>  (dy/dx) = 
          g[x] = -(2/(x^3))

y = 
      f[x] = (Sqrt[x])  =>  (dy/dx) = 
          g[x] = (1/(2 (Sqrt[ x])))

y = 
      f[x] =  
        (x^(1/3))  =>  (dy/dx) = 
          g[x] = (1/(3 (( (x^2))^(1/3))))

Try the interval  [a,b] = [-1,2]  with each function and where something goes wrong, explain why the approximation is not valid, change [a,b] to a valid interval and note where in the valid interval the worst error occurs.

\(Clear[f, g, x, a, b]; 
f[x_] := \@x\%3; 

    g[x_] := 1\/\(3 \@\( x\^2\)\%3\); 
a = \(-1. \); 
b = 2. ; 

    Print["Convergence of the function"]; 

    \(Print["F[x] = (f[x+dx]-f[x])/dx to g[x]"]; \)\)\(Print["over the interval [", a, ",", b, "]"]; 

    fctLimit[f, g, a, b]; \)

\(Clear[epsilon]; 

    epsilon[x_, dx_]\  := \ 
      \((\((f[x + dx]\  - \ f[x])\)/dx\  - \ g[x])\)\)\(dx\  = \ N[1/2^7]; 

    Print["Error between Δ(f/Δ)x[x] & f'[x] "]; 
Print["over the interval [", a, ",", b, "]"]; 

    Print["when  Δx = ", dx]; 

    Plot[\ epsilon[x, dx]\ , \ {x, a, b}]; \)

Exercises CD5.3.4: Epsilon as the microscope moves

Run the fctLimit[f,g,a,b] function and plot epsilon[x] as above for the functions:

y = 
      f[x] =  Sin[x] =>  (dy/dx) = g[x] = Cos[x]

y = 
      f[x] =  
        Cos[x] =>  (dy/dx) = g[x] = -Sin[x]

y = 
      f[x] =  
        Tan[x] =>  (dy/dx) = 
          g[x] = (1/(((Cos[x]))^2))

Try the interval  [a,b] = [-π,2π]  with each function and where something goes wrong, explain why the approximation is not valid, change [a,b] to a valid interval and note where in the valid interval the worst error occurs.

Exercises 5.4.6: Epsilon as the microscope moves

Run the fctLimit[f,g,a,b] function and plot epsilon[x] as above for the functions:

y = 
      f[x] =  
        (e^x) =  
          Exp[x] =>  (dy/dx) = 
            g[x] = (e^x) = Exp[x]

y = f[x] =  Log[x] =>  (dy/dx) = g[x] = (1/x)

Try the interval  [a,b] = [-1,2]  with each function and where something goes wrong, explain why the approximation is not valid, change [a,b] to a valid interval and note where in the valid interval the worst error occurs.