[Math] Use Newton’s method to find all solutions of $5\cos(x) = x + 1$ correct to six decimal places.

calculusnewton raphson

Use Newton's method to find all solutions of the equation correct to six decimal places. (Enter your answers as a comma-separated list.)

$5\cos(x) = x + 1$

I got $1.130597$ as an answer but apparently I am suppose to have 3 different answers. Also how do I find the initial approximation? Thank you

Best Answer

Let $$ f(x)=5\cos(x)-x-1 $$ Then $f(x)=0$ can be solved using the recursion $$ \begin{align} x_{n+1} &=x_n-\frac{f(x_n)}{f'(x_n)}\\ &=x_n-\frac{5\cos(x_n)-x_n-1}{-5\sin(x_n)-1}\\ &=\frac{5x_n\sin(x_n)+5\cos(x_n)-1}{5\sin(x_n)+1} \end{align} $$ where $x_1$ is near some root of $f$.

Plotting $f(x)$,

enter image description here

we see that there are roots near $-4,-2,+1$. Apply the recursion to $x_1\in\{-4,-2,+1\}$.