I have the following question where I am asked to find the values of $x_2$ and $x_3$:
Here is my attempt is this correct?
I have the following question where I am asked to find the values of $x_2$ and $x_3$:
Here is my attempt is this correct?
On
You made the following mistake:
You have calculated
$$\frac{(0.4-0.4+0.5\cdot \sin(2*0.4)-\pi/4)}{1+\cos(2\cdot0.4)}=\frac{0.4267}{1.967}$$
I would fist calculate $$\frac{x_0+0.5\cdot \sin(2\cdot x_0)-\pi/4}{1+\cos(2\cdot x_0)}$$
and then substract this result from $x_0.$
For $x_0=0.4$ we get
$$\frac{0.4+0.5\cdot \sin(2\cdot 0.4)-\pi/4}{1+\cos(2\cdot 0.4)}=-0.015748$$ -
Substracting: $0.40000-(-0.01575)=0.40000+0.015748=0.415748$
You are on the right track
$$ f(x) = x + \frac{1}{2}\sin(2x) -\frac{\pi}{4} \\ f'(x) = 1 + \cos(2x) $$
So that
$$ x_{n+1} = x_n -\frac{f(x_n)}{f'(x_n)} $$
These are the first few iterations
$$ \begin{array}{c|c}\hline n & x_n \\ \hline 0 & 0.4 \\ 1 & 0.415748 \\ 2 & 0.415856 \\ 3 & 0.415856 \\ \hline \end{array} $$
If you go to Wolfram Sandbox you can enter this code to get the first 10 iterations