Limits

Gordon McClarren

Introduction

The goal of this lesson is to become familiar with limits.  We know that some functions have values for which they are undefined.  What happens as the function gets close to these values?  This can be investigated by looking at the graphs of the functions, or making a table of values near the undefined point. Since limits are important part of Calculus, Mathematica has a limit function.  

To find the slope of the tangent line to a curve, the limit of the secant will be investigated as the two points approach each other.  This limit will be defined as the derivative of a function.

The use of Mathematica also has the goal of become more proficient will the commands of the program.

Preliminary

Run the following to generate colors when needed

<< "Graphics`Colors`";

1. When to find a limit

You want to find a limit when the function is undefined at a point. For example given the rational function f(x) = (((x^2) - 7  x + 12)/((x^2) - 16)), which is undefined when the denominator is equal to zero.  Though this can be solved easily with Algebra, we can use Mathamatica.

Solve[(x^2) - 16 == 0, x]

We find that the function is not defined at x=-4 and x=4.  Graphing the function might give some indication what is happing at these to values of x.

f[x_]:= (((x^2) - 7  x + 12)/((x^2) - 16));
Plot[f[x], {x, -6, 6}, 
        PlotStyle -> Red];

Our graph shows that the functions seems to go to +∞ or -∞ at  x = -4  but does not show what it does at  x = 4. If the function is graphed around x=4 a better idea might be pictured.

Plot[f[x], {x, 3, 5}, PlotStyle -> Red];

It appears that f(4) ≈ 0.11.  If f(4) is evaluated an error is obtained.

f[4]

A table of values from 3.0 to 3.9 could be made

nfunct =Table[{n, f[n]}, {n, 3, 3.9,  .1}]

Rather than use a linear scale lets let x get closer to 4 by factors or 10.

m[x_] := 4 - (10^(-x))\(			nfunct\  = Table[{N[m[n]], N[f[m[n]]]}, {n, 1, 6}]\)

