convert/FormalPowerSeries - Maple Help

convert/FormalPowerSeries

convert to formal power (or Laurent-Puiseux) series

 Calling Sequence convert(expr, FormalPowerSeries, eq, k, opts) convert(expr, FormalPowerSeries, eq, b(k), opts)

Parameters

 expr - algebraic expression eq - equation (e.g. x=a) or name (e.g. x); optional if expr contains only one variable k - (optional) name of the summation variable in the result b(k) - (optional) name for the kth series coefficient opts - sequence of options of the form keyword=value; possible keywords are method, makereal, dir, differentialorder, and recurrence

Options

 • differentialorder: a positive integer n (default: n=4); upper bound for the order of the differential equation searched for. This controls the depth of the search for a differential equation for expr. Higher values of n will increase the chance to find the solution, but increase the running time as well.
 • dir: one of default, left, right, real, or complex; direction of the limit computation for initial values. If a is finite, then the default is dir=complex. If a is either infinity or -infinity, then the default is dir=real. See also limit.
 • makereal: either true or false (default); makereal=true (or just makereal for short) indicates that a series with real coefficients should be returned
 • method: one of default, hypergeometric, rational, or exponential. Specifies the method that will be used; the default method uses an internal selection strategy. See the Examples below for an illustration of the various methods.
 • recurrence: either true or false (default). If recurrence=true (or recurrence for short) is given and no formal power series can be computed, then the output is a recurrence for $b\left(k\right)$.

Description

 • This command expands meromorphic functions of certain type into their corresponding Laurent-Puiseux series as a sum of terms of the form $\sum _{k=0}^{\mathrm{\infty }}b\left(k\right){\left(x-a\right)}^{\frac{mk+s}{q}}$, where m is called the symmetry number, s is the shift number, and a is the expansion point.
 • The following types are supported:
 – functions of hypergeometric type, where $\frac{b\left(k+m\right)}{b\left(k\right)}$ is a rational function of k for some integer m;
 – functions of exponential type, which satisfy a linear homogeneous differential equation with constant coefficients;
 – functions of rational type, which are either rational or have a rational derivative;
 – linear combinations of hypergeometric functions are treated by the Petkovsek-van-Hoeij algorithm; see LREtools[hypergeomsols].
 • The convert(expr, FormalPowerSeries, x=a) command tries to find a formal power series expansion for expr with respect to the variable x at the point of expansion a. If a=infinity, then the command searches for an asymptotic series. It also works for formal Laurent-Puiseux series, and in certain cases of logarithmic singularities.
 • The command first looks for a homogeneous linear differential equation with polynomial coefficients for expr; hence Maple must know the derivatives of expr.
 • If eq is a variable name x, or if eq is omitted and expr has only one variable x, then x=0 is assumed.
 • The optional argument k is a name that will be taken as the summation variable in the result. If it is not specified, then one of the variable names k, k0, k1, etc. is chosen.
 • To compute asymptotic power series, one may expand the function around $\mathrm{\infty }$; see the Examples below. The result is a (possibly divergent) series.
 • The FormalPowerSeries argument can be abbreviated as FPS.
 • For a complete list of known functions, see inifcns.
 • The convert/sum command provides the same functionality as the convert/FormalPowerSeries command, with a newer algorithm which can employ alternate methods.

