Suppose I've got this:
In[13]:= Expand[(a + b) (b + c) (c + a)]
Out[13]= a^2 b + a b^2 + a^2 c + 2 a b c + b^2 c + a c^2 + b c^2
And I want to collect only terms involving a^2. In other words, I want the following output:
a^2(b + c) + a b^2 + 2 a b c + b^2 c + a c^2 + b c^2
How can I do this? If I use the following:
Collect[%, a^2]
Then it simply groups terms into the highest power of a, even if the highest term is less than 2. So it results in this:
In[14]:= Collect[%, a^2]
Out[14]= b^2 c + b c^2 + a^2 (b + c) + a (b^2 + 2 b c + c^2)
Ideally, I would like to extend this further to collect all a^2, b^2, and c^2 in one expression. So that running my command would transform the original fully expanded expression into the following:
a^2(b + c) + b^2(a+c) + c^2(a+b) + 2 a b c
In a single command. It this possible?
SymmetricReduction[Expand[(a + b) (b + c) (c + a)] , {a, b, c}][[1]]– chris Nov 15 '12 at 09:32Read the FAQs! 3) When you see good Q&A, vote them up byclicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem,by clicking the checkmark sign` – Vitaliy Kaurov Nov 16 '12 at 02:14