1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Newton method

  1. Dec 19, 2009 #1
    1. The problem statement, all variables and given/known data

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


    2. Relevant equations



    3. 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 dont 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
     
  2. jcsd
  3. Dec 19, 2009 #2

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    You need to have

    [tex] \abs {f'(x)} <= 1 [/tex] in the neighborhood of your guess and the solution. A local extreme between the 2 could also cause troubles.
     
  4. Dec 20, 2009 #3
    I don't understand. What do you mean 'A local extreme between the 2 could also cause troubles' ?

    Thank you
     
  5. Dec 20, 2009 #4

    HallsofIvy

    User Avatar
    Science Advisor

    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!
     
  6. Dec 20, 2009 #5
    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?
     
  7. Dec 20, 2009 #6

    HallsofIvy

    User Avatar
    Science Advisor

    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".
     
  8. Dec 20, 2009 #7
    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" [Broken] might help you out with some good examples of where you can run into trouble with Newton's Method.
     
    Last edited by a moderator: May 4, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook