In: Mechanical Engineering
Use MuPAD to solve the polynomial equation x3 + 8x2 + ax + 10 = 0 for x in terms of the parameter a, and evaluate your solution for the case a = 17. Use MuPAD to check the answer.
The polynomial equation given to us is
x3 = 8x2 + ax + 10 = 0
It is required to solve the above equation for x in terms of a. This can be done in MATLAB using the command solve. Then solution for the case a = 17 is required.
The MATLAB code is given below. The check part is done by calculating the polynomial again using the roots. This can be done using the MATLAB command poly(A) where A is the roots of the polynomial.
Input:
syms x a
eq = x^3 + 8*x^2 + a*x + 10;
sol = solve(eq)
% substituting the value of a = 17
roots = subs(sol, a, 17);
roots = double(roots)
% checking in MATLAB
poly(roots)
Output:
Sol =
root(z^3 + 8*z^2 + a*z + 10, z, 1)
root(z^3 + 8*z^2 + a*z + 10, z, 2)
root(z^3 + 8*z^2 + a*z + 10, z, 3)
roots =
-5
-2
-1
ans =
1 8 17 10
The roots of equation for a = 17 is
roots = -5, -2, -1.