Answer to Question #284217 in MatLAB for Jack

Question #284217

Find the root of the polynomial given below within the interval (-1, 1) using (a) the bisection method and (b) the Newton’s method


P = x/8[(63x^4)-(70x^2)+15]


1
Expert's answer
2022-01-02T02:23:56-0500
% Polynom
p = @(x) x/8.* (63*x.^4 - 70*x.^2+15);
% Bisection menthod:
a = -1;
b = 1;
eps = 1e-8;
while (b-a > eps)
    x = (b+a) / 2;
    if (p(x)*p(a) < 0)
        b = x;
    else
        a = x;
    end
end
disp(x)
% Newton's method:
% First derevitive
pp = @(x) (63*x.^4 - 70*x.^2 + 15)/8 + x/8 .* (63*4*x.^3 - 140*x);
x0 = 1;
x1 = x0 - p(x0) / pp(x0);
while (abs(x0-x1) > eps)
    x0 = x1;
    x1 = x0 - p(x0) / pp(x0);
end
disp(x1)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS