Newton-Rapshon, finding intersections between cos(x) and sin(x)

754 Views Asked by At

Question says to find both intersections between $f(x) = sin(x)$ and $h(x) = cos(x)$ using Newton-Raphson. The interval is [0,5]. To illustrate, here is a chart:

enter image description here

What I've done was:

$f(x) = sin(x) - cos(x)$

and

$f'(x) = cos(x) + sin(x)$

Taking $x_0 = 1$ I'm having the Newton-Raphson not converging, while I was expecting it going to 0.8, it's going way above 3.802915 with 2 iterations.

I'm assuming that my function is not right, but I can't see what I'm doing wrong.

Any tips?

Update:

Iteration table of my attempt:

| n   |  Xn           |  Xn+1      |
| 0   |  1            |  1.965689  |
| 1   |  1.965689     |  2.899324  |
| 2   |  2.899324     |  3.802915  |