Question: Obtain uncommuting product

 

  If I use

 

f:=(a+b)^2;
expand(f);

 

I got 

a^2+2ab+b^2

 

This result holds if ab=ba. Otherwise the result is a^2 + ab + ba + b^2

 

Is there any simpler way to obtain  a^2 + ab + ba + b^2? I looked up http://www.maplesoft.com/support/help/maple/view.aspx?path=dot

but did not find a solution :(

 

Thank you very much!

 

 

 

Please Wait...