%% Find Multiple Solutions by Specifying Initial Guesses
% Find multiple solutions of the equation 200\sin(x) = x^3 - 1 by specifying the initial guesses when using vpasolve.
% Plot the left and right sides of the equation.

syms x
eqnLeft = 200*sin(x);
eqnRight = x^3 - 1;
fplot([eqnLeft eqnRight])
title([texlabel(eqnLeft) ' = ' texlabel(eqnRight)])

% The plot shows that the equation has three solutions. If you do not specify the initial guess, vpasolve returns the first solution that it finds.

S1 = vpasolve(eqnLeft == eqnRight, x)

% Find one of the other solutions by specifying an initial guess that is close to that solution.

S2 = vpasolve(eqnLeft == eqnRight, x, -3)
S3 = vpasolve(eqnLeft == eqnRight, x, 4)

%
% Copyright 2012-2019 The MathWorks, Inc.