Examples

 > $\mathrm{convert}\left(\mathrm{sin}\left(x\right),\mathrm{FormalPowerSeries}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left({-1}\right)}^{{k}}{}{{x}}^{{2}{}{k}{+}{1}}}{\left({2}{}{k}{+}{1}\right){!}}$ (1)
 > $\mathrm{convert}\left(\mathrm{ln}\left(x\right),\mathrm{FormalPowerSeries},x=1,j\right)$
 ${\sum }_{{j}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left({-1}\right)}^{{j}}{}{\left({x}{-}{1}\right)}^{{j}{+}{1}}}{{j}{+}{1}}$ (2)
 > $\mathrm{convert}\left(\mathrm{sqrt}\left(\frac{1-\mathrm{sqrt}\left(1-x\right)}{x}\right),\mathrm{FormalPowerSeries},x,n\right)$
 ${\sum }_{{n}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{{2}}^{{-}{4}{}{n}{+}\frac{{1}}{{2}}}{}\left({4}{}{n}\right){!}{}{{x}}^{{n}}}{{2}{}{\left({2}{}{n}\right){!}}^{{2}}{}\left({2}{}{n}{+}{1}\right)}$ (3)
 > $\mathrm{convert}\left(\mathrm{exp}\left(\mathrm{arcsin}\left(x\right)\right),\mathrm{FormalPowerSeries}\right)$
 $\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{\left({\prod }_{{j}{=}{0}}^{{k}}{}\left({4}{}{{j}}^{{2}}{+}{1}\right)\right){}{{x}}^{{2}{}{k}}}{\left({4}{}{{k}}^{{2}}{+}{1}\right){}\left({2}{}{k}\right){!}}\right){+}\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{{2}}^{{k}}{}\left({\prod }_{{j}{=}{0}}^{{k}}{}\left({2}{}{{j}}^{{2}}{+}{2}{}{j}{+}{1}\right)\right){}{{x}}^{{2}{}{k}{+}{1}}}{\left({2}{}{{k}}^{{2}}{+}{2}{}{k}{+}{1}\right){}\left({2}{}{k}{+}{1}\right){!}}\right)$ (4)
 > $\mathrm{convert}\left(\frac{t}{1-xt-{t}^{2}},\mathrm{FormalPowerSeries},t\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left({-}\frac{{\left(\frac{{x}}{{2}}{-}\frac{\sqrt{{{x}}^{{2}}{+}{4}}}{{2}}\right)}^{{k}}}{\sqrt{{{x}}^{{2}}{+}{4}}}{+}\frac{{\left(\frac{{x}}{{2}}{+}\frac{\sqrt{{{x}}^{{2}}{+}{4}}}{{2}}\right)}^{{k}}}{\sqrt{{{x}}^{{2}}{+}{4}}}\right){}{{t}}^{{k}}$ (5)

The following examples illustrate the use of the method parameter.

 > $\mathrm{convert}\left(\mathrm{ln}\left(\frac{1+{x}^{2}}{1-x}\right),\mathrm{FormalPowerSeries},\mathrm{method}=\mathrm{rational}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{\left({\left({-I}\right)}^{{k}}{}{{I}}^{{k}}{+}{I}{}{\left({-I}\right)}^{{k}}{-}{I}{}{{I}}^{{k}}\right){}{{x}}^{{k}{+}{1}}}{{\left({-I}\right)}^{{k}}{}{{I}}^{{k}}{}\left({k}{+}{1}\right)}$ (6)
 > $\mathrm{convert}\left(\mathrm{exp}\left(x\right)\mathrm{sin}\left(x\right),\mathrm{FormalPowerSeries},\mathrm{method}=\mathrm{hypergeometric}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left(\frac{{I}{}{\left({1}{-}{I}\right)}^{{k}}}{{2}{}{k}{!}}{-}\frac{{I}{}{\left({1}{+}{I}\right)}^{{k}}}{{2}{}{k}{!}}\right){}{{x}}^{{k}}$ (7)
 > $\mathrm{convert}\left(\mathrm{exp}\left(x\right)-2\mathrm{exp}\left(-\frac{x}{2}\right)\mathrm{cos}\left(\frac{\mathrm{sqrt}\left(3\right)x}{2}+\frac{\mathrm{\pi }}{3}\right),\mathrm{FormalPowerSeries},\mathrm{method}=\mathrm{exponential}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left(\frac{{1}}{{k}{!}}{-}\frac{{\mathrm{cos}}{}\left(\frac{{2}{}{k}{}{\mathrm{\pi }}}{{3}}\right)}{{k}{!}}{+}\frac{\sqrt{{3}}{}{\mathrm{sin}}{}\left(\frac{{2}{}{k}{}{\mathrm{\pi }}}{{3}}\right)}{{k}{!}}\right){}{{x}}^{{k}}$ (8)
 > $\mathrm{convert}\left(\mathrm{exp}\left(x\right)-2\mathrm{exp}\left(-\frac{x}{2}\right)\mathrm{cos}\left(\frac{\mathrm{sqrt}\left(3\right)x}{2}+\frac{\mathrm{\pi }}{3}\right),\mathrm{FormalPowerSeries},\mathrm{method}=\mathrm{hypergeometric}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{3}{}{{x}}^{{3}{}{k}{+}{1}}}{\left({3}{}{k}{+}{1}\right){!}}$ (9)

The output can be a Puiseux series or a Laurent series.

 > $\mathrm{convert}\left(\mathrm{exp}\left(\mathrm{sqrt}\left(x\right)\right),\mathrm{FormalPowerSeries}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left(\sqrt{{x}}\right)}^{{k}}}{{k}{!}}$ (10)
 > $\mathrm{convert}\left(\frac{\mathrm{sin}\left(x\right)}{{x}^{6}},\mathrm{FormalPowerSeries}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left({-1}\right)}^{{k}}{}{{x}}^{{2}{}{k}{-}{5}}}{\left({2}{}{k}{+}{1}\right){!}}$ (11)

User-defined functions are handled provided their derivative is known. We define the derivative of the function $g$ as follows (see diff for more information).

 > diff/g := proc(a,x) g(a)*diff(a,x) end proc:
 > $\mathrm{convert}\left(g\left(x\right),\mathrm{FormalPowerSeries},x=0\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{g}{}\left({0}\right){}{{x}}^{{k}}}{{k}{!}}$ (12)

Indefinite integrals are handled.

 > $\mathrm{convert}\left(\mathrm{Int}\left(\frac{\mathrm{erf}\left(t\right)}{t},t=0..x\right),\mathrm{FormalPowerSeries},x\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{2}{}{\left({-1}\right)}^{{k}}{}{{x}}^{{2}{}{k}{+}{1}}}{\sqrt{{\mathrm{\pi }}}{}{k}{!}{}{\left({2}{}{k}{+}{1}\right)}^{{2}}}$ (13)

Linear combinations of hypergeometric functions are recognized.

 > $\mathrm{convert}\left(\left(-\frac{1}{2}x+\frac{1}{6}{x}^{3}\right)\mathrm{arctan}\left(x\right)+\left(-\frac{1}{4}{x}^{2}+\frac{1}{12}\right)\mathrm{ln}\left({x}^{2}+1\right)+\frac{5}{12}{x}^{2}+\frac{1}{4},\mathrm{FormalPowerSeries},x=0,\mathrm{makereal}\right)$
 $\frac{{1}}{{4}}{+}\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{{x}}^{{k}{+}{4}}{}{\mathrm{cos}}{}\left(\frac{{k}{}{\mathrm{\pi }}}{{2}}\right)}{\left({k}{+}{4}\right){}\left({k}{+}{3}\right){}\left({k}{+}{2}\right){}\left({k}{+}{1}\right)}\right)$ (14)

