subst takes two or three arguments :
subst returns the expression with the substitution done.
Note that subst does not quote it’s argument, hence
in a normal evaluation process, the substitution variable should
be purged otherwise it will be replaced by it’s assigned value
before substitution is done.
Output (if the variable a is purged else first input purge(a)) :
Output (if the variables a and b are purged else first input purge(a,b)) :
subst may also be used to make a change of variable in an integral.
In this case the integrate command should be quoted
(otherwise, the integral would be computed before substitution) or
the inert form Int should be used.
In both cases, the name of the integration variable must be given as
argument of Int or integrate even you are integrating
with respect to x.