# factor_in

Collect terms in a sum that differ only by given pre-factors.

Given a list of symbols, this algorithm collects terms in a sum that
only differ by pre-factors consisting of these given symbols. As an
example,ex:=a b + a c + a d;

\(\displaystyle{}a b+a c+a d\)

factor_in(_, $b,c$);

\(\displaystyle{}\left(b+c\right) a+a d\)

The name is perhaps most easily understood by thinking of it as a
complement to

`factor_out`

. Or in case you are familiar with
FORM, `factor_in`

is like its `antibracket`

statement.
The algorithm of course also works with indexed objects, as inex:=A_{m} B_{m} + C_{m} A_{m};
factor_in(_, $B_{n}, C_{n}$);

\(\displaystyle{}A_{m} B_{m}+C_{m} A_{m}\)

\(\displaystyle{}A_{m} B_{m}+C_{m} A_{m}\)

(not yet finished)