Name:  Debbie J. Barnett
							Parkland Community College
							Modified:  Debra Woods  1/95

Title:  An Introduction to Limits

Description:  This project is intended to be used near the beginning of a traditional course in introductory Calculus.  Because the limit is in a sense the glue that holds all of the calculus together, it is important that students have a clear understanding of this topic.  This project is designed to provide the student with an intuitive feel for the limit by presenting a few common functions along with their graphs and tables of function values.  Examples include functions whose limits do not exist for certain values of the independent variable.  Mathematica is used to calculate limits so that students may verify their intuitive guesses as to what the limit should be in each example and animation is used to provide a visual feel for what is taking place in the function values as the independent variable moves closer to a particular value from either direction.

Debbie J. Barnett
Parkland Community College

A simple line

A rational function

A piecewise function

Something a little more exotic

The sine function

A damped sine function

Your assignment

A simple line

We will begin our study of limits by considering the function f defined by f(x) = 2x + 1.  The graph of f is shown below.

Needs["Graphics`Colors`"];

Clear[f,x]
f[x_] = 2x + 1

lineplot = 
	Plot[f[x],{x,0,6},
	PlotStyle->{Red},
	AxesLabel->{"x","y"}];

Let's calculate the values of f(x) for some values of x that are very close to but not equal to 3. The table below shows values
of x that are less than 3 along with the corresponding values of f(x).  This means that we are approaching 3 from the left.

