Subtract - Maple Help

MultivariatePowerSeries

 Subtract
 subtract two power series or two Puiseux series or two univariate polynomial over power series

 Calling Sequence p - q Subtract(p, q) r - s Subtract(r, s) u - v Subtract(u, v)

Parameters

 p, q - power series generated by this package, polynomials, or complex constants r, s - Puiseux series generated by this package u, v - univariate polynomials over power series generated by this package with the same main variable

Description

 • The commands p - q and Subtract(p, q) return the difference of p and q.
 • The commands r - s and Subtract(r, s) return the difference of r and s. This can only be computed if the orders of r and s are compatible. See the Add help page for an explanation.
 • The commands u - v and Subtract(u, v) return the difference of u and v.
 • 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

 > $\mathrm{with}\left(\mathrm{MultivariatePowerSeries}\right):$

We define two power series.

 > $a≔\mathrm{GeometricSeries}\left(\left[x,y\right]\right):$
 > $b≔\mathrm{PowerSeries}\left(1+x+y+z\right):$

We compute their difference in two equivalent ways.

 > $c≔a-b$
 ${c}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{-}{x}{-}{y}}{-}{1}{-}{x}{-}{y}{-}{z}{:}{0}{+}{\dots }\right]$ (1)
 > $d≔\mathrm{Subtract}\left(a,b\right)$
 ${d}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{-}{x}{-}{y}}{-}{1}{-}{x}{-}{y}{-}{z}{:}{-}{z}{+}{\dots }\right]$ (2)

We verify that the two results are equal up to homogeneous degree 10.

 > $\mathrm{ApproximatelyEqual}\left(c,d,10\right)$
 ${\mathrm{true}}$ (3)

We define two univariate polynomials over power series and compute their difference.

 > $f≔\mathrm{UnivariatePolynomialOverPowerSeries}\left(xz+y{z}^{2}+xy{z}^{3},z\right):$
 > $g≔\mathrm{UnivariatePolynomialOverPowerSeries}\left(\left[\mathrm{GeometricSeries}\left(\left[x,y\right]\right)\right],z\right):$
 > $h≔\mathrm{Subtract}\left(f,g\right)$
 ${h}{≔}\left[{UnivariatⅇPolynomialOvⅇrPowⅇrSⅇriⅇs:}\left({-1}{+}{\dots }\right){+}\left({x}\right){}{z}{+}\left({y}\right){}{{z}}^{{2}}{+}\left({x}{}{y}\right){}{{z}}^{{3}}\right]$ (4)

Create three Puiseux series.

 > $\mathrm{s1}≔\mathrm{PuiseuxSeries}\left(\mathrm{PowerSeries}\left(\frac{1}{1+u}\right),\left[u={x}^{-\frac{1}{3}}{y}^{2}\right],\left[x=3,y=-4\right]\right)$
 ${\mathrm{s1}}{≔}\left[{PuisⅇuxSⅇriⅇs of}\frac{{{x}}^{{3}}}{\left({1}{+}\frac{{{y}}^{{2}}}{{{x}}^{{1}}{{3}}}}\right){}{{y}}^{{4}}}{:}\frac{{{x}}^{{3}}}{{{y}}^{{4}}}{+}{\dots }\right]$ (5)
 > $\mathrm{s2}≔\mathrm{PuiseuxSeries}\left(2+2\left(u+v\right),\left[u={x}^{-\frac{1}{2}}y,v=y\right],\left[x=3,y=2\right]\right)$
 ${\mathrm{s2}}{≔}\left[{PuisⅇuxSⅇriⅇs of}\left({2}{+}\frac{{2}{}{y}}{\sqrt{{x}}}{+}{2}{}{y}\right){}{{x}}^{{3}}{}{{y}}^{{2}}{:}{2}{}{{x}}^{{3}}{}{{y}}^{{2}}{+}{2}{}{{x}}^{{5}}{{2}}}{}{{y}}^{{3}}{+}{2}{}{{y}}^{{3}}{}{{x}}^{{3}}\right]$ (6)
 > $\mathrm{s3}≔\mathrm{PuiseuxSeries}\left(\mathrm{PowerSeries}\left(\frac{1}{1+uv}\right),\left[y,x\right],\left[u,v\right],\left[\left[1,0\right],\left[1,-\frac{1}{2}\right]\right]\right)$
 ${\mathrm{s3}}{≔}\left[{PuisⅇuxSⅇriⅇs of}\frac{{1}}{\frac{{{y}}^{{2}}}{\sqrt{{x}}}{+}{1}}{:}{1}{+}{\dots }\right]$ (7)

We subtract $\mathrm{s1}$ and $\mathrm{s2}$.

 > $\mathrm{Subtract}\left(\mathrm{s1},\mathrm{s2}\right)$
 $\left[{PuisⅇuxSⅇriⅇs of}\frac{\left(\frac{{1}}{{1}{+}\frac{{{y}}^{{2}}}{{{x}}^{{1}}{{3}}}}}{+}\left({-}{2}{}{}{\dots }{-}{\dots }{-}{2}\right){}{{y}}^{{6}}\right){}{{x}}^{{3}}}{{{y}}^{{4}}}{:}\frac{{{x}}^{{3}}}{{{y}}^{{4}}}{+}{\dots }\right]$ (8)

We get an error if we try to subtract $\mathrm{s1}$ and $\mathrm{s3}$, since the orders [x,y] and [y,x] are not compatible.

 > $\mathrm{Subtract}\left(\mathrm{s1},\mathrm{s3}\right)$

We can use the command GetPuiseuxSeriesOrder to obtain the Puiseux series order of $\mathrm{s1}$ and $\mathrm{s3}$.

 > $\mathrm{GetPuiseuxSeriesOrder}\left(\mathrm{s1}\right)$
 $\left[{x}{,}{y}\right]$ (9)
 > $\mathrm{GetPuiseuxSeriesOrder}\left(\mathrm{s3}\right)$
 $\left[{y}{,}{x}\right]$ (10)

Compatibility

 • The MultivariatePowerSeries[Subtract] command was introduced in Maple 2021.