# `3cos(x) = x + 1` Use Newton's method to find all roots of the equation correct to six decimal places. `3cos(x)=x+1`

`f(x)=x+1-3cos(x)=0`

To solve using Newton's method apply the formula,

`x_(n+1)=x_n-f(x_n)/(f'(x_n))`

`f'(x)=1+3sin(x)`

Plug in f(x) and f'(x) in the formula,

`x_(n+1)=x_n-(x_n+1-3cos(x_n))/(1+3sin(x_n))`

See the attached graph to get the initial values of x.

When f(x)=0 , the values of x are near The curve has three x values x `~~` 0.8 , -1.8 , -3.6

Use these three values for finding the roots of the equation to six decimal places.

Let's solve for the first zero by initial value  x_1=0.8

`x_2=0.8-(0.8+1-3cos(0.8))/(1+3sin(0.8))`

`x2~~0.892041194`

`x_3~~0.889472276`

`x_4~~0.889470408`

`x_5~~0.889470408`

Let's stop iteration as we have same decimal places

Now let's solve for the second zero by initial value x_1=-1.8,

`x_2=(-1.8)-(-1.8+1-3cos(-1.8))/(1+3sin(-1.8))`

`x_2~~-1.861613881`

`x_3~~-1.8623648`

`x_4~~-1.862364929`

`x_5~~-1.862364929`

Now let's solve for the third root by initial value x_1=-3.6

`x_2=(-3.6)-(-3.6+1-3cos(-3.6))/(1+3sin(-3.6))`

`x_2~~-3.638785336`

`x_3~~-3.637958339`

`x_4~~-3.637957968`

`x_5~~-3.637957968`

Roots of the equation to six decimal places are 0.889470 , -1.862365 , -3.637958