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

MultivariatePowerSeries

 TaylorShift
 perform a Taylor shift of power series or a univariate polynomial over power series

 Calling Sequence TaylorShift(p, e) TaylorShift(u, c)

Parameters

 p - power series generated by this package e - one or more equations of the form x = c, indicating that x should be shifted by c; e can be a single equation, or a list or set of equations. c - numeric value or algebraic number u - univariate polynomial over power series generated by this package -- note, univariate polynomials over Puiseux series are not supported

Description

 • The command TaylorShift(p, e) returns the power series obtained by substituting x + c for x in p for each equation x = c in e. This can only be computed from the analytic expression of p. If the analytic expression for p is not known, an error is signaled.
 • The command TaylorShift(u, c) returns the univariate polynomial over power series obtained by substituting v + c for v in u, where v is the main variable of u.
 • A typical usage is when c is a root of the polynomial returned by EvaluateAtOrigin(u). This happens, for example, in HenselFactorize.
 • This command is supported for univariate polynomials over power series, but not for univariate polynomials over Puiseux series.
 • 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 a power series for $\mathrm{sin}\left(x\right){ⅇ}^{y}$.

 > $\mathrm{sinx}≔\mathrm{PowerSeries}\left(d↦\mathrm{ifelse}\left(d::\mathrm{even},0,\frac{{\left(-1\right)}^{\frac{d}{2}-\frac{1}{2}}\cdot {x}^{d}}{d!}\right),\mathrm{analytic}=\mathrm{sin}\left(x\right)\right)$
 ${\mathrm{sinx}}{≔}\left[{PowⅇrSⅇriⅇs of}{\mathrm{sin}}{}\left({x}\right){:}{0}{+}{\dots }\right]$ (1)
 > $\mathrm{expy}≔\mathrm{PowerSeries}\left(d↦\frac{{y}^{d}}{d!},\mathrm{analytic}=\mathrm{exp}\left(y\right)\right)$
 ${\mathrm{expy}}{≔}\left[{PowⅇrSⅇriⅇs of}{{ⅇ}}^{{y}}{:}{1}{+}{\dots }\right]$ (2)
 > $\mathrm{ps}≔\mathrm{sinx}\mathrm{expy}$
 ${\mathrm{ps}}{≔}\left[{PowⅇrSⅇriⅇs of}{\mathrm{sin}}{}\left({x}\right){}{{ⅇ}}^{{y}}{:}{0}{+}{\dots }\right]$ (3)

We shift x by 1 and y by 2, performing all steps three times: all at once, x first, or y first. (In practice, one would typically do both shifts at once: it is computationally more efficient.)

 > $\mathrm{ps_both}≔\mathrm{TaylorShift}\left(\mathrm{ps},\left\{x=1,y=2\right\}\right)$
 ${\mathrm{ps_both}}{≔}\left[{PowⅇrSⅇriⅇs of}{{ⅇ}}^{{y}}{}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({1}\right){+}{{ⅇ}}^{{y}}{}{\dots }{}{\dots }{}{\dots }{:}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{+}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{y}{+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{y}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{y}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}}{{24}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{{y}}^{{2}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{5}}}{{120}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{5}}}{{120}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{3}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}{}{y}}{{24}}{+}{\dots }\right]$ (4)
 > $\mathrm{ps_x}≔\mathrm{TaylorShift}\left(\mathrm{ps},x=1\right)$
 ${\mathrm{ps_x}}{≔}\left[{PowⅇrSⅇriⅇs of}{{ⅇ}}^{{y}}{}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({1}\right){+}{{ⅇ}}^{{y}}{}{\mathrm{cos}}{}\left({x}\right){}{\dots }{}{\dots }{:}{\mathrm{sin}}{}\left({1}\right){+}{\mathrm{cos}}{}\left({1}\right){}{x}{+}{\mathrm{sin}}{}\left({1}\right){}{y}{+}{\mathrm{cos}}{}\left({1}\right){}{x}{}{y}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{2}}}{{2}}{-}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}}{{2}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}}{{6}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{3}}}{{6}}{-}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{y}}{{2}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{4}}}{{24}}{-}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}}{{24}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{4}}}{{24}}{-}\frac{{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{{y}}^{{2}}}{{12}}{+}\frac{{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{5}}}{{120}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{5}}}{{120}}{-}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{3}}}{{12}}{+}\frac{{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}{}{y}}{{24}}{+}{\dots }\right]$ (5)
 > $\mathrm{ps_x_y}≔\mathrm{TaylorShift}\left(\mathrm{ps_x},y=2\right)$
 ${\mathrm{ps_x_y}}{≔}\left[{PowⅇrSⅇriⅇs of}{{ⅇ}}^{{y}}{}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({1}\right){+}{{ⅇ}}^{{y}}{}{\dots }{}{\dots }{}{\dots }{:}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{+}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{y}{+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{y}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{y}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}}{{24}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{{y}}^{{2}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{5}}}{{120}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{5}}}{{120}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{3}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}{}{y}}{{24}}{+}{\dots }\right]$ (6)
 > $\mathrm{ps_y}≔\mathrm{TaylorShift}\left(\mathrm{ps},y=2\right)$
 ${\mathrm{ps_y}}{≔}\left[{PowⅇrSⅇriⅇs of}{\mathrm{sin}}{}\left({x}\right){}{{ⅇ}}^{{y}}{}{{ⅇ}}^{{2}}{:}{{ⅇ}}^{{2}}{}{x}{+}{{ⅇ}}^{{2}}{}{x}{}{y}{+}\frac{{{ⅇ}}^{{2}}{}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{{x}}^{{3}}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{x}{}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{{x}}^{{3}}{}{{y}}^{{2}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{{x}}^{{5}}}{{120}}{+}{\dots }\right]$ (7)
 > $\mathrm{ps_y_x}≔\mathrm{TaylorShift}\left(\mathrm{ps_y},x=1\right)$
 ${\mathrm{ps_y_x}}{≔}\left[{PowⅇrSⅇriⅇs of}{{ⅇ}}^{{y}}{}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({1}\right){+}{{ⅇ}}^{{y}}{}{\dots }{}{\dots }{}{\dots }{:}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{+}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{y}{+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{y}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{y}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}}{{24}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{{y}}^{{2}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{5}}}{{120}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{5}}}{{120}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{3}}}{{12}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}{}{y}}{{24}}{+}{\dots }\right]$ (8)

