# Homework Help: Newton's Method for Root Finding - Infinite Loop

1. Sep 29, 2011

### Scootertaj

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. Relevant Equations:
xn+1 = xn - f(xn) / f'(xn)

3. 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 wanna do or what to do with it.

Any ideas?

2. Sep 29, 2011

### Dick

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).

3. Sep 30, 2011

### Scootertaj

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: Sep 30, 2011
4. Sep 30, 2011

### Scootertaj

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!

5. Sep 30, 2011

### Dick

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.

6. Sep 30, 2011

### Scootertaj

Would sqrt(|x|) work?

7. Sep 30, 2011

### Dick

Try it. I had been thinking about a different choice, but that works too.

8. Sep 30, 2011

### Scootertaj

Hmm, if you don't mind, what were you thinking of?

9. Sep 30, 2011

### Dick

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.