MathGroup Archive 2001

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

Search the Archive

Re: problem of evaluating SQRT

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28015] Re: [mg27981] problem of evaluating SQRT
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Wed, 28 Mar 2001 02:40:44 -0500 (EST)
  • References: <200103270626.BAA21730@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The "correct" answer actually depends on x. If you give Mathematica no
information about x, then it can go no further. You say that you expect

In[1]:=
Sqrt[x^2] - x
Out[1]=
-x + Sqrt[x^2]

to be zero. But this is not the case when x<0, is it? You may supply
whatever information you have in the assumptions within Simplify:

In[2]:=
Simplify[Sqrt[x^2] - x, x >= 0]
Out[2]=
0
In[3]:=
Simplify[Sqrt[x^2] - x, x < 0]
Out[3]=
-2 x

Tomas Garza
Mexico City


----- Original Message -----
From: "Pek" <phsoh at alum.mit.edu>
To: mathgroup at smc.vnet.net
Subject: [mg28015] [mg27981] problem of evaluating SQRT


> Hi,
>
> We have a question of how sqrt can be evaluated.
>
> In[1]:=
> Sqrt[x^2]
>
> Out[1]=
> (This part is just sqrt[X^2])
>
> Below we expect the result to be zero but it isn't. How can we get the
> correct answer in this case?
>
> In[2]:=
> Sqrt[x^2] - x
>
> Out[2]=
> (This part is -x + sqrt[x^2] )
>
> Will really appreciate your help. Thanks.
>
> Pek
>
>



  • Prev by Date: Re: problem of evaluating SQRT
  • Next by Date: Re: seeking Wagner's Mathematica book
  • Previous by thread: problem of evaluating SQRT
  • Next by thread: Re: problem of evaluating SQRT