You can work with commutative *
and non-commutative .
Maxima products the way you want by completing the following two steps:
Now you are ready. For instance,
expand((a*x + b*y) . (a*x - b*y))
returns
a*b*yx - b^2*y^^2 - a*b*xy + a^2*x^^2
(note that ^^
is a non-commutative exponentiation operator).
source share