Take a look at let
and letsimp
. E.g.:
(%i2) expr : a + b*c + b*c*d;
(%o2) b*c*d+b*c+a
(%i3) let (b*c, k);
(%o3) b*c --> k
(%i4) letsimp (expr);
(%o4) d*k+k+a
letsimp
differs from subst
and tellsimp
or defrule
in that those other functions make only formal substitutions, i.e., replacing subexpressions which are exactly the same as some pattern.