The Newton-Raphson Method
Try using Newton-Raphson Method to solve x^3 + x^2 - 1 = 0,
the initial estimates x0 = 1 will lead to the answer x = 0.755 (correct to 3 dec pl) after 3 iterations.
The initial estimate x0 = 2 will lead to the correct answer after 5 iterations.
Initial estimates like x0 = 0 & -1 will not lead to the solution (due to the presence of a stationary pt at x = 0).
The initial estimate x0 = -0.5 will cause the answer to oscillate wildly (due to the presence of a stationary pt near x = -1), reaching the correct answer only after 13 iterations.
The initial estimate x0 = -0.25 will cause the answer to oscillate wildly, reaching the correct answer only after 35 iterations.
Exercises for students
Solve the following problems on paper and check your answers using the above applet:
Use Newton-Raphson Method to solve x -1 - exp(-2x) = 0, starting with x = 1, giving your answer correct to 3 dec places.
Use Newton-Raphson Method to solve x + tan x = 0, starting with x = 2, giving your answer correct to 3 dec places.
Summary
xn+1 | = | xn | – |
f ( xn ) |
_______ |
f' ( xn ) |
You can define the equation using the following operators:
+ | - | * | / | ^ |
| sqrt( ) | ln( ) | exp( ) | pi |
| sin( ) | cos( ) | tan( ) |
| asin( ) | acos( ) | atan( ) |
| sinh( ) | cosh( ) | tanh( ) |
Right-click here to download this page, the Java Class File and unzip the Javathings Math Package.
This applet uses the com.javathings.math package developed by:
Patrik Lundin
patrik@javathings.com
http://www.javathings.com