Understanding Newton Method for Solving Equations

sara_87
Messages
748
Reaction score
0

Homework Statement



I read that the Newton method for finding roots of an equation doesn't always work.
How do I know whether it works or not for a given equation?


Homework Equations





The Attempt at a Solution


For an example, consider:

f(x) = 1/(x2-1)+1/(x2-4) - x-1

When I try to solve this using programming, I get 2.9642 for some initial guesses but if I put the initial guess as, say, 5 I get that the root is -inf

I don't understand why.
And also for other examples I either get x=0 after 0 steps (in the Newton method) or I get x=inf.

Thank you
 
Physics news on Phys.org
You need to have

\abs {f'(x)} <= 1 in the neighborhood of your guess and the solution. A local extreme between the 2 could also cause troubles.
 
I don't understand. What do you mean 'A local extreme between the 2 could also cause troubles' ?

Thank you
 
At a local extremum (maximum or minimum) the derivative is 0. Since Newton's method involves dividing by 0, it one of your iterations happens to give you that value, there's an obvious problem!
 
Oh so if the value gives infinity, this means that there is a problem. How do I avoid this problem.
In general, for a given function, how do I know whether I can implement the Newton Method?
 
As integral said, you need to know that f'(x)< 1 in some neighborhood of of the root, that f'(x) is NOT 0 in that neighborhood, and that your starting value is inside that neighborhood. Frankly, most of the time, the best thing to do is to "try and see what happens".
 
You would have to look at a graph of the function to see where your initial guess will take you with Newton's Method. In your case, at your initial guess x1=5, the slope of the tangent line of your function is -13/352800 and just below the x-axis. This will make x2 far to the left in negative x values and each subsequent approximation will further diverge to negative infinity.

http://en.wikipedia.org/wiki/Newton%27s_method" might help you out with some good examples of where you can run into trouble with Newton's Method.
 
Last edited by a moderator:
Back
Top