# Homework Help: Newton's method?

1. Oct 23, 2007

### physstudent1

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

Find the coordinates to two decimal places of the point P in Figure 9 where the tangent line to y=cosx passes through the origin.

the image is the graph of y=cosx P intersects the graph at around pi.

2. Relevant equations

3. The attempt at a solution

I don't know how to attempt this, I just know I have to use newton's method somehow I tired doing x-(f(x))/(f'(x)) but then I have a divide by zero error I'm not sure what to do.

2. Oct 23, 2007

### physstudent1

anyone?

3. Oct 23, 2007

### jhicks

Try a guess that isn't x=0.

Last edited: Oct 23, 2007
4. Oct 23, 2007

### physstudent1

I guessed 2pi/3 and newton's method converged onto 1.5708 = x I'm not sure if this is correct

5. Oct 24, 2007

### jhicks

Sounds like you did newton's method on the wrong function. Think more carefully about the function you wish to find the zero of. You are given two points: (0,0) and (P,cos(P)) and a slope -sin(P). The line is of the form f(X)=-sin(P)*x, and the curve is of the form y=cos(x), and you want the curves to meet at X=P. How can you turn this information into something solvable by Newton's Method?

Also, be careful about your initial guess. If you choose it badly, you will converge to the wrong zero. I'm not sure your current guess will find you the right P.

Last edited: Oct 24, 2007
6. Oct 24, 2007

### HallsofIvy

I second jhicks. What function are you attempting to apply Newton's method to?

7. Oct 24, 2007

### physstudent1

would it work to try to solve it by doing

cos(x)+sin(x)x =0
for the function I try to use newton's method for?

8. Oct 24, 2007

### D H

Staff Emeritus
You have to make the tangent line pass through the origin. Applying Newton's method to y=cos(x) yields the point at which cos(x)=0, which is not what you want.

9. Oct 24, 2007

### physstudent1

would 3pi/4 be a better guess for the zero on the graph they look lke they meet around the miniumum of the graph and one cycle takes 2pi so this would be around pi wouldn't it?

10. Oct 24, 2007

### D H

Staff Emeritus
That's correct, but it looks like you are guessing that this is the correct equation rather than deriving this.

11. Oct 24, 2007

### physstudent1

no its not a guess even though it may seem it I got it because the point I'm trying to find is where the two functions intersect which would be where they're equal cos(x)=-sin(p)x so then I put it into a form where I could find a zero cos(x)+sin(p)x then using information that jhick's supplied that I did not realize at the point of intersection P will = X

12. Oct 24, 2007

### D H

Staff Emeritus
Does this initial guess converge to a value, and if so, does this value satisfy the original problem? If so, you have a solution.

13. Oct 24, 2007

### D H

Staff Emeritus
So don't phrase it as a guess. This reasoning is good.

14. Oct 24, 2007

### physstudent1

sorry, didn't mean to so for newton's method my setup is

cos(x)+sin(x)x-(cos(x)+sin(x)x)/(-sin(x)+cos(x)x+sin(x))

15. Oct 24, 2007

### D H

Staff Emeritus
If $x_n$ is the nth estimate of x, then the next estimate by Newton's method is

$$x_{n+1} = x_n - f(x_n)/f'(x_n)$$

You're setup is equivalent to

$$x_{n+1} = f(x_n) - f(x_n)/f'(x_n)$$

which is not the same as Newton's method.

16. Oct 24, 2007

### physstudent1

ah i see my mistake now thanks I began with an initial guess of Pi and it stopped at around 2.7986