Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Different cases in Solve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89611] Re: [mg89575] Different cases in Solve
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sat, 14 Jun 2008 05:32:23 -0400 (EDT)
  • References: <200806131011.GAA07773@smc.vnet.net>

On 13 Jun 2008, at 19:11, Aaron Fude wrote:

> Hi,
>
> When one does Solve[a x == b, x], one gets {{x -> b/a}}. How does one
> get Mathematica to give you different solutions depending on cases: b/
> a if a nonzero, any number if a==b==0, and no solutions if a=0 and b
> is nonzero?
>
> Many thanks in advance!
>
> Aaron
>

Use Reduce instead of Solve:

Reduce[a*x == b, x]
(b == 0 && a == 0) || (a != 0 && x == b/a)

This means: either a and b are zero (in which case x cna be any  
number) or a is non-zero and x=b/a.

Of course you should not forget that since Reduce tries to give you a  
comlete solution, if you equation (s) is complicated enough it will  
either take very long or simply tell you it can't solve this kind of  
equations, even though Solve might be able to give you a solution.

Andrzej Kozlowski



  • Prev by Date: Re: What "style"s are available in a notebook?
  • Next by Date: Re: export pdf font question
  • Previous by thread: Re: Different cases in Solve
  • Next by thread: Re: Different cases in Solve