MathGroup Archive 2010

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

Search the Archive

Re: Why can't Mathematica tell when something is algebraically zero?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108180] Re: Why can't Mathematica tell when something is algebraically zero?
  • From: schochet123 <schochet123 at gmail.com>
  • Date: Wed, 10 Mar 2010 01:42:52 -0500 (EST)
  • References: <hn2ltj$3kt$1@smc.vnet.net>

On Mar 8, 1:09 pm, mmdanziger <mmdanzi... at gmail.com> wrote:
> This isn't the first time that I've encountered something like this in
> Mathematica but in my calculations I got a term like this:
>
> r^2 Sqrt[(r^3 + r + 2)/r] - Sqrt[r^3 (r^3 + r + 2)]
>
> Which is obviously identically zero.  For some reason Simplify or even
> FullSimplify can't figure this out.

Actually, since Mathematica works over the complex numbers that
expression is NOT identically zero:

expr = r^2 Sqrt[(r^3 + r + 2)/r] - Sqrt[r^3 (r^3 + r + 2)];

FindInstance[expr != 0, r] // InputForm

{{r -> 42/5 + (82*I)/5}}

However, Mathematica can't find an example with r real:

FindInstance[expr != 0 && Element[r, Reals], r]

FindInstance::nsmet: The methods available to FindInstance are
insufficient to find the requested instances or prove they do not
exist.

Telling Mathematica that r is positive enables it to simplify the
expression:

Simplify[expr, r > 0]

0

It often helps to try Reduce instead of Simplify, but even that does
not yield the complete answer here:

Reduce[expr == 0 && Element[r, Reals], r, Complexes] // InputForm

During evaluation of In[5]:= Reduce::cpow: Reduce was unable to prove
that a radical of an expression containing only real variables and
parameters is real valued. If you are interested only in solutions for
which all radicals contained in the input are real valued, use Reduce
with domain argument Reals. >>

Reduce[expr == 0, r, Reals] // InputForm

r <= -1 || r > 0

So the best Mathematica can do is to show that the expression is zero
when r is real and does not lie in the interval (-1,0]. When r=0 then
the expression is Indeterminate since the first term has the form zero
times infinity. The interval (-1,0)  is precisely where the arguments
of the square roots are negative. For such values whether the
expression equals zero depends on the choice of branch of the square
root. Although the expression does equal zero for the choice of branch
made by Mathematica, Simplify and Reduce apparently do not rely on a
particular branch being used (except that the positive branch is used
for roots of positive numbers).

Steve


  • Prev by Date: Re: Re: Re: Mathematica function to calculate correlation coefficient?
  • Next by Date: Re: Re: Why can't Mathematica tell when something is algebraically zero?
  • Previous by thread: Re: Re: Why can't Mathematica tell when something is algebraically zero?
  • Next by thread: Automating a finite element procedure