Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I have very complicated expressions containing scalar products like

a1*b1 + a2*b2 + a3*b3

In order to reduce the complexity, I would like to establish a set of rules like

rule={a1*b1 + a2*b2 + a3*b3 -> pAB, ...}

in order to replace each time the scalar product by an appropriate new symbol (pAB in the example).

The problem is that, apparently, Mathematica does not perform the substitution if in the expression the scalar products appear together with some multiplying factor; for example Mathematica fails to apply the previous rule if the expression is

-a1*b1 - a2*b2 - a3*b3

or

2a1*b1 + 2a2*b2 + 2a3*b3

How could solve this problem?

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Symbolic replacement of scalar products

**Physics Forums - The Fusion of Science and Community**