Newton method is used for finding root of the function in given interval.


Function f, which is continous function and value: a - being intital guess - the closer to root, the better. Function fD, which is the derivative of function f.
Root in given interval.
1. Make x = a and prevX = a.
2. Check if abs(f(x)) < precision.
3. If it is end algorithm and return x.
4. Make x = prevX - (f(prevX) / fD(prevX)).
5. Make prevX = x.
6. Go to step 2.

Sample Output:

f(x) = x * (x + 2) -1

root: -2.414201183431953
Iteration NumberaprevXxf(x)


  • easy to implement (without approximating the derivative of function!).
  • very fast method (not counting some special functions).
  • no need to find initial interval, simply choose a number and one of the roots should be found.


  • has trouble with some functions.
  • If a stationary point of given function is encountered, there will be division by zero, because of the derivative being zero.
  • need to calculate derivative of given function.
  • may miss root.


Java Implementation Python Implementation C++ Implementation C# Implementation

Newton Method Algoritm
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. You can read more about it the Cookies&Privacy Policy Section Above. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this. You can read more about it the Cookies&Privacy Policy Section.