as two starting values. Do three iterations only.
SOLUTION:
:::Q1:::
f (x) = x3 – 3x – 5 = 0
f (1) = (1)3 – 3(1) – 5= -7
f (3) = (3)3 – 3(3) – 5 = 13
As f(1) f(3)< 1 therefore roots lies between 1 and 3
We have x0 = 1 , x1 = 3
Now x2 = x0 + x1 /2 = 1+3/2 = x2 = 2
f(2) = (2)3 – 3 (2) – 5 = -3
As f(3) f(2) <0 therefore roots lies between 3 and 2
X1 = 3 , x2 = 2,
X3 = x1 + x2 /2 = 3+2/2 = 2.5
F(2.5) = (2.5)3 -3(2.5) -5 = 3.125
As f(2) f(2.5) < 0 therefore roots lies between 2 and 2.5
X2 = 2 , x3 = 2.5
X4 = x2 + x3 =2+2.5 / 2 = 2.25
f(2.25) = (2.25)3 – 3(2.25) – 5 = -0.36
Now the Real root of the equation after three iterations is 2.25
:::Q2:::
x1 = -2 , x2 = -1
f(x) = x3 – sinx + 1 = 0
f(x1) = (-2)3 – sin(-2) + 1
= -8-(-0.9092)+1
= -6.090
f(x2) = (-1)3 – sin(-1) + 1
= -1 – (0.8414)+1
=0.8414
As f(x1) and f(x2) <0 so the root lies between x1 and x2 the first approximation is
obtained form
X3 = x2 – x2 – x1 / f(x2) – f(x1) f(x2)
x3 = (-1) – (-1) – (-2)/ 0.8414 – (-6.0908) 0.8414
= -1.12137
f(x3) = (-1.12137)3 – sin(-1.12137) + 1
= 0.49060
Now , since f(x1) and f (x3) are of opposite signs , the second approximation is
obtained as
Now we will find x4
X4 = x3 - x3 – x1 / f(x3) – f (x1) f(x3)
= -1.12137 - -1.12137 - (-2) / 0.4906 – (-6.0908) (0.4906)
= -1.18686
f(x4) = (-1.18686)3 –sin(-1.18686) + 1 = 0.25534
Now since f(x1) and f(x4) are of opposite signs , the second approximation is
obtained as now we will find x5
X5 = x4 - x4 – x1 / f(x4) – f(x1) f(x4)
= -1.18686 - -1.18686 - (-2) 0.25534
0.25534 – (-6.0908)
= -1.21957
f(x5) = (-1.21957)3 – sin (-1.21957) + 1 = 0.12502
:::Q3:::
f(x) = cos x – xex
f ’ (x) = -sin x –ex –xe x
now we have initial approximation x0 =1
f (x0) =cos (1) – (1)e1 = -2.1779
f ‘ (x0) = -sin(1) – e1 – 1.e1 = -6.2780
x1 = x0 – f (x0) /f ‘ (x0)
= 1 – (-2.1779) / (-6.2780) = 0.6530
f(x1) = cos(0.6530) – (0.6530) .e 0.6530 = -0.4603
f ‘ (x1) = - sin (0.6530)-e 0.6530 - 0.6530 .e 0.6530 =-3.7834
x2 = x1 – f(x1) / f ‘ (x1)
= 0.6530 – (-0.4603) / (-3.7834) = 0.5313
f (x2) = cos(0.5313) – (0.5313).e 0.5313 = -0.0416
f ‘ (x2) = -sin(0.5313) – e 0.5313 – 0.5313 .e 0.5313 = -3.1116
x3 = x2 - f (x2)
f ‘ (x2)
= 0.5313 – (-0.0416) / (-3.1116) = 0.5179
f(x3) = cos(0.5179) – 0.5179.e 0.5179 = -0.0004
f ‘ (x3) = -sin(0.5179) – e 0.5179 – 0.5179.e 0.5179 = -3.0428
therefore approximate roots after three iterations is 0.5179
:::Q4:::
f(x) = x3 – 3x +1
x0 = 1 , x1 = 0.4
f(x0) = (1)3 -3(1) +1 = -1
f(x1) = (0.4)3 – 3(0.4) +1 = -0.136
x2 = x0.f(x1) – x1.f(x0) /f(x1) – (x0)
x2 = 1.(-0.136) – 0.4(-1) / -0.136 – (-1) =0.264 / 0.864 = 0.3055
f(x2) = (0.3055)3 – 3(0.3055) + 1 = 0.1120
x3 = x1.f(x2) – x2.f(x1) / f(x2) – f(x1)
= 0.4(0.1120) – 0.3055(-0.136) / 0.1120 – (-0.136) = 0.0863 / 0.248 =0.3479
f(x3) = (0.3479)3 – 3(0.3479) + 1 = -0.0015
x4 = x2.f(x3) – x3.f(x2) / f(x3) – f(x2)
= 0.3055(-0.0015) – 0.3479(0.1120) / (-0.0015) – 0.1120 = -0.0394 / -0.1135
=0.3471
f(x4) = (0.3471)3 – 3(0.3471) + 1 = 0.0418 – 1.0413 + 1 = 0.0005