9.2 Simplifying Expressions

Suppose we want to simplify the expression a3b3 - c assuming that we know ab = 1 and ba = b.

First NCAlgebra requires us to declare the variables to be noncommutative.

In[2]:= SetNonCommutative[a,b,c]

Now we must set an order on the variables a, b and c.

In[3]:= SetMonomialOrder[{a,b,c}]

Later we explain what this does, in the context of a more compliated example where the command really matters. Here any order will do. We now simplify the expression a3b3 - c by typing

In[4]:= NCSimplifyAll[{a**a**a**b**b**b -c}, {a**b-1,b**a- b}, 3]

After messages appear on the screen (which indicate that the computation is taking place), you get the answer as the following Mathematica output.

Out[4]= {1 - c}

The number 3 indicates how hard you want to try (how long you can stand to wait) to simplify your expression.