A devotee of Newton Raphson used the method to solve an equation x^100=0, using the initial estimate x_o=0. Calculate next five Newton method and Bisection estimates.
2. PROBLEM STATEMENT:
A devotee of Newton Raphson used the method to solve an equation x ^ 100
= 0, using the initial estimate xo=0. Calculate next fve Newton method and
Bisection estimates.
PLOT FORf (x)=x
100
:
DERIVATIVE OFf (x)=x
100
:
f
'
(x)=100 x
99
NEWTON REPHSON METHOD FORMULA:
3. xi+1=xi−
f (xi)
f
'
(xi)
, f
'
(xi )≠0
NEWTON RAPHSON METHOD IMPLIMENTATION:
Given that xo=0 is the initial guess, thereforef
'
(x)=0 , the method works only
iff ' (x)≠0.
Let’s change our assumption as xo=0.6 such thatf ' (x)≠0. The next fve iterations of
the Newton Raphson Method can be implemented as under;
% Let y = f(x) = 0 be our function such that;
y = @(x) x .^ 100;
% Let's plot the graph to analyse the behavior of y(x) for 'x'
figure;
X = -10:0.001:+10;
title('f(x)=x^{100}');
plot(X, X .^ 100);
xo = 0.1; % Initial estimate
% differentiate 'y' w.r.t. x such that;
diff_y = @(x) 100 * x .^ 99.0;
% Now, let's analyse the first five iterations
XN = [0, 0, 0, 0, 0];
YN = [0, 0, 0, 0, 0];
for iteration = 1:5
if diff_y(xo) == 0
disp('Error, Derivative is zero!')
break;
else
% let x be the next value and xo be the previous one;
% according to NRM, next value of x can be given as below
x = xo - y(xo)/diff_y(xo);
% replace the prev value with the next value for next iteration
xo = x;
% store the results to observe in near future
XN(iteration) = xo;
YN(iteration) = y(xo); % approx values of y(x)
% display the new estimate for x and respective f(x)
fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x));
end
end
OUTPUT:
x_1 = 0.099000, y(0.099000) = 0.000000
x_2 = 0.098010, y(0.098010) = 0.000000
x_3 = 0.097030, y(0.097030) = 0.000000
4. x_4 = 0.096060, y(0.096060) = 0.000000
x_5 = 0.095099, y(0.095099) = 0.000000
PLOT FORf (x)=x
99
:
DERIVATIVE OFf (x)=x
99
:
f
'
(x)=99 x
98
BISECTION METHOD:
For x ∈[a,b],midpoint=
a+b
2
if f (a)f (midpoint )<0:b=midpoint ,else:a=midpoint
5. BISECTION METHOD IMPLIMENTATION:
Let x∈[−1,6], therefore a=−1 and b=6 are satisfying f (a)f (b)<0. The frst fve
iterations can be observed using the following set of commands in MATLAB;
% Let y = f(x) = 0 be our function such that;
y = @(x) x .^ 99;
% Let's plot the graph to analyse the behavior of y(x) for 'x'
figure;
X = -10:0.001:+10;
title('f(x)=x^{99}');
plot(X, X .^ 99);
% initially we assume that 'x' lies in range [a, b] where;
a = -1; b = 6; % since y(a)y(b) < 0
% Now, let's analyse the first five iterations
XB = [0, 0, 0, 0, 0];
YB = [0, 0, 0, 0, 0];
for iteration = 1:5
% mid point of interval [a,b]
x = (a+b)/2.0;
% display the new estimate for x and respective f(x)
fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x));
% store the results to observe in near future
XB(iteration) = x;
YB(iteration) = y(x); % approx values of y(x)
if y(a) * y(x) < 0
b = x;
elseif y(x) * y(b) < 0
a = x;
end
end
OUTPUT:
x_1 = 2.500000, y(2.500000) =
2489206111144456600000000000000000000000.000000
x_2 = 0.750000, y(0.750000) = 0.000000
x_3 = -0.125000, y(-0.125000) = -0.000000
x_4 = 0.312500, y(0.312500) = 0.000000
x_5 = 0.093750, y(0.093750) = 0.000000
6. ANALYSIS OF THE APPROXIMATIONS:
In the above graph, ‘+’ represent the values of ‘f(x)’ at the approximated
values x in Bisection Method, while the ‘*’ represents the values of y=x
99
at the
respective values of x approximated using the Bisection Method.
7. The behavior of the Newton Raphson Method can be analyzed more clearly
by zooming the portion of graph in some range of x as under;
In the above graph we can see that for all the approximated values of ‘x’ we
are getting ‘f(x)’ approaching zero.
CONCLUSION:
Newton Raphson method, for the given function converges faster than the
Bisection Method as gives more accurate values for f(x). In other words, Newton
method can be seen more accurate than the Bisection Method, and is more
convergent as well.