Use the Bisection Method to locate all solutions of followin

Use the Bisection Method to locate all solutions of following equations. Sketch the function by using MATLAB\'s plot command and identify three intervals of length one that contain a root. Then find the roots to six correct decimal places. 2x^3 - 6x - 1 = 0 e^x - 2 + x^3 - x = 0 1 + 5x - 6x^3 - e^2x = 0

Solution

This question has multiple sub parts. I am going to solve the first part.

Part a.

In bisection method we need to assume a range where we think our root lies and then we need to go on and bisect the interval in the range to find the root.

let us take our equation

2x^3 -6x-1

Now let us take x=1

value of function will be 2-6-1=-5 (negative)

Now let us take x=2

value of function will be 2*8-6*2-1

=16-12-1=3 (positive)

So the root of the equation lies somewhere in between 1 and 2.

matlab code will be:

f=@(x) 2x^3-6x-1;
low=1;
high=2;
for i=1:100
result=(low+high)/2;
if f(result)>0
high=result;
else low=result;
end
end
low=1; high=2; p=result;
for i=1:100
result=(low+high)/2;
er(i)=f(result)-f(p);
if f(result)>0
high=result;
else low=result;
end
end
fprintf(\'Root of our equation 2x^3-6x-1 is %f\',result)
plot(er);
title(\'bisection method slot\')
xlabel(\'Iterations\')
ylabel(\'Margin of error\')
grid on;

Here low indicates 1 and high indicates 2.

 Use the Bisection Method to locate all solutions of following equations. Sketch the function by using MATLAB\'s plot command and identify three intervals of le

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site