Bill Nelson has the right idea. The behavior of Solve[]
is a bit hard to understand. I often forget how Solve[]
works in such a case. Only when it gives me the unexpected answer do I recall the following from its documentation:
Solve gives generic solutions only.
Technically, your system {y*x == 15, x==5}
consists of two conditions. The solution {y -> 3}
is valid provided x == 5
. That is a specific, and not a generic, condition. The option MaxExtraConditions
allow you to change this default behavior. You can set it to MaxExtraConditions -> Automatic
or MaxExtraConditions -> 1
or the following:
Solve[{y*x == 15, x == 5}, y, MaxExtraConditions -> All]
(* {{y -> ConditionalExpression[3, x == 5]}} *)
An undocumented workaround is to use {x}
, with the braces, as the 3rd argument, which asks Solve[]
to eliminate x
from the solutions:
Solve[{y*x == 15, x == 5}, y, {x}]
(* {{y -> 3}} *)
Or you can solve it Bill's way.