0
$\begingroup$

In Wolfram Mathematica 12, when I enter:

Solve[ x == y , x]

I get:

{{x -> y}}

as expected.

But when I add an equation that contains only constants and parameters:

Solve[ x == y z && z == 1, x]

I get no results:

{}

when I want to get {{x -> y}} as before.

$\endgroup$
6
  • 4
    $\begingroup$ I think this is known and intentional. Try Solve[x == y z && z == 1, {x, z}] I think I saw question on this before on this site but can't be sure now. $\endgroup$
    – Nasser
    Apr 27, 2020 at 10:26
  • $\begingroup$ Thanks a lot, Solve[x == y z && z == 1, {x, z}] gives {{x -> y, z -> 1}}. This is (arguably more important) half of the answer. I would like to know why Mathematica behaves in this way. $\endgroup$
    – mcruffy
    Apr 27, 2020 at 10:34
  • 1
    $\begingroup$ You should evaluate Solve[ x == y z && z == 1, x,MaxExtraConditions->All]. Your problem is a special case of a general issue which can be found in What is the difference between Reduce and Solve? $\endgroup$
    – Artes
    Apr 27, 2020 at 10:38
  • $\begingroup$ see help, under possible issues. screen shot !Mathematica graphics Solve[x == 1 && a == 2, x] gives {} $\endgroup$
    – Nasser
    Apr 27, 2020 at 10:39
  • $\begingroup$ You can also use either Solve[x == y z && z == 1, x, {z}] or Solve[Eliminate[x == y z && z == 1, z], x] $\endgroup$
    – Bob Hanlon
    Apr 27, 2020 at 14:38

0

Browse other questions tagged or ask your own question.