%% Solve Polynomial Equations of High Degree
% When you solve a polynomial equation, the solver might use root to return the solutions. Solve a third-degree polynomial.

syms x a
eqn = x^3 + x^2 + a == 0;
solve(eqn, x)

% Try to get an explicit solution for such equations by calling the solver with 'MaxDegree'. The option specifies the maximum degree of polynomials for which the solver tries to return explicit solutions. The default value is 2. Increasing this value, you can get explicit solutions for higher order polynomials.
% Solve the same equations for explicit solutions by increasing the value of 'MaxDegree' to 3.

S = solve(eqn, x, 'MaxDegree', 3)

%
% Copyright 2006 The MathWorks, Inc.