RE: Sqrt problems
- To: mathgroup at smc.vnet.net
- Subject: [mg19522] RE: [mg19504] Sqrt problems
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Sun, 29 Aug 1999 03:00:40 -0400
- Sender: owner-wri-mathgroup at wolfram.com
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