Newton's Method for Root Finding - Infinite Loop

Scootertaj
Messages
97
Reaction score
0
1. Construct a function f (x) so that Newton's method gets 'hanging' in an infinite cycle xn = (-1)n x0 , no matter how the
start value x0 is chosen.




2. Homework Equations :
xn+1 = xn - f(xn) / f'(xn)



The Attempt at a Solution


xn+1 = xn - f(xn) / f'(xn) = (-1)n+1x0 = (-1)nx0 - f(xn) / f'(xn) \Rightarrow f(xn) / f'(xn) = 2(-1)nx0
But, I don't know if that's what I want to do or what to do with it.

Any ideas?
 
Physics news on Phys.org
If you apply Newtons iteration to any value of x, you want to wind up with -x. Try solving the differential equation -x=x-f(x)/f'(x).
 
Ah, so you would get f(x) / f'(x) = 1/2x \Rightarrow f'(x) = 1/2x * f(x) \Rightarrow f(x) = e\int 1/2x\Rightarrow f(x) = \sqrt{x} ?
 
Last edited:
Dick, you're right that worked perfectly. I had it wrong at first since I had f(x) = e-\int 1/2x but we get the double negative and thus get f(x) = e\int 1/2x

Thank you!
 
Scootertaj said:
Dick, you're right that worked perfectly. I had it wrong at first since I had f(x) = e-\int 1/2x but we get the double negative and thus get f(x) = e\int 1/2x

Thank you!

Good! You'll also need to think a little about how to define f(x) for x<0. But drawing a picture should make that pretty clear.
 
Would sqrt(|x|) work?
 
Scootertaj said:
Would sqrt(|x|) work?

Try it. I had been thinking about a different choice, but that works too.
 
Hmm, if you don't mind, what were you thinking of?
 
Scootertaj said:
Hmm, if you don't mind, what were you thinking of?

sqrt(x) for x>=0, -sqrt(-x) for x<0. The graph looks a little 'smoother'. But I don't think there's anything wrong with sqrt(|x|) either.
 
Back
Top