MathGroup Archive 1999

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

Search the Archive

Re: Re: Bug in Solve?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17516] Re: [mg17458] Re: [mg17395] Bug in Solve?
  • From: Daniel Lichtblau <danl>
  • Date: Mon, 10 May 1999 19:53:20 -0400
  • References: <199905090843.EAA13442@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej Kozlowski wrote:
> 
> I do not know whether to call this a bug, but if it is one  it is quite
> understandable why it occurs. The problem is that Mathematica, just like my
> students, does not check its solutions. This is how a careless student (and
> also Mathematica) would arrive at this wrong answer:
> 
> First, you re-write your equation as
> 
> Sqrt[1+a^2]*Sqrt[1+b^2]==-(1+a*b)
> 
> You now square both sides to get
> 
> (1+a^2)*(1;b^2)==(1+a*b)^2
> 
> Now, Solve quite correctly will give:
> 
> In[78]:=
> Solve[(1+a^2)*(1+b^2)==(1+a*b)^2,a]
> Out[78]=
> {{a -> b}, {a -> b}}
> 
> This is fine, the only problem is that these are not solutions of the
> original equation, which has no solutions. The only way to check this is to
> substitute these solutions back into the original equation to check if it
> works. But Mathematica does not do this in this case.

I wish it were that simple. The problem is that I do not know how to
make the check correct in all cases where the result involves parameters
rather than just numeric objects. The verifier does a basic sanity check
but cannot weed out the solution in this case even though it is in fact
a parasite for generic parameter values. Our strategem is to return all
solutions that cannot be discarded on obvious grounds. (Why? Because
quite often we obtain solutions that are neither generically correct nor
generically incorrect, due to parametrized algebraics. So we return all
of them).


> Actually, it does do chcking in some cases. Solve  takes the option
> VerifySolutions which is by default set to Automatic (same as True), but it
> only works in case of numerical solutions, not solutions containing symbols.
> Compare what hapens if we use a value for b, for example b=1.
> 
> Solve[{1 + x*1 + Sqrt[1 + 1^2]*Sqrt[1 + x^2] == 0}, x, VerifySolutions ->
> False]
> Out[2]=
> {{x -> 1}}
> 
> Same as before and just as wrong. But
> 
> In[3]:=
> Solve[{1 + x*1 + Sqrt[1 + 1^2]*Sqrt[1 + x^2] == 0}, x]
> Out[3]=
> {}
> 
> This time Mathematica checked its solution and noticed that it is wrong. In
> general there is a good reason why Mathematica does not try to verify
> solutiuons containing symbols. It will probably be unable to do so in most
> casess. 

This is basically correct. Though for some examples, this one included,
we might be able to do better than at present. I plan to look into this
soon.


> The transformations needed to do this are usually very complicated.
> Its usually easier to do the insection by hand or substitute a few numbers.
> 
> --
> Andrzej Kozlowski
> Toyama International University
> JAPAN
> http://sigma.tuins.ac.jp
> http://eri2.tuins.ac.jp
> 
> ----------
> >From: iaz at cs.umd.edu (Ilya Zavorine)
To: mathgroup at smc.vnet.net
> To: mathgroup at smc.vnet.net
> >To: mathgroup at smc.vnet.net
> >Subject: [mg17516] [mg17458] [mg17395] Bug in Solve?
> >Date: Thu, May 6, 1999, 3:44 PM
> >
> 
> > I executed the following statement:
> >
> > Solve[1+a*b+Sqrt[1+a^2]*Sqrt[1+b^2]== 0,a]
> >
> > and got as the answer
> >
> > {{a->b}}
> >
> > which is obviously wrong. Is this a Mathematica bug or
> > am I doing something wrong?
> >
> > Thanks,
> >
> > Ilya

The answer, as was pointed out by Andrzej and others, is that you did
nothing wrong and Mathematica is not quite able to recognize that the
solution is generically invalid. As I said, I'll give this some thought.


Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: fourier transforms
  • Next by Date: Re: Printing left & right pages
  • Previous by thread: Re: Bug in Solve?
  • Next by thread: FW: Bug in Solve?