MathGroup Archive 2001

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

Search the Archive

Re: problem of evaluating SQRT

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28004] Re: [mg27981] problem of evaluating SQRT
  • From: BobHanlon at aol.com
  • Date: Wed, 28 Mar 2001 02:40:32 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In general the result is not zero.  Even if x is real

Simplify[Sqrt[x^2] - x ,  Element[x, Reals]]

Abs[x] - x

However, assuming that x is real and non-negative then

Simplify[Sqrt[x^2] - x ,  x >= 0]

0

or

Sqrt[x^2] - x // PowerExpand

0

Bob Hanlon

In a message dated 2001/3/27 1:46:33 AM, phsoh at alum.mit.edu writes:

>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] )
>


  • Prev by Date: RE: Q: global options for styleform
  • Next by Date: Re: How to change bit-depth level for exported .gif files?
  • Previous by thread: Re: problem of evaluating SQRT
  • Next by thread: Re: problem of evaluating SQRT