       Re: Bug in Simplify?

• To: mathgroup at smc.vnet.net
• Subject: [mg33339] Re: Bug in Simplify?
• From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
• Date: Sat, 16 Mar 2002 01:40:19 -0500 (EST)
• References: <a6pj7l\$aoj\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Gianluca Gorni <gorni at dimi.uniud.it> wrote:
> > As best I can tell, however, nothing that you said explains why
> > we should expect Simplify[x/y, x==0 && y==0] to yield 0. This
> > still puzzles me.
>
> It seems that Simplify will not look at denominators to see when
> they vanish. For example
>
> Simplify[x/y == 1 && y == 0]
>
> will return the argument unevaluated. Also Solve has the same problem:
> Solve[x/y == 1] will not warn you that x=y=0 is not a solution.
>
> A function that cares for vanishing denominators is Reduce:
>
> Reduce[x/y == 1 && y == 0] gives False
>
> Also, Reduce[x/y == 1] gives x == y && y != 0

Thanks for your response.

> I don't know how relevant it is, but 2 years ago Adam Strzebonski,
> in response to why Simplify[Sqrt[x^2], x == 1 + Sqrt] did not
> return x, wrote:
>
> > I am not convinced that Simplify should be
> > optimized for assumptions of the form x==constant. I would
> > expect that in most cases what one really wants is
> > Simplify[expr/.x->constant]
> > rather than
> > Simplify[expr, x==constant].

However, just as we wish,

In:= Simplify[Sqrt[x^2], x \[GreaterEqual]0]
Out= x

Hmm. That gives me a baroque idea. First, note that, as we wish,

In:= Simplify[x>=0 && x<=0 && y>=0 && y<=0]
Out= x==0 && y==0

Then, if you want Simplify to leave x/y as is (rather than giving 0), even
though you have _in essence_ specified x==0 && y==0 in the assumptions, use

In:= Simplify[x/y, x>=0 && x<=0 && y>=0 && y<=0]
Out= x/y

Best Regards,
David Cantrell

--