subst takes two or three arguments :
subst returns the expression with the substitution done.
Note that subst does not quote its argument, hence
in a normal evaluation process, the substitution variable should
be purged otherwise it will be replaced by its assigned value
before substitution is done.
Input :
^
2+1,a=2)or :
^
2+1,a,2)Output (if the variable a is purged else first input purge(a)) :
Input :
^
2+b,[a,b],[2,1])or :
^
2+b,[a=2,b=1])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.
Input :
^
2)*x,x,0,pi/2)’,x=sqrt(t))or :
^
2)*x,x,0,pi/2),x=sqrt(t))Output
^
2)Input :
^
2)*x,x)’,x=sqrt(t))or :
^
2)*x,x),x=sqrt(t))Output