# Why WolframAlpha solves this, but Mathematica can't? [closed]

I am trying to solve a system of equations using Mathematica, to which it returns

{ }

which I understand might be due to the fact that there are many variables than equations. To check this, I entered this

Solve[{xy + yz + zx == 1, xy + x^2 + y^2 == 3}, {x, y, z}, Reals]


which again returned { }. Now of course in this case we have many solutions, so my guess seems right. However, when I try the same thing in WolframAlpha, it returns an answer.

So my question is: what can I do to ensure that Mathematica returns an answer to this question. In general, since I am solving a large systems of equations, what should be my general strategy to get some answer from Mathematica.

• xy is a symbol named "xy". To multiply x and y you need to insert a space or * between them. – Simon Woods Oct 24 '16 at 20:51
• W|A "guesses" that xy is intended to be x*y. Lucky guess. Actual programming languages, which have stated rules of syntax, cannot do that. – Daniel Lichtblau Oct 24 '16 at 20:54
• Thank you @SimonWoods and DanielLichtblau for the comments. That's interesting since I thought that Mathematica is similar to WolframAlpha and I never bothered to make that distinction in WolframAlpha. – Nirakar Neo Oct 24 '16 at 20:59
• actually alpha doesnt seem to ever treat multiple characters together as a single symbol, always a product unless it spells something – george2079 Oct 25 '16 at 0:51
• I concur and also vote to close this. – Nirakar Neo Oct 25 '16 at 17:40

The proper syntax is

Solve[{x*y + y*z + z*x == 1, x*y + x^2 + y^2 == 3}, {x, y, z}, Reals]


or with spaces instead of *. The result is a solution given by means of Root objects. One can use ToRadicals, which

attempts to express all Root objects in expr in terms of radicals.

ToRadicals @ Solve[{x*y + y*z + z*x == 1, x*y + x^2 + y^2 == 3}, {x, y, z}, Reals]


The result is given by ConditionalExpressions, which basically mean that the first two solutions are valid when $z\neq 0$. To get rid of the ConditionalExpressions, use Normal:

Normal @ ToRadicals @
Solve[{x*y + y*z + z*x == 1, x*y + x^2 + y^2 == 3}, {x, y, z}, Reals]


And finally, run FullSimplify to get a more transparent output:

FullSimplify @ Normal @ ToRadicals @
Solve[{x*y + y*z + z*x == 1, x*y + x^2 + y^2 == 3}, {x, y, z}, Reals]


• Use FullSimplify to get a cleaner form of the result. – Bob Hanlon Oct 24 '16 at 21:32