MATH1020 Calculus II Maple Lab 5
Sections 1-4 Due: Tuesday, October 19, 1999.
http://www.math.rpi.edu/~mitchj/math1020  

In this lab, we explore the behavior of a sequence and find the root of some functions using Newton's method. Be sure to follow the lab guidelines as described on the class handouts.

1.
Consider the sequence

\begin{displaymath}a_n = \sqrt{n} (\sqrt{n+1}-\sqrt{n}),\qquad n=1,2,3,\ldots\end{displaymath}

(a)
Use the following Maple commands to plot the first 25 elements of this sequence:

> a:=sqrt(n)*(sqrt(n+1)-sqrt(n));
> A:=[seq([n,evalf(a)], n=1..25)];
> plot(A,n=1..25,style=point);

(b)
From your graph it should appear that the sequence is increasing and has a limit L. Show by hand that the sequence is increasing. Use the following Maple commands to find the limit:
> L:=limit(a,n=infinity);

(c)
Let $N(\epsilon)$ be a integer such that $\vert a_n-L\vert\le\epsilon$ when $n\ge N(\epsilon)$. Find the value of N for $\epsilon=0.001$, $\epsilon=0.0001$ and $\epsilon=0.00001$. (Hint: for the case $\epsilon=0.001$ use the solve command

> solve(L-a=.001);

where L should be defined as the value you found in part (b).)

(d)
How does N depend on $\epsilon$ for small positive values of $\epsilon$?

2.
Consider Newton's method to find a value x that solves f(x)=0:

\begin{displaymath}a_n = a_{n-1} - {f(a_{n-1})\over f'(a_{n-1})},\qquad n=1,2,3,\ldots\end{displaymath}

for an initial guess a0. It is hoped that the iteration converges so that $a_n\rightarrow x$. Let us begin by defining a Maple procedure called ``Newton'' that performs this iteration. Enter the following Maple commands:

> Newton:=proc(f,a0,n) local i,j; global a,A,Error;
> a[0]:=evalf(a0);
> for i from 1 to n do
> a[i]:=evalf(a[i-1]-subs(x=a[i-1],f)/subs(x=a[i-1],diff(f,x)));
> od;
> A:=[seq([j,evalf(a[j])], j=0..n)]:
> Error:=[seq([j,evalf(a[j]-a[n])], j=0..n-1)]:
> plot(A,style=point);
> end;

To use this procedure to find $\sqrt{5}$, we set f(x)=x2-5 and take a0=2, so we type

> f:=x $\!\!\!$2-5;
> Newton(f,2,6);

In this example, 6 iterations are used and the plot shows the behavior of the an's. Type

> A; Error;
to see the iterates and the errors. (Type
> Digits:=20;
to increase the number of digits used in evalf. You will need to rerun Newton after changing Digits to see any effect.)

(a)
Find all real roots of the polynomial f(x)=x5+3x4-5x3-2x2-13x-15 using the procedure Newton. You might try plotting y=f(x) to get estimates for the roots.

(b)
Use Newton for the case f(x)=(1-3x2)/(1-x2). Can you explain why the choice a0=.75 finds a root while the choice a0=.25 does not? Graph y=f(x) and appropriate tangent lines to try to explain it.



 
John E Mitchell
1999-10-12