MATLAB: Erroneous syntax “solve” implemented in “Matlab 2016”

erroneous solve in matlab 2016aMATLABSymbolic Math Toolbox

Let's suppose we want to solve this equation x^4 + 100*x + 5 = 0 from Matlab. The corresponding codes will be
clc; clear all; syms x; x=solve('x^4 + 100*x + 5 = 0',x)
  • Now, if we execute the same above codes in "Matlab 2010b", the solution is accurate and equal to :
x=
-0.0500
-4.6248
4.0198*i + 2.3374
2.3374 - 4.0198*i
  • while in "Matlab 2016a", the solution is wrong and equal to :
x=
root(z^4 + 100*z + 5 , z, 1)
root(z^4 + 100*z + 5 , z, 2)
root(z^4 + 100*z + 5 , z, 3)
root(z^4 + 100*z + 5 , z, 4)
In fact, the solution from "Matlab 2016a" is completely weird.
  1. So could someone please explain why "Matlab 2016a" gives false solution than "Matlab 2010b"?
  2. and what is/are the possible work-around to eradicate this bug in syntax "solve" implemented in "Matlab 2016"?
Thanks.

Best Answer

Use the vpasolve function:
syms x
x = vpasolve(x^4 + 100*x + 5 == 0,x)