Re: Canceling square roots with Simplify

• To: mathgroup at smc.vnet.net
• Subject: [mg18257] Re: Canceling square roots with Simplify
• Date: Thu, 24 Jun 1999 14:24:40 -0400
• Organization: Wolfram Research, Inc.
• References: <7kpage\$49n@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```efarr wrote:
>
> Hello,
>
> 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?
>
> Thanks very much
>
> Everett G. Farr

The expression needs not to be equal to 1 for
complex values of b:

In[1]:= Sqrt[b^2]*Sqrt[1/b^2] /. b->I
Out[1]= -1

To get the simplification anyway you can use
PowerExpand, which uses the transformation
(a^b)^c -> a^(b*c).

In[1]:= PowerExpand[Sqrt[b^2]*Sqrt[1/b^2]]
Out[1]= 1

However, you need to keep in mind that the
transformation is not correct in general, so
the results obtained using PowerExpand may not
be correct for all values of parameters.

In Mathematica 4 you can get the simplification
by telling Simplify that b is real.

In[2]:= Simplify[Sqrt[b^2]*Sqrt[1/b^2], Element[b, Reals]]
Out[2]= 1

Best Regards,