Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: sqrt(x^2) = x

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61189] Re: sqrt(x^2) = x
  • From: "Francisco Javier" <pacoga at ctv.es>
  • Date: Wed, 12 Oct 2005 01:42:23 -0400 (EDT)
  • References: <difreg$fg6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Francisco Javier a formulé ce martes :
> Dear all, I am new in this group
>
> How can I tell Mathematica that I want to simplify all expressions like 
> Sqrt[x^2] as x, whithout taking into account that x is or not a 
> positive real number?
>
> Thank you very much

Dear F.Jaccard and Ruth for your answers, but what I really mean has 
not a such simple solution.

I want to "teach" to Mathematica that in next calculations Sqrt[x^2] is 
equivalent to x,

I have tried

Unprotect[Sqrt];
Sqrt[(x_)^2] := x;

This seems works fine then with calculations like

Sqrt[y^2]
y

but it fails with

Sqrt[x^2 y^4]

or even with

Sqrt[x^2 y^4]

Any ideas?

-- 
----
Francisco Javier García Capitán
http://garciacapitan.auna.com


  • Prev by Date: Imposing a value for LeafCount
  • Next by Date: Solving Diophantine Equations
  • Previous by thread: Re: sqrt(x^2) = x
  • Next by thread: Re: Re: sqrt(x^2) = x