Re: Simplifying Sqrt[a^2*d^2] -> a*d
- To: mathgroup at smc.vnet.net
- Subject: [mg8395] Re: Simplifying Sqrt[a^2*d^2] -> a*d
- From: vvs124 at rsphy1.anu.edu.au (Victoria Steblina)
- Date: Tue, 26 Aug 1997 20:41:35 -0400
- Organization: Australian National University
- Sender: owner-wri-mathgroup at wolfram.com
In article <5tjftc$drn at smc.vnet.net> carlos at mars.Colorado.EDU (Carlos A. Felippa) writes: > I want Sqrt[a^2*d^2] to be automatically simplified to a*d > wherever it appears in a very complex expression. > > In another system I simply declare a and d real nonnegative and let the > program figure out the rest. How do I do that in Mathematica? > The obvious rule expr/.{Sqrt[a^2*d^2]->a*d} does not work. > > You can do it this way: (local) In[1]:= Unprotect[Sqrt]; Sqrt[a^2*d^2] = a*d; Protect[Sqrt]; (local) In[4]:= Sqrt[a^2*d^2] + Sqrt[a^2*d^2]^3 3 3 (local) Out[4]= a d + a d Cheers, Victoria