Maxima Function
substpart (x, expr, n_1, ..., n_k)
Substitutes x for the subexpression
picked out by the rest of the arguments as in part
. It returns the
new value of expr. x may be some operator to be substituted for an
operator of expr. In some cases x needs to be enclosed in double-quotes "
(e.g. substpart ("+", a*b, 0)
yields b + a
).
(%i1) 1/(x^2 + 2); 1 (%o1) ------ 2 x + 2 (%i2) substpart (3/2, %, 2, 1, 2); 1 (%o2) -------- 3/2 x + 2 (%i3) a*x + f(b, y); (%o3) a x + f(b, y) (%i4) substpart ("+", %, 1, 0); (%o4) x + f(b, y) + a
Also, setting the option inflag
to true
and calling part
or substpart
is
the same as calling inpart
or substinpart
.