Substitute - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


MultivariatePowerSeries

  

Substitute

  

substitute values into a power series

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Substitute(x = s, p)

Substitute(ls, p)

Parameters

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

Description

• 

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.

Examples

withMultivariatePowerSeries:

Consider the simplest case: polynomial substitution, with polynomials that are not units (that is, their constant coefficient is zero).

p1x2+yz+z

p1x2+yz+z

(1)

p2y2+zx+x

p2zx+y2+x

(2)

p3z2+xy+y

p3xy+z2+y

(3)

ps1,ps2,ps3seqPowerSeriesp,pinp1,p2,p3

ps1,ps2,ps3PowⅇrSⅇrⅈⅇs: z+x2+yz,PowⅇrSⅇrⅈⅇs: x+zx+y2,PowⅇrSⅇrⅈⅇs: y+xy+z2

(4)

resultSubstitutex=ps1,y=ps2,ps3

resultPowⅇrSⅇrⅈⅇs of x2+yz+zzx+y2+x+z2+zx+y2+x : 0+

(5)

We can obtain the same result by substituting the actual polynomials in, rather than the polynomials converted to power series.

ApproximatelyEqualresult,Substitutex=p1,y=p2,ps3,4

true

(6)

We can verify that the result is correct by comparing with the result of doing the substitution entirely in the domain of polynomials.

expandTruncateresult,4subsx=p1,y=p2,p3

0

(7)

We can do the same with unit power series.

q1,q2,q3seqp+1,pinp1,p2,p3

q1,q2,q3x2+yz+z+1,zx+y2+x+1,xy+z2+y+1

(8)

qs1,qs2,qs3seqPowerSeriesq,qinq1,q2,q3

qs1,qs2,qs3PowⅇrSⅇrⅈⅇs: 1+z+x2+yz,PowⅇrSⅇrⅈⅇs: 1+x+zx+y2,PowⅇrSⅇrⅈⅇs: 1+y+xy+z2

(9)

qresultSubstitutex=qs1,y=qs2,qs3

qresultPowⅇrSⅇrⅈⅇs of x2+yz+z+1zx+++z2+zx+y2+x+2 : 3+

(10)

ApproximatelyEqualqresult,Substitutex=q1,y=q2,qs3,4

true

(11)

expandTruncateqresult,4subsx=q1,y=q2,q3

0

(12)

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_xPowerSeriesdxdd!,analytic=expx

exp_xPowⅇrSⅇrⅈⅇs of ⅇx : 1+

(13)

resultSubstitutex=exp_x,exp_x

resultPowⅇrSⅇrⅈⅇs of ⅇⅇx : ⅇ+

(14)

Truncateresult,4

ⅇ+ⅇx+ⅇx2+5ⅇx36+5ⅇx48

(15)

seriesexpexpx,x=0,5

ⅇ+ⅇx+ⅇx2+56ⅇx3+58ⅇx4+Ox5

(16)

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_aPowerSeriesdydd!,variables=y

exp_y_no_aPowⅇrSⅇrⅈⅇs: 1+

(17)

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.

basePowerSeriesex+ey

basePowⅇrSⅇrⅈⅇs: ex+ey

(18)

step1Substituteey=exp_y_no_a,base

step1PowⅇrSⅇrⅈⅇs: 1+

(19)

step2Substituteex=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_step1Substituteex=exp_x,base

alt_step1PowⅇrSⅇrⅈⅇs of ⅇx+ey : 1+

(20)

alt_step2Substituteey=exp_y_no_a,alt_step1

alt_step2PowⅇrSⅇrⅈⅇs: 2+

(21)

This is the order chosen by Maple when the two substitutions are given simultaneously.

resultSubstituteex=exp_x,ey=exp_y_no_a,base

resultPowⅇrSⅇrⅈⅇs: 2+

(22)

ApproximatelyEqualresult,alt_step2,4

true

(23)

Compatibility

• 

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