Calculus Exploration 4B:  Newton-Raphson Method

The following is a problem solver that uses the Newton-Raphson method to find the zeroes of a smooth (differentiable) function f(t). You should work through each example experimenting with different starting points for the approximation process. Each exploration contains a math movie of the iteration process that you can step through using the VCR like controls at the top of the toolbar above. Note that these VCR controls appear only after you click on the plot image.

After exploring the first three examples below, use the last two sections to create your own different examples. You should find two functions that would be difficult for you to compute the zeroes of by hand.

Example 1.

[Maple Plot]

f(t) = sin(t), `f '`(t) = cos(t)

`Estimate zeroes of `*f(t)*`using Newton-Raphson Method:`

``

L[i](t) = `f '`(t[i])*t+b[i], `  b`[i] = f(t[i])-`f '`(t[i])*t[i], i = 0 .. n

`Solve L`[i](t) = 0, ` or equivalently`, ` t`[i+1] = ` t`[i]-f(` t`[i])/`f '`(` t`[i])

`___________________ Iteration 0 ____________________`

` t`[0] = 2, ` L`[0](t) = -.4161468365*t+1.741591100

`Solve L`[0](t) = 0, ` or equivalently`, ` t`[1] = ` t`[0]-f(` t`[0])/`f '`(` t`[0])

` t`[1] = 4.185039864, ` f`(` t`[1]) = -.8641441474

`___________________ Iteration 1 ____________________`

` t`[1] = 4.185039864, ` L`[1](t) = -.5032443665*t+1.241953588

`Solve L`[1](t) = 0, ` or equivalently`, ` t`[2] = ` t`[1]-f(` t`[1])/`f '`(` t`[1])

` t`[2] = 2.467893673, ` f`(` t`[2]) = .6238810733

`___________________ Iteration 2 ____________________`

` t`[2] = 2.467893673, ` L`[2](t) = -.7815192937*t+2.552587593

`Solve L`[2](t) = 0, ` or equivalently`, ` t`[3] = ` t`[2]-f(` t`[2])/`f '`(` t`[2])

` t`[3] = 3.266186278, ` f`(` t`[3]) = -.1242715182

`___________________ Iteration 3 ____________________`

` t`[3] = 3.266186278, ` L`[3](t) = -.9922482501*t+3.116596101

`Solve L`[3](t) = 0, ` or equivalently`, ` t`[4] = ` t`[3]-f(` t`[3])/`f '`(` t`[3])

` t`[4] = 3.140943913, ` f`(` t`[4]) = .6487405443e-3

`___________________ Iteration 4 ____________________`

` t`[4] = 3.140943913, ` L`[4](t) = -.9999997896*t+3.141591993

`Solve L`[4](t) = 0, ` or equivalently`, ` t`[5] = ` t`[4]-f(` t`[4])/`f '`(` t`[4])

` t`[5] = 3.141592654, ` f`(` t`[5]) = -.4102067615e-9

`___________________ Iteration 5 ____________________`

` t`[5] = 3.141592654, ` L`[5](t) = -1.*t+3.141592654

`Solve L`[5](t) = 0, ` or equivalently`, ` t`[6] = ` t`[5]-f(` t`[5])/`f '`(` t`[5])

` t`[6] = 3.141592654, ` f`(` t`[6]) = -.4102067615e-9

`___________________ Iteration 6 ____________________`

` t`[6] = 3.141592654, ` L`[6](t) = -1.*t+3.141592654

`Solve L`[6](t) = 0, ` or equivalently`, ` t`[7] = ` t`[6]-f(` t`[6])/`f '`(` t`[6])

` t`[7] = 3.141592654, ` f`(` t`[7]) = -.4102067615e-9

`___________________ Iteration 7 ____________________`

` t`[7] = 3.141592654, ` L`[7](t) = -1.*t+3.141592654

`Solve L`[7](t) = 0, ` or equivalently`, ` t`[8] = ` t`[7]-f(` t`[7])/`f '`(` t`[7])

` t`[8] = 3.141592654, ` f`(` t`[8]) = -.4102067615e-9

`___________________ Iteration 8 ____________________`

` t`[8] = 3.141592654, ` L`[8](t) = -1.*t+3.141592654

`Solve L`[8](t) = 0, ` or equivalently`, ` t`[9] = ` t`[8]-f(` t`[8])/`f '`(` t`[8])

` t`[9] = 3.141592654, ` f`(` t`[9]) = -.4102067615e-9

`___________________ Iteration 9 ____________________`

` t`[9] = 3.141592654, ` L`[9](t) = -1.*t+3.141592654

`Solve L`[9](t) = 0, ` or equivalently`, ` t`[10] = ` t`[9]-f(` t`[9])/`f '`(` t`[9])

` t`[10] = 3.141592654, ` f`(` t`[10]) = -.4102067615e-9

`___________________ Iteration 10 ____________________`

` t`[10] = 3.141592654, ` L`[10](t) = -1.*t+3.141592654

