MathGroup Archive 2011

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

Search the Archive

Re: Re: SameQ to check for simplified radical expressions... doesn't work

  • To: mathgroup at
  • Subject: [mg121023] Re: [mg121014] Re: SameQ to check for simplified radical expressions... doesn't work
  • From: Andrzej Kozlowski <akoz at>
  • Date: Tue, 23 Aug 2011 05:47:57 -0400 (EDT)
  • Delivered-to:
  • References: <> <> <op.v0mm57vdtgfoz2@bobbys-imac.local>

Well, not quite... It can't make it simpler because if Simplify did 
change 6 Sqrt[10] to Sqrt[360] then Mathematica's automatic evaluation 
would again change this to 6 Sqrt[10]. In fact, sometimes this sort of 
thing does happen, look at the Trace of this:

Trace[6*Sqrt[10] /. (a_)*Sqrt[b_] :> Sqrt[a^2*b]]

{{{Sqrt[10],Sqrt[10]},6 Sqrt[10]},{{{Sqrt[b_],Sqrt[b_]},a_ Sqrt[b_]},a_ 
Sqrt[b_]:>Sqrt[a^2 b],a_ Sqrt[b_]:>Sqrt[a^2 b]},6 Sqrt[10]/. a_ 
Sqrt[b_]:>Sqrt[a^2 b],Sqrt[6^2 10],{{6^2,36},36 10,360},Sqrt[360],6 

It does make the "simplification" but you end up where you started 

Of course, the decision to choose this particular canonical form was 
made probably because it is thought to be in some sense simpler. The 
opposite approach would have been to automatically convert expressions 
of the form a Sqrt[b] into Sqrt[a^2 b] (for positive a and b) which 
certainly would have been less pleasant (as you have noted).


On 22 Aug 2011, at 20:04, DrMajorBob wrote:

> Without Simplify, we get, as you say, canonical form... 6 Sqrt[10]. My 
point was that Simplify doesn't make it any simpler, because it doesn't 
"think" Sqrt[360] is simpler.
> I suppose none of us do.
> Bobby
> On Mon, 22 Aug 2011 05:03:59 -0500, Andrzej Kozlowski 
<akoz at> wrote:
>> On 20 Aug 2011, at 12:15, DrMajorBob wrote:
>>> The second is obviously simpler, hence Sqrt[360] is simpler than 6
>>> Sqrt[10].
>>> But Mathematica doesn't see it that way, and apparently, neither do 
>>> Bobby
>> The point here is, however, that when Mathematica evaluates
>> In[1]:= Sqrt[360]
>> Out[1]= 6 Sqrt[10]
>> it is not really "simplifying" the expression but putting it into a
>> "canonical form". Simplification depends on a complexity function but
>> canonical form do not. They are necessary, because if expressions 
>> not put into these canonical forms, certain cancellations would not 
>> place because under a given complexity function two equivalent
>> expressions might never be transformed into the same expression (so 
>> cancellation can take place). So you really need these canonical 
>> to be independent of any complexity function. Because expressions are
>> put into a canonical form before Simplify is applied, sometimes you 
>> never be able to get an answer that has the lowest complexity (for a
>> given ComplexityFunction). In this case the lowest complexity is, if
>> course, possessed by Sqrt[360]:
>> In[2]:= LeafCount[Unevaluated[Sqrt[360]]]
>> Out[2]= 2
>> In[3]:= LeafCount[Sqrt[360]]
>> Out[3]= 7
>> Andrzej Kozlowski
> --
> DrMajorBob at

  • Prev by Date: To Wolfram Mathgroup. Help me..
  • Next by Date: Re: problem with Graphics array --plots don't appear
  • Previous by thread: Re: SameQ to check for simplified radical expressions... doesn't work
  • Next by thread: Re: Re: SameQ to check for simplified radical