TI-85 Program: Newton's Method


This is a program which uses Newton's method to approximate roots of an equation f(x)=0. The input consists of an equation for the function f(x) and an initial value x1. The program successively computes approximations x2 , x3 , x4 , ... pausing each time before going to the next approximation. The approximations are determined by the "recursion formula"

xi+1 = xi - f(xi)/f'(xi)
which is known as Newton's method.

Here is the calculator code (suitable, as written, for TI-85).

:Disp "This program uses"
:Disp "Newton's method"
:Disp "to approximate a"
:Disp "root of f(x)=0 given"
:Disp "an initial x-value"
:Disp "of x1."
:Disp "Press enter to continue"
:Pause
:Disp ""
:
:InpSt "The function f(x)= ",f
:St>Eq(f,F)
:Input "The initial estimate x1 = ",xx
:1->N
:
:Lbl HERE
:evalF(F,x,xx)->A
:der1(F,x,xx)->B
:xx-A/B->xx
:N+1->N 
:Disp N,xx
:Pause
:Goto HERE



[In the code typed above, the symbols 
"St>Eq("  and "evalF("
can be found on the CATALOG menu. The symbol 
"->" is accessed
using the "STO>" key which is the second key from the lefthand 
bottom of the calculator. Many of the other command words can be 
found on the I/O and CTL menus. The greater than and less than symbols 
may be found on the TEST menu.]



After you have entered this program into your TI-85, try taking

f(x) = x2 - 2 and x1 = 3
to see how rapidly one can approximate the square root of 2. What happens if you take the same function f(x) = x2 - 2 but start with x1 = -3?

Use this program to approximate solutions to the equations sin(x) = x2 and tan(x) = x. How many solutions does each of these equations have?




This document was created in November 1996,
and last revised on August 15, 1998.

Your questions, comments or suggestions are welcomed. Please direct correspondence to:

Andy Miller
Department of Mathematics
University of Oklahoma
e-mail: amiller@ou.edu

URL: http://www.math.ou.edu/~amiller/ti85/newton.htm