MATLAB: Difference between Matlab and Wolfram Alpha

equationsolvingSymbolic Math Toolbox

These problems might occure frequently due to the varied syntax. This time it's about:
solve(x^2-8*x+15<=1)
what gives (according to Matlab): pi and 4. That's wrong or not what I ask for. In contrast Wolfram Alpha gives after typing in the same piece of code the correct solution (in my point of view.) Why is that?

Best Answer

Hi Niklas,
You need to set 'ReturnConditions' to true to return any parameters in the solution and conditions on the solution. Therefore,
S = solve(x^2-(8*x)+15<=1, 'ReturnConditions',true);
S.conditions,
ans =
x <= 2^(1/2) + 4 & 4 - 2^(1/2) <= x
in(y, 'real')
which is the solution interval: 2.5858 <= x <= 5.4142