MathGroup Archive 2001

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

Search the Archive

Re: problem of evaluating SQRT

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27997] Re: problem of evaluating SQRT
  • From: Ioan Alexandre Romoscanu <romoscanu at imes.mavt.ethz.ch>
  • Date: Wed, 28 Mar 2001 02:40:25 -0500 (EST)
  • Organization: Swiss Federal Institute of Technology (ETHZ)
  • References: <99pd51$leb@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Pek

I think that Mathematica considers Sqrt[x^2] = Abs[x].

If x = -2,

Sqrt[x^2] - x

gives

2 - (-2)=4, not 0.

In other words, Sqrt[x^2] is not equal to x, and hence Sqrt[x^2] - x is
not equal to 0.

A.

Pek wrote:

> 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

--
___________________________________________
alexandre ioan romoscanu          - institut für mechanik
CLA G31, eth zentrum,            8092 zürich, schweiz
tel. +41 1 632 77 54,                     +41 76 323 63 05
fax.+41 1 632 11 45, romoscanu at imes.mavt.ethz.ch
___________________________________________




  • Prev by Date: Re: Exponential fit question.
  • Next by Date: Re: problem of evaluating SQRT
  • Previous by thread: Re: problem of evaluating SQRT
  • Next by thread: Re: problem of evaluating SQRT