Angelo - 2014-09-28 13:35:09
I'm trying to use phpequations to solve quadratic equations with this code:
include("phpequations.class.php");
$equations = new phpequations();
$equation = "pow(x,2)+2*x-1=0";
$resolve = $equations->solve($equation);
print_r($resolve);
The problem is that $resolve[x] will return just one of the roots of the equation (0.4142).
I tried also with the following equations:
pow(x,2)=4 (returns 2)
pow(x,2)+2*x=0 (returns 0)
How can I fix this problem?