Group Abstract Group Abstract

Message Boards Message Boards

0
|
135 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Solve function yields empty set answer.

Posted 2 days ago

Greetings, I am new to Mathematica and I am wondering why the command:

Solve[ { y*x == 15, x==5}, y]

Yields:

{}

Thanks,
Jay

POSTED BY: Jay Schultz
4 Replies
Posted 2 days ago

Perhaps think: 2 equations, 2 unknowns. Try

Solve[ { y*x == 15, x==5},{x, y}]
POSTED BY: Bill Nelson
Posted 1 day ago

Another way to write the equation:

Solve[y*x == 15 /. x -> 5, y]
POSTED BY: Hans Milton

There is no value of y that makes the predicate x == 5 evaluate to True.

POSTED BY: Gianluca Gorni

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.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard