Laboratory Assignment 2: Limits

Hopefully through the work done in class and from the book you understand that the basic idea of the limit *lim _{x®
a}f(x) *is to find the value that

In this laboratory assignment we hope to reinforce some of these ideas you have about limits. We begin by showing you how you can use Matlab to help you make a table of values of *f(x)* when *x* is close to *a*. To do this we have chosen to construct the table by using an array, i.e. a matrix. We see that we begin by defining two symbolic variables *x *and *A*, the function *f* and fill the matrix *A* with zeros. We fill the matrix with zeros so that we begin with an initialized matrix of the correct size. We next start a for-end loop that we will use to fill our matrix *A*. We fill the first row, (1,k), k=1,…,8, with the values of *x* that we want to consider. We note that using the function *2-.1 ^{k}* to define

syms x A;

f=x^3;

A=zeros(2,8);

for k=1:8

A(1,k)=2-.1^k;

A(2,k)=subs(f,x,A(1,k));

end

vpa(A,8)

When we run the above code in Matlab we see that as* x *gets close to* 2 *from the left, *f(x)=x ^{3} *gets close to

limit(f,2)

to compute the limit *lim*_{x®
2}*x ^{3}*, but we hope and assume that you know very well that

syms a b

a=2;

b=subs(f,x,a)

to see that *f(2)* is defined and equals *8* (but I hope that we were very aware that *f* was continuous at *x=2*).

You should now construct tables that predict *lim _{x®
2}(x^{2}-4)/(x-2)*. After you have the tables that predict the value of this limit (which you should already know), use the limit command to compute that limit. Then evaluate the function

The next topic that we study is the rigorous definition of a limit. In the text we were given the definition that *lim _{x®
a}f(x)=L* if for every e
>0 there exists a d
such that whenever

In this part of the lab, we will choose particular e 's and find the d associated with the given e . We will then discuss how we know that this d works.

We begin by considering the limit *lim _{x®
2}x^{3}=8*. As we stated earlier, to prove that this limit is correct we would have to give a rule that chooses d
for any given e
and show that this d
works. We won't do that. What we will do is for one given value of e
, e
=1, we will find the d
that works. In the figure below, we plot the function

The problem we are left with is to determine d
. To find d
* _{1}* we must find the value such that

solve('x^3=9')

It is probably better to write

w=solve('x^3=9')

so that when you get three solutions and we want only one of them, we can then refer to the solution that we want as w(1) (or w(2) or w(3)). Then since *2+d
_{1}=w(1)* or d

vpa(w(1)-2)

we find that d
* _{1}=0.08008…. *We repeat the process to find d

We should note that the use of Matlab for this problem was not really necessary. I think you'll appreciate having Matlab more for the next two problems. Also, Matlab seems to require that some of the operations be done in a way that is more complicated than should be necessary. We could have solved the above equations by defining *x* to be a symbolic variable and writing

solve(x^3-9)

However, it would not let you write solve(x^3=9).

Below we provide two plots, one of *f(x)=2x ^{3}-3x^{2}-12x* and one of