subsop
substitute for specified operands in an expression
Calling Sequence
Parameters
Description
Thread Safety
Examples
An example involving integrals
subsop(eq1, eq2, ..., eqn, expr)
eq[i]
-
(optional) equation of the form speci=expri, where each speci is an integer or list of integers, and each expri is an expression
expr
expression
The subsop function is used to replace specified operands of an expression with new values. It will do the simultaneous substitutions specified by the eqi equation arguments in the last argument expr. The result is obtained by replacing op(spec1, expr) by expr1, op(spec2, expr) by expr2, ..., and op(specn, expr) by exprn in expr.
Each speci can be either an integer, or a list of integers. If a list of integers is specified, the integers refer to sub-operands of expr at increasing nesting levels. See op for further details.
The integer(s) comprising each speci must lie in the range −nops⁡expr..nops⁡expr. A speci of 0 is allowed only for function, indexed expression, and series exprs.
If an integer n in a speci is negative, it is considered equivalent to nops⁡expr+n+1.
If no eqi are specified, subsop returns its argument with no substitutions.
See also the applyop command which can be used to apply a function to specified operands of an expression.
The action of substitution is not followed by evaluation. In cases where full evaluation is desired, the eval command should be used.
The subsop command is thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
p≔x7+8⁢x6+x2−9
op⁡2,p
8⁢x6
subsop⁡2=y,p
x7+x2+y−9
subsop⁡2=−op⁡2,p,p
x7−8⁢x6+x2−9
subsop⁡1=0,p
8⁢x6+x2−9
subsop⁡1=1,x⁢y⁢z
y⁢z
subsop⁡1=NULL,2=z,3=y,x,y,z
z,y
subsop⁡0=g,fa,b,c
ga,b,c
p≔f⁡x,g⁡x,y,z,x
subsop⁡2,3=w,p
f⁡x,g⁡x,y,w,x
subsop⁡2,0=h,2,3=w,3=a,p
f⁡x,h⁡x,y,w,a
subsop⁡p
f⁡x,g⁡x,y,z,x
You can use subsop and applyop to perform a change of variables in an integral step-by-step.
Int(sin(sqrt(x)),x=0..t);
∫0tsin⁡xⅆx
Apply the change of variable u = x^(1/2)
subsop( [1,1]=u, (13) );
∫0tsin⁡uⅆx
We have dx = 2*u*du
subsop( 1=2*u*op(1,(14)), [2,1]=u, (14) );
∫0t2⁢u⁢sin⁡uⅆu
applyop( sqrt, [2,2,2], (15) );
See Also
applyop
eval
membertype
op
subs
Download Help Document