Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want Mathematica to recognize that

A.(-B.C)+A.B.C = 0

Yet FullSimplify and the like leaves the expression as it is. How do I get around this?

share|improve this question
C is not a good name for a variable. As you can see, C is in black, indicating that it means something specific to Mathematica. Look up C in the docs if you want. – Jacob Akkerboom May 15 '13 at 21:34
you could argue that capital anything is not a good name for either variables or functions in Mathematica! – SEngstrom May 15 '13 at 22:11

2 Answers 2

Check the tutorial here.

a.(-b.c) + a.b.c // TensorExpand

(* ==> 0 *)
share|improve this answer

You can teach Mathematica to factor out any number from inside a dot.

x__.(c_?NumberQ y__) := c x.y
(c_?NumberQ x__).y__ := c x.y
share|improve this answer
Keeping in mind that it's very easy to break things or introduce a significant performance penalty by modifying builtins ... – Szabolcs May 15 '13 at 23:43
People often don't realize this until they get burnt. – Szabolcs May 15 '13 at 23:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.