MathGroup Archive 1999

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

Search the Archive

RE: Sqrt problems


Rita Bijlsma wrote:
------------------------
I'm working with the textual version of mathematica 2.2 on VMS and I have
some questions related to Sqrt

  
PowerExpand[%15]

              2   2            4    4   4
         1   n  Pi    Sqrt[4 Dq  + n  Pi ]
         - - ------ + --------------------
         2       2               2
             4 Dq            4 Dq


 - How do I get mathematica to give me:      

              2   2             4   4
         1   n  Pi         1   n  Pi
         - - ------ + Sqrt[- + ------]
         2       2         4        4
             4 Dq              16 Dq
 

<snip> 
(* and several other broad questions. *)


-------------------------------

The following should help with one of your problems.


In[1]:=
1/2 - (n^2*Pi^2)/(4*Dq^2) + Sqrt[4*Dq^4 + n^4 + Pi]/(4*Dg^2)/. a_
Sqrt[b_]:>Sqrt[a^2 *b]

Out[1]=
1/2 - (n^2*Pi^2)/(4*Dq^2) + Sqrt[(4*Dq^4 + n^4 + Pi)/Dg^4]/4


This pattern matching stuff takes some practice before you get good at it.
I have a section on Pattern matching on the web page I mention below.  You
can download the whole notebook if you want.

--------------------
Regards,
Ted Ersek

For Mathematica tips, tricks see 
http://www.dot.net.au/~elisha/ersek/Tricks.html


  • Prev by Date: Re: Help with Multiple Integrals
  • Next by Date: Re: Problem with conditional definitions
  • Previous by thread: Sqrt problems
  • Next by thread: Sqrt problems