\(TextForm
    \`It\ appears\ that\ our\ function\ gets\ close\ to\ 0.125\ or\ 1\/8\ as\ 
      x\ gets\ close\ to\ 4\ from\ numbers\ less\ than\ 4. \ \ What\ happens\ 
      as\ x\ gets\ close\ to\ 4\ from\ numbers\ larger\ than\ 4. \)

m[x_] := 4 + (10^(-x))\(			nfunct\  = Table[{N[m[n]], N[f[m[n]]]}, {n, 1, 6}]\)

Again it gets close to 0.125 or (1/8) .   We can write then     (Underscript[Lim, x -> 4])(((x^2) - 7 x + 12)/((x^2) - 16))=(1/8)Mathematica can be used to find a limit using

Limit[f[x], x -> 4]

Try it

Given f(x) =(((x^2) + 15 x  + 56)/((x^2) - 2 x - 63))
\(	
        a . \ Use\ Mathematica\ to\ find\ values\ of\ x\ where\ this\ function
          \ is\ undefined . 
		
	b . \ Investigate\ the\ nature\ of\ the
          \ function\ by\ graphing . 
		
	c . \ Find\ the\ limit\ of\ the
          \ funtion\ by\ letting\ x\ get\ close\ to\ the\ undefined\ values\ 
          with\ a\ table . 
		
	d . \ Use\ Mathematica\ to\ find\ our\ 
          \(limit . \)\)

Paste your ansters below this line

2.  Another example of a limit.

The function f(x) = Sin[x]/x is undefined when x = 0.  The graph the function near x=0.

Clear[f, x, m, n]f[x_] :=  Sin[x]/xPlot[f[x], {x, -π, π}, PlotStyle -> Red, 
      AxesOrigin -> {0, 0}];

The curve gets close to 1.  Now try it with a table of values.

m[x_] := 0 - (10^(-x))nfunct  = Table[{N[m[n]], N[f[m[n]]]}, {n, 1, 6}]

Or from greater than 0.

m[x_] := 0 + (10^(-x))nfunct  = Table[{N[m[n]], N[f[m[n]]]}, {n, 1, 6}]

Both table indicate that f(x) is getting close to 1 as x gets clsee to 0. Mathematica Limits funtion gives

Limit[f[x], x -> 0]

Try it

Investigate the following funtions by graphing, tables and the limit function

	a.  f(x) =(1 - Cos[x])/x
	
	b. f(x) = Sin[3  x]/x  
	
	c.  f(x) = (((Sqrt[x + 4]) - 2)/x)

Paste your answers below this line

3. One Sided Limits

Sometimes a function does not approach the same value when x approaches the discontinuity from each side. For example:

Clear[f, x]f[x_] := Abs[x]/xPlot[f[x], {x, -2, 2}, PlotStyle -> Green];

Not that as x gets closer to zero from the left hand side the function has a value of -1, and from the right hand side a value of 1. Mathematica has a limit function with will calculate one sided limits.

Limit[f[x],x -> 0,Direction -> 1]

Limit[f[x],x -> 0,Direction -> -1]

Direction->1 tells the x to approach zero from vlues less than 0, and Direction->-1 from values greater than 0.

Does the function f(x) = (Sqrt[x - 1]) have a limit from both sides?

Clear[f, x]f[x_]:=(Sqrt[x - 1])	Limit[f[x], x -> 1, Direction -> -1]

\(\(	Limit[f[x], x -> 1, Direction -> 1]\)\)

Though Mathematica  gives the limit from both directions if the function is plotted we observed that it is not defined less than 1

Plot[f[x], {x, 1, 3}, PlotStyle -> Red];

As show earlier the function f (x) =(((x^2) - 7  x + 12)/((x^2) - 16)) was discontinuous at x = \(\(-4. \)\ \ 
			What\ is\ its\ limt\ at\ x = 
            \(-\(4.  . \)\)\)

Clear[f, x]f[x_]:= (((x^2) - 7  x + 12)/((x^2) - 16))	Limit[f[x], x -> -4, Direction -> 1]Limit[f[x], x -> -4, Direction -> -1]Limit[f[x], x -> -4]

Note: Mathematica  gave the lower limit when we did not specify which direction.

Try it

Use Mathematica  to determine where the following functions are discontinuous, and if the limit is the same from each side of the discontinuity.

	a.  f(x) = (x/(Sqrt[x - 4]))  
	
	b.   f(x)=sin((1/x))
	
	c. f(x)=((|(x^2) - 4 | )/(x^2))
                
	
	d.   xsec(x)

Paste your answers below this line

4.Limits of Secants

\(TextForm
    \`If\ we\ want\ to\ find\ the\ tangent\ to\ the\ curve\ f \((x)\)\  = \ 
      \(x\^2\ at\ the\ points\ x = 
        \(1\ we\ could\ approximate\ the\ line\ by\ finding\ the\ secant\ line
            \ between\ x\  = 
          \(1\ and\ x = 
            2.  The\ red\ line\ represents\ the\ secant\ and\ the\ blue\ line
              \ the\ tangent . Execute\ the\ following\ Mathematica\ 
              \(program . \)\)\)\)\)

\(\(Clear[f, g, t, y, m]; 
f[x_] := x\^2; 
m = 2; 

    fplot\  = \ 
      Plot[f[x], {x, 0.5, 2}, PlotStyle -> Green, 	
        DisplayFunction -> Identity]; 

    tplot\  = \ 
      Plot[{2  x - 1}, {x, 0.5, 2}, PlotStyle -> Blue, 	
        DisplayFunction -> Identity]; 
	
    plot1 = Graphics[Text["A", {0.9, 1}], 
		
        DisplayFunction -> Identity]; 

    Show[fplot, 
      Plot[{\((m\^2 - 1)\)/\((m - 1)\)*\((x - 1)\) + 1}, {x, 0.5, 2}, 
		
        PlotStyle -> Red, 	DisplayFunction -> Identity], tplot, 
      ListPlot[{{1, 1}, {m, f[m]}}, 

        PlotStyle -> {Cobalt, PointSize[0.03]}, 	
        DisplayFunction -> Identity], plot1, 
      Graphics[Text["B", {m -  .1, f[m]}], 
		
        DisplayFunction -> Identity], 
      DisplayFunction -> $DisplayFunction]; 
\)\)

Now if point B is allowed to approach A along the curve the secant approaches the tangent. Execute the following and annimate (Ctrl y).

\(\(Clear[f, g, t, y, m]; 
f[x_] := x\^2; 

    fplot\  = \ 
      Plot[f[x], {x, 0.5, 2}, PlotStyle -> Green, 	
        DisplayFunction -> Identity]; 

    tplot\  = \ 
      Plot[{2  x - 1}, {x, 0.5, 2}, PlotStyle -> Blue, 	
        DisplayFunction -> Identity]; 
	
    plot1 = Graphics[Text["A", {0.9, 1}], 
		
        DisplayFunction -> Identity]; 

    Table[Show[fplot, 
        Plot[{\((m\^2 - 1)\)/\((m - 1)\)*\((x - 1)\) + 1}, {x, 0.5, 2}, 
		
          PlotStyle -> Red, 	DisplayFunction -> Identity], tplot, 
        ListPlot[{{1, 1}, {m, f[m]}}, 

          PlotStyle -> {Cobalt, PointSize[0.03]}, 	
          DisplayFunction -> Identity], plot1, 
        Graphics[Text["B", {m -  .1, f[m]}], 
		
          DisplayFunction -> Identity], 
        DisplayFunction -> $DisplayFunction], {m, 2, 1.2, \(-0.2\)}]; 

    \)\)

\(TextForm
    \`The\ slope\ of\ the\ secant\ can\ be\ found\ using\ the\ formula\ 
      \(f \((1 + h)\) - f \((1)\)\)\/h\)

Clear[h]Table[ ((f[1 + h] - f[1])/h), {h, 1,  .2, - .2}]

Execute the following. With amimation you can see how the slope of the secant changes as point B approaches point A.

\(\(Clear[f, g, t, y, m]; 
f[x_] := x\^2; 

    fplot\  = \ 
      Plot[f[x], {x, 0.5, 2}, PlotStyle -> Green, 	
        DisplayFunction -> Identity]; 

    tplot\  = \ 
      Plot[{2  x - 1}, {x, 0.5, 2}, PlotStyle -> Blue, 	
        DisplayFunction -> Identity]; 
	
    plot1 = Graphics[Text["A", {0.9, 1}], 
		
        DisplayFunction -> Identity]; 

    Table[Show[fplot, 
        Plot[{\((m\^2 - 1)\)/\((m - 1)\)*\((x - 1)\) + 1}, {x, 0.5, 2}, 
		
          PlotStyle -> Red, 	DisplayFunction -> Identity], tplot, 
        ListPlot[{{1, 1}, {m, f[m]}}, 

          PlotStyle -> {Cobalt, PointSize[0.03]}, 	
          DisplayFunction -> Identity], plot1, 
        Graphics[Text["B", {m -  .1, f[m]}], 	
          DisplayFunction -> Identity], 
	
        Graphics[
          Text[" = Slope of the Secant " \((f[m] - 1)\)/\((m - 1)\), {
              1.6, \(-1\)}], 	DisplayFunction -> Identity], 
        DisplayFunction -> $DisplayFunction], {m, 2, 1.2, \(-0.2\)}]; 

    \)\)

\(TextForm
    \`If\ we\ take\ the\ limit\ of\ \(\(f \((1 + h)\) - f \((1)\)\)\/h\) as\ h
      \ approaches\ 0\)

Limit[((f[1 + h] - f[1])/h), h -> 0]

This limit is called the derivative of f(x) at x=1.

Try it

Find the slope of the following functions at x = 1 using the (Underscript[Lim, h⟶0])((f(1 + h) - f(1))/h).

	a.  f(x) = 3(x^2)-5x+8.
	
	b.  f(x) = (1/x)
	
	c.  f(x) = sin(x)cos(x)

Paste your answers below this line

5. The Derivative as a Limit

When we evaluated  (Underscript[Lim, h⟶0])((f(1 + h) - f(1))/h) we are finding the derivative of f(x) at		 x = 1.   We could define the derivative at x=c as follows f '(c)= (Underscript[Lim, h⟶0])((f(c + h) - f(c))/h)	To find the derivative of f (x)  =  
          4  (x^2) - 3  x + 2 at x = 4.

\(Clear[f, x, h]; 
f[x_] := \ 4  x\^2 - 3  x + 2\ ; 
c = 2; 

    Limit[\(f[c + h] - f[c]\)\/h, h -> 0]\)

A function for the slope of the tangent line can be obtained by replacing c with the variable x.  f ' (x)= (Underscript[Lim, h⟶0])((f(x + h) - f(x))/h) This is called the derivative of f(x) given the symbols,
 f '(x),(dy/dx), y'.

\(Clear[f, x, h]; 
f[x_] := \ 4  x\^2 - 3  x + 2\ ; 
c = 2; 

    Limit[\(f[x + h] - f[x]\)\/h, h -> 0]\)

Since the derivative of a function is such important function Mathematica has a funtion f '[x] that will find the derivate without having to use the limit formula.

f'[x]

\(Clear[f, x]; 
f[x_]\  = \ Sin[x]*Tan[x]; 
\(f'\)[x]\)

Try it

1. Find the derivativeof the following by using the limit process f' (x)= (Underscript[Lim, h⟶0])((f(x + h) - f(x))/h) and verify your answer with   f '(x) function.
 	
 		a.  f(x) = 4(x^3)-6(x^2)+8x+9
 		
 		b. f(x) = ((((x^2) + 2  x + 5))^5)
 		
 		c. f(x) = (((x + 3))^7)(((3  x - 2))^8)
 		
 		d.  f(x) =(Sqrt[(x^2) + 7])
 		
 		e.  f(x)=(sin^4)(x)(cos^6)(x)

Paste your answers below this line