Homework Help: Newton's method

1. May 22, 2010

TsAmE

1. The problem statement, all variables and given/known data

Use Newton's method to find the coordinates of the inflection point of the curve y = e^cosx, 0 <= x <= pi, correct to six decimal places.

2. Relevant equations

None.

3. The attempt at a solution

I calculated y'' (as f(x) in newton formula) and y''' (as f'(x) in newton formula), as they wanted to find the coordinates of the inflection point (when y'' = 0).

y' = -e^(cosx) * sinx

y'' = e^(cosx) * ( sinx^(2) - cosx )

y''' = e^(cosx) * sinx( cosx^2 + 3cosx )

I then subbed in y'' and y''' into the newton equation and this is where I am having trouble, since when ever I try to use an initial approximation e.g. x1 = 0 or x1 = pi, f'(x1) = 0 which is undefined (from x1 = x2 + f(x1) / f'(x1)

2. May 22, 2010

Staff: Mentor

Newton's method can be used to find a zero (x-intercept) for a function f(x). For the inflection point, you want to find out where y'' = 0. You have formulas for y'' and y'''. Use them in Newton's method.

3. May 22, 2010

TsAmE

Yeah I tried that, but when I sub in the beginning (0) and end point of the interval (pi), I get an f'(1) (in the denominator of newtons method) to be 0 which is undefined. Unless I am choosing a wrong initial approximation? Or can you choose any initial approximation?

4. May 22, 2010

Staff: Mentor

Start at a different number. You don't have to start at 0.

5. May 22, 2010

TsAmE

What if when guessing an initial approximation, you guess one which is to the left of the root, and then you keep on taking further approximations from the initial one, wouldnt the tangent lines move to the left, completely missing the root? (refer to diagram)

Attached Files:

• Newtons method.jpg
File size:
3.9 KB
Views:
207
6. May 22, 2010

vela

Staff Emeritus
Not if you don't make a guess that's too far away. In your picture, for instance, you'd have f(x0)<0 and f'(x0)>0, so x1=x0-f(x0)/f'(x0) will be greater than x0, i.e. you move to the right.

If you go too far away so that you pass that minimum, then yes, Newton's method will shoot you off in the wrong direction.

7. May 22, 2010

TsAmE

Then how do you 'guess' without missing the root?

8. May 22, 2010

vela

Staff Emeritus
You can use your knowledge of the function to make an educated guess; maybe plot it to see what the roots approximately are; if you get a root, make sure it's the one you were looking for; etc.

9. May 22, 2010

TsAmE

I cant check it by plotting it, as we not allowed calculators in our exam. I read somewhere that choosing the mid-point of the interval (0 <= x <= pi) is a good initial approximation, but for this example, obviously pi/2 doesnt work as f'(x) = 0 which is undefined in the formula (as is 0 and pi)

10. May 22, 2010

vela

Staff Emeritus
You don't need an exact plot. You're just trying to make a decent guess. There's a reason why you learned how to analyze functions and sketch their graphs.

For your particular function, you don't even need to plot it. If you look at your expression for y'''(x), you can easily see it's zero when sin x=0 or cos x=0, so avoid those points. If you write y''(x) in terms of only cos x, you see it vanishes when cos2 x+cos x-1=0. You can use the quadratic equation to solve for cos x. Estimate what cos x equals (about 0.6) and then what x equals (around pi/3) and use that as your initial guess.

11. May 23, 2010

TsAmE

I see. Someone also told me that you could find an initial approximation, by finding where the tangent line crosses the y-axis