MultivariatePowerSeries
Substitute
substitute values into a power series
Calling Sequence
Parameters
Description
Examples
Compatibility
Substitute(x = s, p)
Substitute(ls, p)
x
-
variable
s
polynomial or power series generated by this package
p
power series generated by this package
ls
list or set of substitutions, each of the form x = s
The command Substitute(x = s, p) computes the result of substituting the expression s for the variable x in the power series p. The expression s can be a polynomial or a power series generated by this package.
The calling sequence Substitute(ls, p), where ls is a list or set of equations of the form x = s above, applies all of the given substitutions simultaneously. More precisely, if ls contains the equations x[i] = s[i] where i runs from 1 to n, then it returns an answer equivalent to what would be obtained from the following process:
For each variable v[i,j] occurring in s[i], replace it with a variable u[i,j] that does not occur anywhere else (it should also not occur as u[i,j] in previous such replacements). Call the result t[i].
Perform the substitutions x[i] = t[i] in any order. Call the result q.
Replace each u[i, j] in q with the original v[i, j].
An error is signaled if the same variable x occurs more than once as a left hand side in ls.
If s is not a unit, that is, if its constant coefficient is zero, then the result of the substitution is easily defined by just substituting one power series into another; one need consider only finitely many terms to find any homogeneous component of the result. However, if s is a unit, then the result of the substitution is a priori not well-defined. In these cases, Maple uses the analytic expression specified for p in a computation that gives a result that is correct in a formal sense. If the analytic expression for p is not specified, Maple signals an error. If a list or set of substitutions is specified and some of the right hand sides s are unit power series, then this computation only works if p and at least all but one of these unit power series have their analytic expression specified.
When using the MultivariatePowerSeries package, do not assign anything to the variables occurring in the power series, Puiseux series, and univariate polynomials over these series. If you do, you may see invalid results.
with⁡MultivariatePowerSeries:
Consider the simplest case: polynomial substitution, with polynomials that are not units (that is, their constant coefficient is zero).
p1≔x2+y⁢z+z
p2≔y2+z⁢x+x
p2≔z⁢x+y2+x
p3≔z2+x⁢y+y
p3≔x⁢y+z2+y
ps1,ps2,ps3≔seq⁡PowerSeries⁡p,pinp1,p2,p3
ps1,ps2,ps3≔PowⅇrSⅇrⅈⅇs: z+x2+y⁢z,PowⅇrSⅇrⅈⅇs: x+z⁢x+y2,PowⅇrSⅇrⅈⅇs: y+x⁢y+z2
result≔Substitute⁡x=ps1,y=ps2,ps3
result≔PowⅇrSⅇrⅈⅇs of x2+y⁢z+z⁢z⁢x+y2+x+z2+z⁢x+y2+x : 0+…
We can obtain the same result by substituting the actual polynomials in, rather than the polynomials converted to power series.
ApproximatelyEqual⁡result,Substitute⁡x=p1,y=p2,ps3,4
true
We can verify that the result is correct by comparing with the result of doing the substitution entirely in the domain of polynomials.
expand⁡Truncate⁡result,4−subs⁡x=p1,y=p2,p3
0
We can do the same with unit power series.
q1,q2,q3≔seq⁡p+1,pinp1,p2,p3
q1,q2,q3≔x2+y⁢z+z+1,z⁢x+y2+x+1,x⁢y+z2+y+1
qs1,qs2,qs3≔seq⁡PowerSeries⁡q,qinq1,q2,q3
qs1,qs2,qs3≔PowⅇrSⅇrⅈⅇs: 1+z+x2+y⁢z,PowⅇrSⅇrⅈⅇs: 1+x+z⁢x+y2,PowⅇrSⅇrⅈⅇs: 1+y+x⁢y+z2
qresult≔Substitute⁡x=qs1,y=qs2,qs3
qresult≔PowⅇrSⅇrⅈⅇs of x2+y⁢z+z+1⁢z⁢x+…+…+z2+z⁢x+y2+x+2 : 3+…
ApproximatelyEqual⁡qresult,Substitute⁡x=q1,y=q2,qs3,4
expand⁡Truncate⁡qresult,4−subs⁡x=q1,y=q2,q3
The following example shows that simple arithmetic does not suffice to do the substitution operation: the input power series has rational coefficients, but the result has transcendental coefficients. We compute the power series for ⅇⅇx from that of ⅇx.
exp_x≔PowerSeries⁡d↦xdd!,analytic=exp⁡x
exp_x≔PowⅇrSⅇrⅈⅇs of ⅇx : 1+…
result≔Substitute⁡x=exp_x,exp_x
result≔PowⅇrSⅇrⅈⅇs of ⅇⅇx : ⅇ+…
Truncate⁡result,4
ⅇ+ⅇ⁢x+ⅇ⁢x2+5⁢ⅇ⁢x36+5⁢ⅇ⁢x48
series⁡exp⁡exp⁡x,x=0,5
ⅇ+ⅇ⁢x+ⅇ⁢x2+56⁢ⅇ⁢x3+58⁢ⅇ⁢x4+O⁡x5
To underscore the necessity to have analytic expressions in the presence of unit power series, consider the following example, where we omit the analytic expression for the series of ⅇy.
exp_y_no_a≔PowerSeries⁡d↦ydd!,variables=y
exp_y_no_a≔PowⅇrSⅇrⅈⅇs: 1+…
We want to substitute ⅇx for ex and ⅇy for ey in ex+ey. If we first substitute ⅇy for ey, then the resulting power series doesn't know its analytic expression, and we obtain an error when we substitute ⅇx for x.
base≔PowerSeries⁡ex+ey
base≔PowⅇrSⅇrⅈⅇs: ex+ey
step1≔Substitute⁡ey=exp_y_no_a,base
step1≔PowⅇrSⅇrⅈⅇs: 1+…
step2≔Substitute⁡ex=exp_x,step1
Error, (in MultivariatePowerSeries:-Substitute) substituting a unit power series into a power series with undefined analytic expression
In the other order, the process does work.
alt_step1≔Substitute⁡ex=exp_x,base
alt_step1≔PowⅇrSⅇrⅈⅇs of ⅇx+ey : 1+…
alt_step2≔Substitute⁡ey=exp_y_no_a,alt_step1
alt_step2≔PowⅇrSⅇrⅈⅇs: 2+…
This is the order chosen by Maple when the two substitutions are given simultaneously.
result≔Substitute⁡ex=exp_x,ey=exp_y_no_a,base
result≔PowⅇrSⅇrⅈⅇs: 2+…
ApproximatelyEqual⁡result,alt_step2,4
The MultivariatePowerSeries[Substitute] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
eval
MultivariatePowerSeries[PowerSeries]
subs
Download Help Document