In my recent study, I encounter the following problem:
ex:=A B (a-b)+B A (b-a)+A C (a-c)+C A (c-a)+B C (b-c)+C B (c-b);
How to simplify the expression above? i.e. get the result
$$ (AB-BA)(a-b)+(AC-CA)(a-c)+(BC-CB)(b-c) $$
Remember that you need to write either a space or a * character to indicate products. Also, NonCommuting is spelled with a single t.
What do you want to do with this? You can distribute(_) this, but there isn't much else you can simplify given that the capital symbols do not commute with each other.
Sorry for my typo. I want to extract the scalars in the following expression (the matrices outside the brackets are noncommuting)
I have written following code
substitute(_,$A?? (B??)+ C?? (D??)|B??+D??=0->(A??-C??) B??$);
but it's useless.
I don't understand what you want to do. Can you write down the expression that you would like to end up with?
OK, just like this
I have known how to solve it. Only need to combine multiplythrough ,zoom and factorout.