Take the 2-minute tour ×
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
1  
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
2  
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

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

Unprotect[Dot];
x__.(c_?NumberQ y__) := c x.y
(c_?NumberQ x__).y__ := c x.y
Protect[Dot];
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
1  
People often don't realize this until they get burnt. –  Szabolcs May 15 '13 at 23:44

Check the tutorial here.

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

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

Your Answer

 
discard

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.