Re: Problems with simplify and Sqrt[a^2]

*To*: mathgroup at smc.vnet.net*Subject*: [mg73977] Re: Problems with simplify and Sqrt[a^2]*From*: "dimitris" <dimmechan at yahoo.com>*Date*: Sat, 3 Mar 2007 23:55:28 -0500 (EST)*References*: <es907e$2b4$1@smc.vnet.net>

=CF/=C7 dshortho =DD=E3=F1=E1=F8=E5: > any help on this one: > > if you type in: > v3/Sqrt[v1^2]/Sqrt[v2^2] - v3/v1/v2 > > you get the same expression > > Even if you then type > Simplify[%] > > you still get the same expression > > I would have thought Mathematica would have resolved Sqrt[v1^2] to v1 (!?) > > Does anyone out there know why it does not do this, as it is causing some= problems with some proofs I am doing ? Are you sure that Sqrt[v1^2] and v1 are the same for all values of v1? In[96]:= (Sqrt[#1^2] - #1 & ) /@ {-2, -3, 0, 4, 5, 3 + I, 3 - I, I, -3 + I, -5 + 9*I} Out[96]= {4, 6, 0, 0, 0, 0, 0, 0, 6 - 2*I, 10 - 18*I} Mathematica by default assumes that the variables are complex. As you see Sqrt[v1^2]-v1=0 is true only for Re[v1]>0. So In[102]:= Simplify[Sqrt[v1^2] - v1, Re[v1] > 0] Out[102]= 0 Or In[105]:= PowerExpand[Sqrt[v1^2] - v1] Out[105]= 0 but be careful with its use! Read before proceeding to any applications the relevant material from the Help Browser. If you deal with cases like this frequently then you can add this assumption (that is, Re[v]>0) as follows Then In[110]:= $Assumptions = {Re[v1] > 0 && Re[v2] > 0} Out[110]= {Re[v1] > 0 && Re[v2] > 0} In[111]:= Simplify[v3/Sqrt[v1^2]/Sqrt[v2^2] - v3/v1/v2] Out[111]= 0 as you wish! To restore the default setting execute In[112]:= $Assumptions = {} Out[112]= {} Dimitris