Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.2K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Simplifying Sqrt[a+b]Sqrt[a-b] to Sqrt[a^2-b^2]

Posted 6 years ago
POSTED BY: Troy Wahl
4 Replies
Posted 6 years ago
POSTED BY: Troy Wahl
Posted 6 years ago

Hi Troy,

Sorry about that. I did not realize you were looking for a generic solution. Regarding

how to pattern match the sequence of Power[z1,1/2]Power[z2,1/2]

Power[z1, 1/2] Power[z2, 1/2] /. 
 Times[Power[a_, 1/2], Power[b_, 1/2]] :> Power[a b, 1/2]
(* Sqrt[z1 z2] *)

But again, that might just be a specific solution and potentially dangerous since it is not true for all z1 and z2.

POSTED BY: Rohit Namjoshi
Posted 6 years ago

Hi Rohit,

I'm sorry you've miss understood, but your suggestion is not a workable solution for my problem as I need a routine that pattern matches so that I can apply it to between 100,000 to 1 million symbolic equations where this issue is not always present. Also, the assumption you are making is, in general, false.

POSTED BY: Troy Wahl
Posted 6 years ago

Hi Troy,

You need to provide some assumptions for that identity to be true.

exp = Sqrt[a + b]*Sqrt[a - b]
Simplify[exp, a + b >= 0 && a - b >= 0]
(* Sqrt[a^2 - b^2] *)
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard