distribute
Distribute factors over sums.
Rewrite a product of sums as a sum of products, as in
a(b+c)→ab+ac.
This would readex:=a (b+c);
distribute(_);
a(b+c)
ab+ac
The algorithm in fact works on all objects which carry
the
Distributable
property, Op{#}::Distributable;
ex:=Op(A+B);
distribute(_);
Attached property Distributable to Op(#).
Op(A+B)
Op(A)+Op(B)
The primary example of a property which inherits
the
Distributable
property
is PartialDerivative
. The distribute
algorithm
thus also automatically writes out partial derivatives of sums as sums
of partial derivatives,
\partial{#}::PartialDerivative;
ex:=\partial_{m}{A + B + C};
distribute(_);
Attached property PartialDerivative to ∂#.
∂m(A+B+C)
∂mA+∂mB+∂mC