`Solve L`[10](t) = 0, ` or equivalently`, ` t`[11] = ` t`[10]-f(` t`[10])/`f '`(` t`[10])

` t`[11] = 3.141592654, ` f`(` t`[11]) = -.4102067615e-9

Example 2.

[Maple Plot]

f(t) = 1/2*t^2-ln(1+t), `f '`(t) = t-1/(1+t)

`Estimate zeroes of `*f(t)*`using Newton-Raphson Method:`

``

L[i](t) = `f '`(t[i])*t+b[i], `  b`[i] = f(t[i])-`f '`(t[i])*t[i], i = 0 .. n

`Solve L`[i](t) = 0, ` or equivalently`, ` t`[i+1] = ` t`[i]-f(` t`[i])/`f '`(` t`[i])

`___________________ Iteration 0 ____________________`

` t`[0] = .8, ` L`[0](t) = .2444444444*t-.4633422204

`Solve L`[0](t) = 0, ` or equivalently`, ` t`[1] = ` t`[0]-f(` t`[0])/`f '`(` t`[0])

` t`[1] = 1.895490902, ` f`(` t`[1]) = .733288214

`___________________ Iteration 1 ____________________`

` t`[1] = 1.895490902, ` L`[1](t) = 1.550126322*t-2.204962126

`Solve L`[1](t) = 0, ` or equivalently`, ` t`[2] = ` t`[1]-f(` t`[1])/`f '`(` t`[1])

` t`[2] = 1.422440284, ` f`(` t`[2]) = .1268927671

`___________________ Iteration 2 ____________________`

` t`[2] = 1.422440284, ` L`[2](t) = 1.009633410*t-1.309250467

`Solve L`[2](t) = 0, ` or equivalently`, ` t`[3] = ` t`[2]-f(` t`[2])/`f '`(` t`[2])

` t`[3] = 1.296758263, ` f`(` t`[3]) = .92923186e-2

`___________________ Iteration 3 ____________________`

` t`[3] = 1.296758263, ` L`[3](t) = .8613619846*t-1.107685952

`Solve L`[3](t) = 0, ` or equivalently`, ` t`[4] = ` t`[3]-f(` t`[3])/`f '`(` t`[3])

` t`[4] = 1.285970326, ` f`(` t`[4]) = .692550e-4

`___________________ Iteration 4 ____________________`

` t`[4] = 1.285970326, ` L`[4](t) = .8485193282*t-1.091101422

`Solve L`[4](t) = 0, ` or equivalently`, ` t`[5] = ` t`[4]-f(` t`[4])/`f '`(` t`[4])

` t`[5] = 1.285888707, ` f`(` t`[5]) = .39e-8

`___________________ Iteration 5 ____________________`

` t`[5] = 1.285888707, ` L`[5](t) = .8484220898*t-1.090976380

`Solve L`[5](t) = 0, ` or equivalently`, ` t`[6] = ` t`[5]-f(` t`[5])/`f '`(` t`[5])

` t`[6] = 1.285888702, ` f`(` t`[6]) = -.4e-9

`___________________ Iteration 6 ____________________`

` t`[6] = 1.285888702, ` L`[6](t) = .8484220838*t-1.090976372

`Solve L`[6](t) = 0, ` or equivalently`, ` t`[7] = ` t`[6]-f(` t`[6])/`f '`(` t`[6])

` t`[7] = 1.285888702, ` f`(` t`[7]) = -.4e-9

`___________________ Iteration 7 ____________________`

` t`[7] = 1.285888702, ` L`[7](t) = .8484220838*t-1.090976372

`Solve L`[7](t) = 0, ` or equivalently`, ` t`[8] = ` t`[7]-f(` t`[7])/`f '`(` t`[7])

` t`[8] = 1.285888702, ` f`(` t`[8]) = -.4e-9

`___________________ Iteration 8 ____________________`

` t`[8] = 1.285888702, ` L`[8](t) = .8484220838*t-1.090976372

`Solve L`[8](t) = 0, ` or equivalently`, ` t`[9] = ` t`[8]-f(` t`[8])/`f '`(` t`[8])

` t`[9] = 1.285888702, ` f`(` t`[9]) = -.4e-9

`___________________ Iteration 9 ____________________`

` t`[9] = 1.285888702, ` L`[9](t) = .8484220838*t-1.090976372

`Solve L`[9](t) = 0, ` or equivalently`, ` t`[10] = ` t`[9]-f(` t`[9])/`f '`(` t`[9])

` t`[10] = 1.285888702, ` f`(` t`[10]) = -.4e-9

`___________________ Iteration 10 ____________________`

` t`[10] = 1.285888702, ` L`[10](t) = .8484220838*t-1.090976372

`Solve L`[10](t) = 0, ` or equivalently`, ` t`[11] = ` t`[10]-f(` t`[10])/`f '`(` t`[10])

` t`[11] = 1.285888702, ` f`(` t`[11]) = -.4e-9

Example 3.

[Maple Plot]

