<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, collect and sqrt</title>
    <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 20:49:13 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 20:49:13 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, collect and sqrt</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, collect and sqrt</title>
      <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt</link>
    </image>
    <item>
      <title>collect by rule</title>
      <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt?ref=Feed:MaplePrimes:collect and sqrt:Comments#answer141404</link>
      <itunes:summary>&lt;p&gt;Using a transformation rule may be the easier way like:&lt;/p&gt;
&lt;pre&gt;r:=A::algebraic*sqrt(a::algebraic)+B::algebraic*sqrt(a::algebraic)=(A+B)*sqrt(a):
ex:=(-14+9*(2-2*cos(mux))^(1/2))*cos(mu*x)+62+27*(2-2*cos(mux))^(1/2):
applyrule(r,expand(ex));
                                              1/2
           (27 + 9 cos(mu x)) (2 - 2 cos(mux))    + 62 - 14 cos(mu x)
&lt;/pre&gt;
&lt;p&gt;And as an alternative to having in store a factorization rule specific to &lt;strong&gt;sqrt&lt;/strong&gt; expressions, you may just keep a procedure generating factorization rules for diverse expressions:&lt;/p&gt;
&lt;pre&gt;fac:=proc(p)
A::identical(p)*B::algebraic+A::identical(p)*C::algebraic=A*(B+C):
end proc:

applyrule(fac((2-2*cos(mux))^(1/2)),expand(ex));
                                              1/2
           (27 + 9 cos(mu x)) (2 - 2 cos(mux))    + 62 - 14 cos(mu x)

&lt;/pre&gt;
&lt;p&gt;Note that I dislike retyping input from an image. Just use the preformatted mode.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Using a transformation rule may be the easier way like:&lt;/p&gt;
&lt;pre&gt;r:=A::algebraic*sqrt(a::algebraic)+B::algebraic*sqrt(a::algebraic)=(A+B)*sqrt(a):
ex:=(-14+9*(2-2*cos(mux))^(1/2))*cos(mu*x)+62+27*(2-2*cos(mux))^(1/2):
applyrule(r,expand(ex));
                                              1/2
           (27 + 9 cos(mu x)) (2 - 2 cos(mux))    + 62 - 14 cos(mu x)
&lt;/pre&gt;
&lt;p&gt;And as an alternative to having in store a factorization rule specific to &lt;strong&gt;sqrt&lt;/strong&gt; expressions, you may just keep a procedure generating factorization rules for diverse expressions:&lt;/p&gt;
&lt;pre&gt;fac:=proc(p)
A::identical(p)*B::algebraic+A::identical(p)*C::algebraic=A*(B+C):
end proc:

applyrule(fac((2-2*cos(mux))^(1/2)),expand(ex));
                                              1/2
           (27 + 9 cos(mu x)) (2 - 2 cos(mux))    + 62 - 14 cos(mu x)

