Newton Raphsons method.
Author: Patrik Lundin,patrik@lundin.info

Numeric equation solving.
xn+1 = xn - f(xn) / f'(xn)

Quick start:

  1. Write an equation on the form f(x) = g(x) in the equation field.
    If you leave out the equality sign, then = 0 will be assumed.
  2. Give a startvalue close to the root ( guess one ).
  3. Give the number of iterations you want ( start with a low value ).
  4. Press the start button.
  5. Check the value, is it reasonable? If not, it has diverged.

Press stop to stop iterating, press continue to start iterating
again using the last calculated value as startvalue.

Examples:
A convergent equation.
x=sin(x)-3 , startvalue -2

x= -3.3482340796530266 after 1 iterations.
x= -3.0685550570975795 after 2 iterations.
x= -3.0707668155969694 after 3 iterations.
x= -3.0707667271420402 after 4 iterations.
x= -3.0707667271420402 after 5 iterations.

A divergent equation.
1/x=5 , startvalue 2

x= -16.0 after 1 iterations.
x= -1312.0 after 2 iterations.
x= -8609344.0 after 3 iterations.
x= -3.70604037770368E14 after 4 iterations.
x= -6.867367640585025E29 after 5 iterations.

You can use the following operators:
+ - * / ^ sin(..) cos(..) tan(..) asin(..) acos(..) atan(..) sinh(..) cosh(..)
tanh(..) cotan(..) acotan(..) sqrt(..) ln(..) exp(..)
where exp is "constant e raised to..." and ^ is "power to..".

Predefined constants are:
euler which is the same as exp(1), and pi.

This Applet uses the com.javathings.math class library.
It actually performs a symbolic derivation of the equation before calculating the value.
For more information go to this page