PROGRAM:NEWTON
:While 1
:Ans-Y1(Ans)/nDeriv(Y1(X),X,Ans)→Z
:Disp Z
:End
If you want to solve an equation F(X) = 0, then
1. Store F(X) as Y1.
\Y1=F(X)
\Y2=
...
2. Enter the initial guess on the screen.
3. Run NEWTON.
4. In order to stop it, press [ON][1].
Example.
Find the cube root of 10.
1. \Y1=X^3-10
2. [1][ENTER], initial guess is 1.
3. prgrmNEWTON [ENTER]
2.15443469
2.15443469
2.15443469
2.15443469
2.15443469
2.15443469
2.15443469
4. [ON][1]
5. Check it: 3√(10) ENTER
2.15443469
Remark.
The program iterates,
Ans := Ans - F(Ans)/F'(Ans),
by computing the numerical approximation of the derivative F' of F.
If you want to observe the computation step by step, insert "Pause" after "Disp Z".