       Sqrt Tip

• Subject: [mg3032] Sqrt Tip
• From: BobHanlon at aol.com
• Date: 24 Jan 1996 15:35:12 -0600
• Approved: usenet@wri.com
• Distribution: local
• Newsgroups: wri.mathgroup
• Organization: Wolfram Research, Inc.
• Sender: mj at wri.com

```Mathematica version 2.2 on a Macintosh does not simplify the product
of square roots:

In:=
Sqrt[x] Sqrt[y] // Simplify

Out=
Sqrt[x] Sqrt[y]

As a result, it overlooks some straightforward simplifications.
For example,

In:=
Sqrt[1-x] Sqrt[1+x]/Sqrt[1 - x^2] // Simplify

Out=
Sqrt[1 - x] Sqrt[1 + x]
-----------------------
2
Sqrt[1 - x ]

One would like to modify the definition of Sqrt to correct this as
follows:

In:=
Unprotect[Sqrt];
Sqrt/: Sqrt[a_] Sqrt[b_] := Sqrt[a b];
Protect[Sqrt];

This generates the error message

TagSetDelayed::tagnf:

The reason that this failed is apparent if the FullForm of Sqrt is
inspected

In:=
Sqrt[x] // FullForm

Out//FullForm=
Power[x, Rational[1, 2]]

Sqrt is represented internally using Power.  Consequently, the
modification must be made to Power rather than Sqrt.

In:=
Unprotect[Power];
Power/: Sqrt[a_] Sqrt[b_] := Sqrt[a b];
Protect[Power];

After, modifying Power we obtain the desired result:

In:=
Sqrt[1-x] Sqrt[1+x]/Sqrt[1 - x^2] // Simplify

Out=
1
_______________

Bob Hanlon
bobhanlon at aol.com

```

• Prev by Date: Sqrt Tip
• Next by Date: a polyhedral function
• Previous by thread: Sqrt Tip
• Next by thread: Re: Sqrt Tip