The input functions can contain parameters.

 > $\mathrm{convert}\left(\mathrm{sin}\left(x+y\right),\mathrm{FormalPowerSeries},x\right)$
 $\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\mathrm{sin}}{}\left({y}\right){}{\left({-1}\right)}^{{k}}{}{{x}}^{{2}{}{k}}}{\left({2}{}{k}\right){!}}\right){+}\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\mathrm{cos}}{}\left({y}\right){}{\left({-1}\right)}^{{k}}{}{{x}}^{{2}{}{k}{+}{1}}}{\left({2}{}{k}{+}{1}\right){!}}\right)$ (15)

In the next example, the output is expressed in terms of algebraic numbers.

 > $\mathrm{convert}\left(\frac{1}{{x}^{4}+x+1},\mathrm{FormalPowerSeries},\mathrm{method}=\mathrm{rational}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left({\sum }_{{\mathrm{_α}}{=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{+}{\mathrm{_Z}}{+}{1}\right)}{}\frac{{36}{}{{\mathrm{_α}}}^{{3}}{-}{48}{}{{\mathrm{_α}}}^{{2}}{+}{64}{}{\mathrm{_α}}{+}{27}}{{229}{}{{\mathrm{_α}}}^{{k}{+}{1}}}\right){}{{x}}^{{k}}$ (16)

Maple's special functions are handled.

 > $\mathrm{convert}\left(\mathrm{AiryAi}\left(x\right),\mathrm{FormalPowerSeries}\right)$
 $\left({\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{{3}}^{{-}{2}{}{k}{+}\frac{{1}}{{3}}}{}{{x}}^{{3}{}{k}}}{{3}{}{\mathrm{\Gamma }}{}\left(\frac{{2}}{{3}}\right){}{\mathrm{pochhammer}}{}\left(\frac{{2}}{{3}}{,}{k}\right){}{k}{!}}\right){+}{\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left({-}\frac{{\mathrm{\Gamma }}{}\left(\frac{{2}}{{3}}\right){}{{3}}^{{-}{2}{}{k}{+}\frac{{1}}{{6}}}{}{{x}}^{{3}{}{k}{+}{1}}}{{2}{}{\mathrm{\pi }}{}{\mathrm{pochhammer}}{}\left(\frac{{4}}{{3}}{,}{k}\right){}{k}{!}}\right)$ (17)
 > $\mathrm{convert}\left(\mathrm{hypergeom}\left(\left[a,b\right],\left[c\right],x\right),\mathrm{FormalPowerSeries},x\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\mathrm{pochhammer}}{}\left({b}{,}{k}\right){}{\mathrm{pochhammer}}{}\left({a}{,}{k}\right){}{{x}}^{{k}}}{{\mathrm{pochhammer}}{}\left({c}{,}{k}\right){}{k}{!}}$ (18)

Hidden polynomials are detected.

 > $\mathrm{convert}\left(\mathrm{cos}\left(4\mathrm{arccos}\left(x\right)\right),\mathrm{FormalPowerSeries}\right)$
 ${8}{}{{x}}^{{4}}{-}{8}{}{{x}}^{{2}}{+}{1}$ (19)
 > $f≔\mathrm{expand}\left({\left({\mathrm{cos}\left(x\right)}^{2}+{\mathrm{sin}\left(x\right)}^{2}\right)}^{10}\right)$
 ${f}{≔}{{\mathrm{cos}}{}\left({x}\right)}^{{20}}{+}{10}{}{{\mathrm{cos}}{}\left({x}\right)}^{{18}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{2}}{+}{45}{}{{\mathrm{cos}}{}\left({x}\right)}^{{16}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{4}}{+}{120}{}{{\mathrm{cos}}{}\left({x}\right)}^{{14}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{6}}{+}{210}{}{{\mathrm{cos}}{}\left({x}\right)}^{{12}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{8}}{+}{252}{}{{\mathrm{cos}}{}\left({x}\right)}^{{10}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{10}}{+}{210}{}{{\mathrm{cos}}{}\left({x}\right)}^{{8}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{12}}{+}{120}{}{{\mathrm{cos}}{}\left({x}\right)}^{{6}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{14}}{+}{45}{}{{\mathrm{cos}}{}\left({x}\right)}^{{4}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{16}}{+}{10}{}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({x}\right)}^{{18}}{+}{{\mathrm{sin}}{}\left({x}\right)}^{{20}}$ (20)
 > $\mathrm{convert}\left(f,\mathrm{FormalPowerSeries}\right)$
 ${1}$ (21)