TableForm[Table[{x,f[x]},{x,2.96,2.99,.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

From the table, it appears that if x is very close to 3 from the left, then 2x + 1 is very close to 7.  Let's watch a movie of a point moving along the x-axis toward 3 from the left.  The blue
lines will indicated the "height" of f as the point gets closer and 
closer to 3 from the left.  [Note to user:  all the graphics in this lesson are to be animated by pressing the apple key and then y.]

hpoint[x_] := Graphics[{Blue,PointSize[.02],Point[{x,0}]}]
vline[x_]  := Graphics[{Blue,Line[{{x,0},{x,f[x]}}]}]
hline[x_]  := Graphics[{Blue,Line[{{0,f[x]},{x,f[x]}}]}]

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,.95, 2.95,.25}]

Now let's calculate some values of f(x) for some values of x that are larger than 3 but very close to 3.

TableForm[Table[{x,f[x]},{x,3.04,3.01,-.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

As we approach 3 from the right it appears that 2x + 1 is very close to 7.  Let's watch a movie of a point on the x-axis moving 
toward 3 from the right.

hpoint[x_] := Graphics[{Blue,PointSize[.02],Point[{x,0}]}]
vline[x_]  := Graphics[{Blue,Line[{{x,0},{x,f[x]}}]}]
hline[x_]  := Graphics[{Blue,Line[{{0,f[x]},{x,f[x]}}]}]

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,4.25,2.25,-.25}]

We see that if x is very close in value to 3 from either side of 3, then 2x + 1 is very close to 7 in value.  We say that the limit of
f(x) = 2x + 1, as x approaches 3, is 7 and we write

																			lim ≈ À£  f(x) = 7 .

We can use Mathematica  to calculate limits for us.  Let's ask Mathematica to calculate this very easy limit for us and see if Mathematica also computes the limit to be 7.

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

So Mathematica does agree that the limit is 7.

A rational function

Let's look at a new function, say the  rational function
               f(x) = (x^2-4)/(x-2) ,
and see if we can compute the limit of f as x approaches 2 from either side.  Then we'll ask Mathematica to compute this same limit 
for us and see if we agree.  But first let's take a look at the graph of f.

Clear[f,x]
f[x_] = (x^2 -4)/(x-2)

Needs["Graphics`Colors`"];

lineplot = 
	Plot[f[x],{x,-1,5},
	PlotStyle->{Red},
	AxesLabel->{"x","y"}];

There is a hole in the graph at x = 2 since f is not defined for x = 2.  However, we can still compute the limit of f as x approaches 2 from either side, since when we compute a limit, we are not interested in f(2), only in the values of f for x very close to 2.  Let's look at a table of values of f as x gets very close to 2 from the left...

TableForm[Table[{x,f[x]},{x,1.96,1.99,.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

...and from the right.

TableForm[Table[{x,f[x]},{x,2.04,2.01,-.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

It appears that as x approaches 2 from either side, f(x) is approaching the value 4.  Let's watch movies of a point moving along the x-axis toward 2 from either side.  First, from the left...

hpoint[x_] := Graphics[{Blue,PointSize[.02],Point[{x,0}]}]
vline[x_]  := Graphics[{Blue,Line[{{x,0},{x,f[x]}}]}]
hline[x_]  := Graphics[{Blue,Line[{{0,f[x]},{x,f[x]}}]}]

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,.95,1.95,.25}];

...and from the right.

.

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,3.25,2.25,-.25}];

It does, then, appear from the graph that as x approaches 2 from either side, f(x) is approaching 4.  Let's ask Mathematica to compute this limit for us and see if Mathematica also arrives at 4 for the limit.

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

So Mathematica does agree that this limit is 4.  How could we have computed this on our own?  Start by factoring the numerator:
(x^2 -4)/(x-2) = (x+2)(x-2)/(x-2).  We can cancel the factor of x-2 that appears in both the numerator and the denominator.  This will not affect the limit that we are taking, since we are only interested in values of x close to 2 not x =2.  This leaves us with
x+2 and the limit of x + 2 as x approaches 2 is 4.

A piecewise function

Next let's consider the piecewise function 
					
							f(x) =  x/2 + 2,  if x < 2
               x + 4,    if x >= 2

Clear[f,x]

f[x_] := If[ x < 2, 1/2 x + 2 , 
            If[x > 2, x + 4, 6]]
left  = Plot[f[x],{x,0,1.9},
        DisplayFunction->Identity];


right = Plot[f[x],{x,2,4},

			PlotStyle->{Red},
			DisplayFunction->Identity];
 
lineplot = Show[left,right,
			DisplayFunction->$DisplayFunction,

			AxesLabel->{"x","y"}];

Let's once again examine a table of values of f, first as x approaches 2 from the left...

TableForm[Table[{x,f[x]},{x,1.5,1.9,.1}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

...and from the right.

TableForm[Table[{x,f[x]},{x,2.5,2.1,-.1}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

Wait a minute.  As x approaches 2 from the left, f(x) appears to be approaching the value 3 and as x approaches 2 from the right, f(x) appears to be approaching 6.  Let's ask Mathematica for help.

?Limit

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

Mathematica seems to be telling us that we arrive at two different limit values depending upon whether we are approaching x = 2 from the left or the right.  We can see from the tables that this is true.  Lim ≈ À™  f(x) from the left is 3 and lim ≈ À™  f(x) from the right is 6.  Since these two limits do not agree, we say that the lim ≈ À™  f(x) does not exist.

Let's watch the action as our blue point approaches x = 2 from the left...

hpoint[x_] := Graphics[{Blue,PointSize[.02],Point[{x,0}]}]
vline[x_]  := Graphics[{Blue,Line[{{x,0},{x,f[x]}}]}]
hline[x_]  := Graphics[{Blue,Line[{{0,f[x]},{x,f[x]}}]}]

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,.95,1.95,.25}];

...and from the right.

hpoint[x_] := Graphics[{Blue,PointSize[.02],Point[{x,0}]}]
vline[x_]  := Graphics[{Blue,Line[{{x,0},{x,f[x]}}]}]
hline[x_]  := Graphics[{Blue,Line[{{0,f[x]},{x,f[x]}}]}]

Table[

Show[lineplot,hpoint[t],hline[t],vline[t]],

{t,3.25,2.25,-.25}];

So now it's easy to see that this limit does not exist.  Let's see another example of a function that does not have a limit at a particular value of x.

Something a little more exotic

Let's try something a little more exotic this time.
How about f(x) = 1/x.  First, let's see the graph of f.

Clear[f,x]
f[x_] = (1/x);
lineplot = 
	Plot[f[x],{x,-1,1},
PlotStyle->{Red},

	AxesLabel->{"x","y"}];

Next, let's look at at table of values of f as we approach x = 0 from the left...

TableForm[Table[{x,f[x]},{x,-.2,-.0001,.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

...and from the right.

TableForm[Table[{x,f[x]},{x,.2,.0001,-.01}],
TableHeadings->{None,{"x","f[x]\n"}}] // N

According to the tables, the limit values are different depending upon whether we approach 0 from the left or the right.  Let's ask Mathematica what the limit in this case should be.

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

Mathematica is telling us that as we approach 0 from the left, f(x) just keeps getting smaller and smaller (decreases without bound) and as we approach 0 from the right, f(x) just keeps getting larger and larger (increases without bound).  Since the limit as x approaches 0 is not a real number, again we must say that the limit in this case does not exist.

The sine function
Another interesting function that does not have a limit as x approaches 0 is f(x) = sin 1/x.  Let's take a look at the graph of f first.

Clear[f,x]
f[x_] = Sin [1/x];
lineplot = 
	Plot[f[x],{x,-1,1},
	PlotStyle->{Red},
	AxesLabel->{"x","y"}];

As we approach 0 from the left and the right, f(x) oscillates between -1 and 1.  Let's rescale the graph so that we can get a better idea of what's going on near 0 from either side.

lineplot = 
	Plot[f[x],{x,-10^(-13),10^(-13)},
	PlotStyle->{Red},
	AxesLabel->{"x","y"},
	PlotRange->{{-10^(-13),10^(-13)},{-1,1}}];

That's better.  Now we can see the oscillation more clearly.  Let's ask Mathematica what the limit is for the sine function as we approach 0 from either side.

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

Mathematica is telling us that as we approach 0 from either side, f(x) oscillates between the interval [-1,1].  In this case, again, we must say that the limit does not exist.

A damped sine function

Let's see what happens to the Sin function if we "damp" it by multiplying it by x, that is, our new function will be
f(x) = x sin 1/x.  Let's take a look at the graph.

Clear[f,x]
f[x_] =((x)Sin [1/x]);
lineplot = 
	Plot[f[x],{x,-1,1},
	PlotStyle->{Red},
	AxesLabel->{"x","y"}];

Let's zoom in a little closer to 0 and see what's going on	on either side.  Does the limit exist as x approaches zero from either side?

lineplot = 
	Plot[f[x],{x,-10^(-13),10^(-13)},
	PlotStyle->{Red},
	AxesLabel->{"x","y"}];

That's better.  It looks as though lim≈ Àº  just may exist.  Let's ask our expert,Mathematica ,what it thinks.

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

So Mathematica is telling us that lim≈ Àº f(x) = 0.  Amazing what a little damping can do.

Your assignment

Now it's time for you to be a little creative.  Find a function f such that f(x) is a constant on the left side of 0 and a different constant on the right side of zero. What is lim≈ Àº f(x)?