Let's take a look at the first few homogeneous components of ps_both.

 > $\mathrm{Truncate}\left(\mathrm{ps_both},4\right)$
 ${{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{+}{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{y}{+}{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{y}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{2}}}{{2}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{y}}{{2}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{x}{}{{y}}^{{3}}}{{6}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{cos}}{}\left({1}\right){}{{x}}^{{3}}{}{y}}{{6}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{y}}^{{4}}}{{24}}{-}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\frac{{{ⅇ}}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{{x}}^{{4}}}{{24}}$ (9)

Now we verify that the three results, ps_both, ps_x_y and ps_y_x, are equal (up to homogeneous degree 20).

 > $\mathrm{ApproximatelyEqual}\left(\mathrm{ps_both},\mathrm{ps_x_y},20\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{ApproximatelyEqual}\left(\mathrm{ps_both},\mathrm{ps_y_x},20\right)$
 ${\mathrm{true}}$ (11)

We define a univariate polynomial over power series.

 > $f≔\mathrm{UnivariatePolynomialOverPowerSeries}\left(\left[\mathrm{PowerSeries}\left(1\right),\mathrm{SumOfAllMonomials}\left(\left[x,y\right]\right),\mathrm{GeometricSeries}\left(y\right)\right],z\right)$
 ${f}{≔}\left[{UnivariatⅇPolynomialOvⅇrPowⅇrSⅇriⅇs:}\left({1}\right){+}\left({1}{+}{x}{+}{y}{+}{\dots }\right){}{z}{+}\left({1}{+}{y}{+}{\dots }\right){}{{z}}^{{2}}\right]$ (12)

We apply a Taylor shift by 1, and then by -1 on the result.

 > $\mathrm{f1}≔\mathrm{TaylorShift}\left(f,1\right)$
 ${\mathrm{f1}}{≔}\left[{UnivariatⅇPolynomialOvⅇrPowⅇrSⅇriⅇs:}\left({3}{+}{\dots }\right){+}\left({3}{+}{x}{+}{3}{}{y}{+}{\dots }\right){}{z}{+}\left({1}{+}{y}{+}{\dots }\right){}{{z}}^{{2}}\right]$ (13)
 > $\mathrm{f0}≔\mathrm{TaylorShift}\left(\mathrm{f1},-1\right)$
 ${\mathrm{f0}}{≔}\left[{UnivariatⅇPolynomialOvⅇrPowⅇrSⅇriⅇs:}\left({1}\right){+}\left({1}{+}{x}{+}{y}{+}{\dots }\right){}{z}{+}\left({1}{+}{y}{+}{\dots }\right){}{{z}}^{{2}}\right]$ (14)

We verify that the result is equal to the original polynomial (up to homogeneous degree 20).

 > $\mathrm{ApproximatelyEqual}\left(f,\mathrm{f0},20\right)$
 ${\mathrm{true}}$ (15)

Compatibility

 • The MultivariatePowerSeries[TaylorShift] command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.
 • The p and e parameters were introduced in Maple 2022.
 • For more information on Maple 2022 changes, see Updates in Maple 2022.