Solving a simple systems of equations

108 Views Asked by At

Update:

1) As @Amzoti mentioned, I made a mistake in the mathematica code. There should be spaces between x, y and z. So now the following code works:

Solve[{x + y + z == a, xy + yz + xz == b, xyz == c}, {x, y, z}]

2) As @Crostul mentioned, this is a standard set of 3rd order Vieta's formulas, so the solution is simply the root of $t^3−at^2+bt−c=0$. I will remove this section once Crostul post an answer and I accept it.


I have this equation, which does not seem too complicated for me. Could anyone please explain to me why they are not solved by either sympy or mathematica? Is this set of equation not solvable?

SymPy code:

from sympy.abc import x, y, z, a, b, c
from sympy import solve

solve([x+y+z-a, x*y+y*z+x*z-b, x*y*z-c], [x, y, z])

Mathematica:

Solve[{x + y + z == a, xy + yz + xz == b, xyz == c}, {x, y, z}]

Thanks!

Shawn

1

There are 1 best solutions below

0
On BEST ANSWER

If you consider the equation $$t^3 -at^2+bt-c=0$$ then the three roots must be $x,y,z$ since $$(t-x)(t-y)(t-z) = t^3- (x+y+z) t^2 + (xy+xz+yz)t - xyz$$