MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulating square roots


alan wrote:

> How can I get mathematica to bring a factor inside a square root?  For
> instance
> a Sqrt(1-(b/a)^2)  -> Sqrt(a^2-b^2)  (if a is real and a > 0).
> Also, how do I get Mathematica to perform the operation in reverse?
>

To get a under the root is easy:

new=Simplify[a Sqrt[1-(b/a)^2], a>0]

For the reverse, you might use a rule:

new/.Sqrt[a_^2-b_^2]:>a Sqrt[1-(b/a)^2]

This will work in this simple case, but fail if e.g. the root is in the
denominator, because then the FullForm no longer matches the pattern
Sqrt[a_^2-b_^2]  

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: notebooks default context
  • Next by Date: Re: an issue of consistency
  • Previous by thread: Manipulating square roots
  • Next by thread: Re: Manipulating square roots