Asymptotic power series can be computed.

 > $\mathrm{convert}\left(\mathrm{exp}\left({x}^{2}\right)\left(1-\mathrm{erf}\left(x\right)\right),\mathrm{FormalPowerSeries},x=\mathrm{\infty },\mathrm{dir}=\mathrm{left}\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left({-1}\right)}^{{k}}{}\left({2}{}{k}\right){!}{}{{4}}^{{-}{k}}{}{\left(\frac{{1}}{{x}}\right)}^{{2}{}{k}{+}{1}}}{\sqrt{{\mathrm{\pi }}}{}{k}{!}}$ (22)
 > $\mathrm{convert}\left(\mathrm{sin}\left(\frac{1}{x}\right),\mathrm{FormalPowerSeries},x=\mathrm{\infty }\right)$
 ${\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\frac{{\left({-1}\right)}^{{k}}{}{\left(\frac{{1}}{{x}}\right)}^{{2}{}{k}{+}{1}}}{\left({2}{}{k}{+}{1}\right){!}}$ (23)

Real and one-sided (asymptotic) series can be computed using the dir option.

 > $\mathrm{convert}\left(\mathrm{exp}\left(-\frac{1}{{x}^{2}}\right),\mathrm{FormalPowerSeries},x=0,\mathrm{dir}=\mathrm{real}\right)$
 ${0}$ (24)
 > $\mathrm{convert}\left(\mathrm{exp}\left(-\frac{1}{x}\right),\mathrm{FormalPowerSeries},x=0,\mathrm{dir}=\mathrm{right}\right)$
 ${0}$ (25)
 > $\mathrm{convert}\left(\mathrm{exp}\left(-\frac{1}{x}\right),\mathrm{FormalPowerSeries},x=0,\mathrm{dir}=\mathrm{left}\right)$
 ${{ⅇ}}^{{-}\frac{{1}}{{x}}}$ (26)

Some examples where convert(...,FormalPowerSeries) does not succeed, e.g., because of an essential singularity.

 > $\mathrm{convert}\left(\mathrm{exp}\left(\frac{1}{x}\right),\mathrm{FormalPowerSeries}\right)$
 ${{ⅇ}}^{\frac{{1}}{{x}}}$ (27)
 > $\mathrm{convert}\left(\mathrm{tan}\left(x\right),\mathrm{FormalPowerSeries}\right)$
 ${\mathrm{tan}}{}\left({x}\right)$ (28)

Here is an example where convert(...,FormalPowerSeries) fails to compute a formal power series, but is able to determine a recurrence equation for the coefficients.

 > $\mathrm{convert}\left({\mathrm{arcsin}\left(x\right)}^{3},\mathrm{FormalPowerSeries}\right)$
 ${{\mathrm{arcsin}}{}\left({x}\right)}^{{3}}$ (29)
 > $\mathrm{convert}\left({\mathrm{arcsin}\left(x\right)}^{3},\mathrm{FormalPowerSeries},b\left(k\right),\mathrm{recurrence}\right)$
 ${{k}}^{{4}}{}{b}{}\left({k}\right){-}{2}{}\left({k}{+}{1}\right){}\left({k}{+}{2}\right){}\left({{k}}^{{2}}{+}{2}{}{k}{+}{2}\right){}{b}{}\left({k}{+}{2}\right){+}\left({k}{+}{1}\right){}\left({k}{+}{2}\right){}\left({k}{+}{3}\right){}\left({k}{+}{4}\right){}{b}{}\left({k}{+}{4}\right){=}{0}$ (30)

Generalized series.

 > $\mathrm{convert}\left(\mathrm{arcsech}\left(x\right),\mathrm{FormalPowerSeries}\right)$
 ${\mathrm{ln}}{}\left({2}\right){+}{\mathrm{ln}}{}\left(\frac{{1}}{{x}}\right){+}{\sum }_{{k}{=}{0}}^{{\mathrm{\infty }}}{}\left({-}\frac{\left({2}{}{k}{+}{1}\right){!}{}{{4}}^{{-}{k}}{}{{x}}^{{2}{}{k}{+}{2}}}{{2}{}{{k}{!}}^{{2}}{}\left({k}{+}{1}\right){}\left({2}{}{k}{+}{2}\right)}\right)$ (31)

References

 Gruntz, Dominik, and Koepf, Wolfram. "Maple package of formal power series."  Maple Technical Newsletter, Vol. 2(2), (1995):22-28.
 Koepf, Wolfram. "Algorithmic development of power series. Artificial intelligence and symbolic mathematical computing." Lecture Notes in Computer Science, Vol. 737, pp. 195-213. Edited by J. Calmet and J. A. Campbell.  Berlin-Heidelberg: Springer, 1993.
 Koepf, Wolfram. "Examples for the algorithmic calculation of formal Puiseux, Laurent and power series." SIGSAM Bulletin Vol. 27, (1993): 20-32.
 Koepf, Wolfram. "Power series, Bieberbach conjecture and the de Branges and Weinstein functions." Proceedings of the 2003 International Symposium on Symbolic and Algebraic Computation. pp. 169-175. New York: ACM, 2003.
 Koepf, Wolfram. "Power series in computer algebra." Journal of Symbolic Computation, Vol. 13, (1992): 581-603.
 van Hoeij, Mark. "Finite singularities and hypergeometric solutions of linear recurrence equations." J. Pure and Appl. Algebra, Vol. 139, (1999): 109-131.