Take the 2-minute tour ×  I wish to use Distribute[p.(q+r)+m] to
get p.q+p.r+m. However, Distribute apparently does not thread
through all parts of the expression. What should I do instead?
share|improve this question Is Distribute[#] & /@ (p.(q + r) +
m) acceptable ? –  b.gatessucks Nov 29 '12 at 9:26 @b.gatessucks
This is not good because if there is a function like Log[a+b]
inside the expression, the distribute would expand that too,
yielding Log[a]+Log[b]. –  QuantumDot Jan 8 '13 at 20:06
@QuantumDot That would be a different question, too. – 
b.gatessucks Jan 8 '13 at 20:10 Oh, that's true. On second
thought, never mind. –  QuantumDot Jan 8 '13 at 20:24  3 Answers
3  You don't give a lot of context about how the target
expression is generated (interactively or via code). The
documentation for Distribute indicates that it won't
automatically map down through an expression. But, one way to do
this comes to mind.  Via code, using ReplaceAll and a
replacement rule:  expr /. d : HoldPattern[Dot[_, Plus[_, _]