Maxima Function
distrib (expr)
Distributes sums over products. It differs from expand
in that it works at only the top level of an expression, i.e., it doesn't
recurse and it is faster than expand
. It differs from multthru
in
that it expands all sums at that level.
Examples:
(%i1) distrib ((a+b) * (c+d)); (%o1) b d + a d + b c + a c (%i2) multthru ((a+b) * (c+d)); (%o2) (b + a) d + (b + a) c (%i3) distrib (1/((a+b) * (c+d))); 1 (%o3) --------------- (b + a) (d + c) (%i4) expand (1/((a+b) * (c+d)), 1, 0); 1 (%o4) --------------------- b d + a d + b c + a c