Question

In: Advanced Math

The function given possesses real roots: x^3 – 1.7x^2 + 0.84x – 0·108 Using a precision...

The function given possesses real roots:

x^3 – 1.7x^2 + 0.84x – 0·108

Using a precision of 1% of a root, find the estimates of all roots using the secant method. After finding a root, reduce the polynomial using polynomial reduction before finding the next root with the secant method.

PLEASE USE MATLAB

Solutions

Expert Solution

MATLAB Script:

close all
clear
clc

syms x
tol = 1e-2; % Error tolerance

f = x^3 - 1.7*x^2 + 0.84*x - 0.108; % Given function f(x)

% Plot the function to get initial estimates of the roots
x_vals = 0:0.001:1; % Range [0, 1] with step size of 0.001
f_vals = subs(f, x_vals); % Evaluate f(x) at x = x_vals
plot(x_vals, f_vals), grid on % Plot f(x) and turn on the gridlines
xlabel('x'), ylabel('f(x)') % Label the axes
title('f(x) = x^3 - 1.7x^2 + 0.84x - 0.108') % Add a title

fprintf('Roots:\n')

% Secant method (first root)
x0 = 0; x1 = 0.25;
result = secant(f, x0, x1, tol);
fprintf(' x = %.2f\n', result)

% Polynomial reduction
[~, q] = polynomialReduce(f, x - result);
f = q; % New f(x)

% Secant method (second root)
x0 = 0.25; x1 = 0.75;
result = secant(f, x0, x1, tol);
fprintf(' x = %.2f\n', result)

% Polynomial reduction
[~, q] = polynomialReduce(f, x - result);
f = q; % New f(x)

% Secant method (third root)
x0 = 0.75; x1 = 1;
result = secant(f, x0, x1, tol);
fprintf(' x = %.2f\n', result)

function x = secant(f, a, b, tol)
x = [a b];
while true
xl = x(end-1); xu = x(end);
y = ( xl*subs(f, xu) - xu*subs(f, xl) ) / (subs(f, xu) - subs(f, xl)); % Secant method's root update
x = [x y];
if abs(x(end-1) - x(end)) < tol % Termination condition
break
end
end
x = x(end);
end

Plot:

Output:

Roots:
x = 0.20
x = 0.60
x = 0.90


Related Solutions

Given the function N(x)=x^(1.2) + x -ln(x) - 2 Find the roots of N(x) in the...
Given the function N(x)=x^(1.2) + x -ln(x) - 2 Find the roots of N(x) in the domain 0.1 ? x ? 2.5 using the MATLAB fzero function. Plot N(x) using fplot to find the estimates of the roots. Use a for-loop that calls the fzero function and prints the roots to 3 decimal places. Define N(x) using an anonymous function definition, and pass your function using your anonymous function
For the function ?(?) = 2? 3 + 9? 2 − 108? + 30 find the...
For the function ?(?) = 2? 3 + 9? 2 − 108? + 30 find the following (round to the nearest thousandth if needed): a. Interval(s) where the function is increasing b. Interval(s) where the function is decreasing c. Relative maximum and minimum points (x and y values) d. Inflection point(s) (x and y values) e. Interval(s) where the function is concave up f. Interval(s) where the function is concave down
Given a sequence x(n) for 0 ≤ n ≤ 3, where x(0)=4, x(1)=3, x(2)=2, and x(3)=1,...
Given a sequence x(n) for 0 ≤ n ≤ 3, where x(0)=4, x(1)=3, x(2)=2, and x(3)=1, evaluate your DFT X(k)
Degree 5. Roots of multiplicity 2 at x = 3 and x = 1, and a root of multiplicity 1 at x = −3. y-intercept at (0, 9). For the following exercises, use the given information...
For the following exercises, use the given information about the polynomial graph to write the equation.Degree 5. Roots of multiplicity 2 at x = 3 and x = 1, and a root of multiplicity 1 at x = −3. y-intercept at (0, 9)
find real solutions : x^3+6x^2-6=0
find real solutions : x^3+6x^2-6=0
Consider the given function. Evaluate the Riemann sum for 0 ≤ x ≤ 3, with n...
Consider the given function. Evaluate the Riemann sum for 0 ≤ x ≤ 3, with n = 6, taking the sample points to be right endpoints.
a.  For the following probability density function:                 f(X)= 3/4 (2X-X^2 ) 0 ≤ X ≤ 2           &nbsp
a.  For the following probability density function:                 f(X)= 3/4 (2X-X^2 ) 0 ≤ X ≤ 2                        = 0 otherwise            find its expectation and variance. b. The two regression lines are 2X - 3Y + 6 = 0 and 4Y – 5X- 8 =0 , compute mean of X and mean of Y. Find correlation coefficient r , estimate y for x =3 and x for y = 3.
Prove that the polynomial x^3 + x^2 – x + 1 has no integer roots
Prove that the polynomial x^3 + x^2 – x + 1 has no integer roots
Degree 5. Roots of multiplicity 2 at x = −3 and x = 2 and a root of multiplicity 1 at x=−2. y-intercept at (0, 4). For the above exercises, use the given information about the polynomial graph to write the equation.
Degree 5. Roots of multiplicity 2 at x = −3 and x = 2 and a root of multiplicity 1 at x=−2. y-intercept at (0, 4).  For the above exercises, use the given information about the polynomial graph to write the equation.
Find the real zeros of the function f(x) = -(x+1)^3(x-2)^2 and their corresponding multiplicities. Use the...
Find the real zeros of the function f(x) = -(x+1)^3(x-2)^2 and their corresponding multiplicities. Use the information along with a sign chart (diagram) and then the end behavior to provide a rough sketch of the graph of the polynomial.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT