0
$\begingroup$

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.

$\endgroup$

closed as off-topic by Daniel Lichtblau, Simon Woods, mikado, m_goldberg, happy fish Oct 25 '16 at 5:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Simon Woods, mikado, m_goldberg, happy fish
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ xy is a symbol named "xy". To multiply x and y you need to insert a space or * between them. $\endgroup$ – Simon Woods Oct 24 '16 at 20:51
  • 6
    $\begingroup$ 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. $\endgroup$ – Daniel Lichtblau Oct 24 '16 at 20:54
  • $\begingroup$ 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. $\endgroup$ – Nirakar Neo Oct 24 '16 at 20:59
  • $\begingroup$ actually alpha doesnt seem to ever treat multiple characters together as a single symbol, always a product unless it spells something $\endgroup$ – george2079 Oct 25 '16 at 0:51
  • $\begingroup$ I concur and also vote to close this. $\endgroup$ – Nirakar Neo Oct 25 '16 at 17:40
3
$\begingroup$

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]

enter image description here

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.