RE: Canceling square roots with Simplify
- To: mathgroup at smc.vnet.net
- Subject: [mg18248] RE: [mg18211] Canceling square roots with Simplify
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Thu, 24 Jun 1999 14:24:27 -0400
- Sender: owner-wri-mathgroup at wolfram.com
-----Original Message-----
From: Ersek, Ted R
To: mathgroup at smc.vnet.net
Subject: [mg18248] RE: [mg18211] Canceling square roots with Simplify
Everett G. Farr wrote:
-----------------------
Try typing in the following in a new session of Mathematica (I'm currently
running ver 3.0 under WinNT).
Simplify[ Sqrt[b^2]*Sqrt[1/b^2] ]
It seems like the b's should cancel, and I should get 1. Why don't I? Is
there any workaround?
---------------------
Everett,
I think WRI left a needed rule out of the Simplify routine. Anyway I think
you can say in general that:
((zb^(-z1))^z2
and
(zb^z1)^(-z2)
are equal for any (zb,z1,z2).
If I am right the two rules below are worth keeping. They will simplify your
example and *lots* of others.
----------------
In[1]:=
MyRules= {
((zb_^(-1*z1_))^(z2_)):>((zb^z1)^(-z2)),
((zb_^p_?Negative)^z2_):>(zb^(-p))^(-z2) };
In[2]:=
example=(((z1^(-z2))^z2)^(-z3))^(-z4)
Out[2]=
(((z1^(-z2))^z2)^(-z3))^(-z4)
In[3]:=
example//.MyRules
Out[3]=
(((z1^z2)^z2)^z3)^(-z4)
---------------------
If you have Version 4.0 you can use the following to make Simplify and
FullSimplify use MyRules automatically.
In[4]:=
SetOptions[Simplify,
TransformationFunctions->{Automatic,(#//.MyRules)&}];
SetOptions[FullSimplify,
TransformationFunctions->{Automatic,(#//.MyRules)&}];
----------------
Regards,
Ted Ersek