&lt;/pre&gt;
&lt;p&gt;Note that I dislike retyping input from an image. Just use the preformatted mode.&lt;/p&gt;</description>
      <guid>141404</guid>
      <pubDate>Thu, 13 Dec 2012 07:17:12 Z</pubDate>
      <itunes:author>Alejandro Jakubi</itunes:author>
      <author>Alejandro Jakubi</author>
    </item>
    <item>
      <title>frontend or freeze and thaw</title>
      <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt?ref=Feed:MaplePrimes:collect and sqrt:Comments#answer141421</link>
      <itunes:summary>&lt;p&gt;ex:=(-14+9*(2-2*cos(mux))^(1/2))*cos(mu*x)+62+27*(2-2*cos(mux))^(1/2);&lt;br&gt;(Thanks to Alejandro for typing).&lt;br&gt;s:=op(indets(ex,`^`(anything,1/2)));&lt;br&gt;subs(s=freeze(s),ex);&lt;br&gt;collect(%,freeze(s));&lt;br&gt;thaw(%);&lt;br&gt;#Or use frontend:&lt;br&gt;frontend(collect,[ex,s], [{`+`,`*`},{}]);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;ex:=(-14+9*(2-2*cos(mux))^(1/2))*cos(mu*x)+62+27*(2-2*cos(mux))^(1/2);&lt;br&gt;(Thanks to Alejandro for typing).&lt;br&gt;s:=op(indets(ex,`^`(anything,1/2)));&lt;br&gt;subs(s=freeze(s),ex);&lt;br&gt;collect(%,freeze(s));&lt;br&gt;thaw(%);&lt;br&gt;#Or use frontend:&lt;br&gt;frontend(collect,[ex,s], [{`+`,`*`},{}]);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>141421</guid>
      <pubDate>Thu, 13 Dec 2012 17:46:12 Z</pubDate>
      <itunes:author>Preben Alsholm</itunes:author>
      <author>Preben Alsholm</author>
    </item>
    <item>
      <title>Shorter frontend command</title>
      <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt?ref=Feed:MaplePrimes:collect and sqrt:Comments#comment141423</link>
      <itunes:summary>&lt;p&gt;Preben's example of &lt;strong&gt;frontend&lt;/strong&gt; uses the default value of the third parameter, &lt;strong&gt;[{`+`,`*`}, {}]&lt;/strong&gt;, so one could just use the user-friendlier-looking &lt;strong&gt;frontend(collect, [ex,s])&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I often forget about this powerful command simply because the name is so vague. IgnoreIndets would be a better name, as it seems closely related to subsindets and evalindets.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Preben's example of &lt;strong&gt;frontend&lt;/strong&gt; uses the default value of the third parameter, &lt;strong&gt;[{`+`,`*`}, {}]&lt;/strong&gt;, so one could just use the user-friendlier-looking &lt;strong&gt;frontend(collect, [ex,s])&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I often forget about this powerful command simply because the name is so vague. IgnoreIndets would be a better name, as it seems closely related to subsindets and evalindets.&lt;/p&gt;</description>
      <guid>141423</guid>
      <pubDate>Thu, 13 Dec 2012 20:11:08 Z</pubDate>
      <itunes:author>Carl Love</itunes:author>
      <author>Carl Love</author>
    </item>
    <item>
      <title>Thanks all</title>
      <link>http://www.mapleprimes.com/questions/141397-Collect-And-Sqrt?ref=Feed:MaplePrimes:collect and sqrt:Comments#comment141443</link>
      <itunes:summary>&lt;p&gt;Thanks to all for your good suggestions, which will solve probems of this nature. Maple is a complex beast &amp;amp; I still have a lot to learn.&lt;/p&gt;
&lt;p&gt;Alejandro's suggestion of a distributive rule reminds me that my problem is structurally similar to one I had some time ago, involving sums, which was solved right here on Mapleprimes with a similar approach. Some of us need to be taught more than once, I guess :-)&lt;/p&gt;
&lt;p&gt;frontend, freeze and thaw are completely, utterly new to me. Thanks for pointing these out.&lt;/p&gt;
&lt;p&gt;As for the output format: I was aware that pasting 2-d output is not optimal but did not know how to fix it. I was looking for the equivalent of InputForm in Mma, but Maple does not have that. Well, lprint is it, so next time I will have to use a different excuse.&lt;/p&gt;
&lt;p&gt;M.D.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks to all for your good suggestions, which will solve probems of this nature. Maple is a complex beast &amp;amp; I still have a lot to learn.&lt;/p&gt;
&lt;p&gt;Alejandro's suggestion of a distributive rule reminds me that my problem is structurally similar to one I had some time ago, involving sums, which was solved right here on Mapleprimes with a similar approach. Some of us need to be taught more than once, I guess :-)&lt;/p&gt;
&lt;p&gt;frontend, freeze and thaw are completely, utterly new to me. Thanks for pointing these out.&lt;/p&gt;
&lt;p&gt;As for the output format: I was aware that pasting 2-d output is not optimal but did not know how to fix it. I was looking for the equivalent of InputForm in Mma, but Maple does not have that. Well, lprint is it, so next time I will have to use a different excuse.&lt;/p&gt;
&lt;p&gt;M.D.&lt;/p&gt;</description>
      <guid>141443</guid>
      <pubDate>Thu, 13 Dec 2012 23:39:10 Z</pubDate>
      <itunes:author>Mac Dude</itunes:author>
      <author>Mac Dude</author>
    </item>
  </channel>
</rss>