Message Boards Message Boards

GROUPS:

Solve[] not giving ConditionalExpression?

Posted 1 year ago
2276 Views
|
5 Replies
|
1 Total Likes
|

The following solution is finite only if c is not zero:

Solve[x * c == 1, x]
{{x -> 1/c}}

however, Solve[] does not return a ConditionalExpression. How could I enforce that? Thanks.

5 Replies

Hi Thomas The coefficient c cannot be zero at the first place because if it is, then your equation you are trying to solve will not be valid as you get 0==1 That is why Solve[] assumed that c cannot be zero.

Hi Thomas,

Use Reduce

Reduce[x*c == 1, x]
(* c != 0 && x == 1/c *)
Posted 1 year ago

oh I see... but what about the following?

Solve[x * c == y, x]
{{x -> y/c}}

this time, x=0 if y=0; when y!=0, x is only defined if c!=0. Again, no ConditionalExpression is returned?

Posted 1 year ago

as suggested by Robit below:

Reduce[x * c == y, x]
(y == 0 && c == 0) || (c != 0 && x == y/c)

that said, I should always use Reduce rather than Solve ???

Use Reduce when you want the conditions, Solve when you want the generic solution.

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

Group Abstract Group Abstract