Originally Posted by

**Mathstud28** Do as many methods as you need to to get this

$\displaystyle f_{n+1}=x_n+\frac{f(x_n)}{f'(x_n)}$

We are trying to find the intersection or in other words the zeros of the difference of the two equations?

So we have $\displaystyle e^{x}=2\cos(x)\Rightarrow{e^{x}-2\cos(x)=0}$

We have out equal to zero...therefore our function is $\displaystyle e^{x}-2\cos(x)$

NR gives the itteration:

$\displaystyle x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$

Then five iterations give:

Code:

>x0=0
0
>x1=x0-(exp(x0)-2*cos(x0))/(exp(x0)+2*sin(x0))
1
>x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
0.627904
>x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
0.544207
>x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
0.539797
>x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
0.539785

So after 2 iterations you have a relativly poor approximation, you realy need more iterations

RonL