NonCommutativeExpand
NonCommutativeExpand[expr]
NonCommutativeExpand[expr, alg]expands non-commutative products in expr. With a second argument, multiplication, addition and algebra relations are taken from alg.
Example
NonCommutativeExpand[(a + 2 b) ** (3 a + 4 b)]Unlike ordinary Expand, the order of factors joined by ** is preserved.
See the official Wolfram Language reference for more details.