f(t) = t^7-6*t^5+8*t^3, `f '`(t) = 7*t^6-30*t^4+24*t^2

`Estimate zeroes of `*f(t)*`using Newton-Raphson Method:`

``

L[i](t) = `f '`(t[i])*t+b[i], `  b`[i] = f(t[i])-`f '`(t[i])*t[i], i = 0 .. n

`Solve L`[i](t) = 0, ` or equivalently`, ` t`[i+1] = ` t`[i]-f(` t`[i])/`f '`(` t`[i])

`___________________ Iteration 0 ____________________`

` t`[0] = -1.2, ` L`[0](t) = -6.746112*t-10.5725952

`Solve L`[0](t) = 0, ` or equivalently`, ` t`[1] = ` t`[0]-f(` t`[0])/`f '`(` t`[0])

` t`[1] = -1.567213115, ` f`(` t`[1]) = 2.71082582

`___________________ Iteration 1 ____________________`

` t`[1] = -1.567213115, ` L`[1](t) = -18.31251615*t-25.98878966

`Solve L`[1](t) = 0, ` or equivalently`, ` t`[2] = ` t`[1]-f(` t`[1])/`f '`(` t`[1])

` t`[2] = -1.419181802, ` f`(` t`[2]) = .7990726e-1

`___________________ Iteration 2 ____________________`

` t`[2] = -1.419181802, ` L`[2](t) = -16.16652638*t-22.86333278

`Solve L`[2](t) = 0, ` or equivalently`, ` t`[3] = ` t`[2]-f(` t`[2])/`f '`(` t`[2])

` t`[3] = -1.414239042, ` f`(` t`[3]) = .40768e-3

`___________________ Iteration 3 ____________________`

` t`[3] = -1.414239042, ` L`[3](t) = -16.00086475*t-22.62863996

`Solve L`[3](t) = 0, ` or equivalently`, ` t`[4] = ` t`[3]-f(` t`[3])/`f '`(` t`[3])

` t`[4] = -1.414213564, ` f`(` t`[4]) = .2e-7

`___________________ Iteration 4 ____________________`

` t`[4] = -1.414213564, ` L`[4](t) = -16.00000000*t-22.62741700

`Solve L`[4](t) = 0, ` or equivalently`, ` t`[5] = ` t`[4]-f(` t`[4])/`f '`(` t`[4])

` t`[5] = -1.414213562, ` f`(` t`[5]) = -.1e-7

`___________________ Iteration 5 ____________________`

` t`[5] = -1.414213562, ` L`[5](t) = -16.00000001*t-22.62741702

`Solve L`[5](t) = 0, ` or equivalently`, ` t`[6] = ` t`[5]-f(` t`[5])/`f '`(` t`[5])

` t`[6] = -1.414213563, ` f`(` t`[6]) = .2e-7

`___________________ Iteration 6 ____________________`

` t`[6] = -1.414213563, ` L`[6](t) = -16.00000000*t-22.62741699

`Solve L`[6](t) = 0, ` or equivalently`, ` t`[7] = ` t`[6]-f(` t`[6])/`f '`(` t`[6])

` t`[7] = -1.414213562, ` f`(` t`[7]) = -.1e-7

`___________________ Iteration 7 ____________________`

` t`[7] = -1.414213562, ` L`[7](t) = -16.00000001*t-22.62741702

`Solve L`[7](t) = 0, ` or equivalently`, ` t`[8] = ` t`[7]-f(` t`[7])/`f '`(` t`[7])

` t`[8] = -1.414213563, ` f`(` t`[8]) = .2e-7

`___________________ Iteration 8 ____________________`

` t`[8] = -1.414213563, ` L`[8](t) = -16.00000000*t-22.62741699

`Solve L`[8](t) = 0, ` or equivalently`, ` t`[9] = ` t`[8]-f(` t`[8])/`f '`(` t`[8])

` t`[9] = -1.414213562, ` f`(` t`[9]) = -.1e-7

`___________________ Iteration 9 ____________________`

` t`[9] = -1.414213562, ` L`[9](t) = -16.00000001*t-22.62741702

`Solve L`[9](t) = 0, ` or equivalently`, ` t`[10] = ` t`[9]-f(` t`[9])/`f '`(` t`[9])

` t`[10] = -1.414213563, ` f`(` t`[10]) = .2e-7

`___________________ Iteration 10 ____________________`

` t`[10] = -1.414213563, ` L`[10](t) = -16.00000000*t-22.62741699

`Solve L`[10](t) = 0, ` or equivalently`, ` t`[11] = ` t`[10]-f(` t`[10])/`f '`(` t`[10])

` t`[11] = -1.414213562, ` f`(` t`[11]) = -.1e-7

____________________________________

Filename: ExploreCalc04B.mws

Copyright 2005, All Rights Reserved.

Permission is granted to use and modify for

academic and non-commercial purposes.

Dr. John Pais

Mathematics Department-MICDS

E-mail: pais@micds.org or pais@kinetigram.com

URL:  http://kinetigram.com/micds

_____________________________________