series - Maple Help

series

generalized series expansion

 Calling Sequence series(expr, eqn) series(expr, eqn, n)

Parameters

 expr - expression eqn - equation (such as x = a) or name (such as x) n - (optional) non-negative integer

Description

 • The series function computes a truncated series expansion of expr, with respect to the variable x, about the point a, up to order n. If a is infinity then an asymptotic expansion is given.
 • If eqn evaluates to a name x then the equation $x=0$ is assumed.
 • If the third argument n is present then it specifies the "truncation order" of the series calculations. This does not mean the truncation order of the actual series.  See Order for more information about this. If n is not present, the "truncation order" is determined by the global variable Order. The user may assign any non-negative integer to Order.  The default value of Order is 6.  See Order for more information.
 • If the series is not exact then an "order term" (for example, $\mathrm{O}\left({x}^{6}\right)$ ) is the last term in the series.
 • It is possible to invoke series on user-defined functions. For example, if the procedure series/f is defined then the function call series(f(x,y),x)  will invoke series/f(x,y,x)  to compute the series. Note that this user-defined function series/f must return a series data structure, not just a polynomial (see type/series).
 • If series is applied to an unevaluated integral then the series expansion of the integral will be computed (if possible).
 • Whenever the series algorithm needs to check whether the leading coefficient of an intermediate result is actually 0, it calls the procedure defined by the environment variable Testzero. By default, this procedure is defined in terms of Normalizer, which is also used by series for simplifying coefficients. Again by default, Normalizer is equal to the Maple function normal, which is powerful enough to recognize equality of expressions representing (multivariate) polynomials with rational number coefficients. If a more powerful simplifier or zero tester is needed, you can redefine either Normalizer or Testzero accordingly. For example, if expr or eqn contain RootOf expressions, you may want to define Normalizer := evala before calling series, and similarly Normalizer := radnormal for radical expressions.
 • The result of the series function is a generalized series expansion. This could be a Taylor series or a Laurent series or a more general series. Formally, the coefficients in a "generalized series" are such that

${k}_{1}{\left(x-a\right)}^{\mathrm{ϵ}}<\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}\left|{\mathrm{coeff}}_{i}\right|\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}<\frac{{k}_{2}}{{\left(x-a\right)}^{\mathrm{ϵ}}}$

 for some constants ${k}_{1}$ and ${k}_{2}$, for any $0<\mathrm{ϵ}$ as $x$ approaches $a$. In other words, the coefficients may depend on x but their growth must be less than the polynomial in x. The order term may also hide such a coefficient, rather than an arbitrary constant. E.g., series considers ${x}^{2}\mathrm{ln}\left(x\right)$ to be $\mathrm{O}\left({x}^{2}\right)$.
 • If a=infinity or a=-infinity, respectively, then the series expansion is only guaranteed to be valid for positive real x or negative real x, respectively. Use the substitution $x=\frac{1}{x}$ and then call series with $a=0$ to get an expansion that is valid around the North pole of the Riemann sphere.
 • Usually, the result of the series function is represented in the form of a series data structure. For an explanation of the data structure, see the type/series help page. However, the result of the series function will be represented in ordinary sum-of-products form, rather than in a series data structure, if it is a generalized series requiring fractional exponents, or if it is a series at $±\mathrm{\infty }$.
 • series implements a caching mechanism (see also option remember), so that when the same series is requested a second time but with a lower order, instead of recomputing it the terms from the cache are used.

Examples

 > $\mathrm{series}\left(\frac{x}{1-x-{x}^{2}},x=0\right)$
 ${x}{+}{{x}}^{{2}}{+}{2}{}{{x}}^{{3}}{+}{3}{}{{x}}^{{4}}{+}{5}{}{{x}}^{{5}}{+}{O}{}\left({{x}}^{{6}}\right)$ (1)

If the second argument is x then the equation $x=0$ is assumed.

 > $\mathrm{series}\left(\frac{x}{1-x-{x}^{2}},x\right)$
 ${x}{+}{{x}}^{{2}}{+}{2}{}{{x}}^{{3}}{+}{3}{}{{x}}^{{4}}{+}{5}{}{{x}}^{{5}}{+}{O}{}\left({{x}}^{{6}}\right)$ (2)
 > $\mathrm{convert}\left(,\mathrm{polynom}\right)$
 ${5}{}{{x}}^{{5}}{+}{3}{}{{x}}^{{4}}{+}{2}{}{{x}}^{{3}}{+}{{x}}^{{2}}{+}{x}$ (3)

The third argument specifies the "truncation order" of the series calculations.

 > $\mathrm{series}\left(x+\frac{1}{x},x=1,3\right)$
 ${2}{+}{\left({x}{-}{1}\right)}^{{2}}{+}{O}{}\left({\left({x}{-}{1}\right)}^{{3}}\right)$ (4)
 > $\mathrm{series}\left({ⅇ}^{x},x=0,8\right)$
 ${1}{+}{x}{+}\frac{{1}}{{2}}{}{{x}}^{{2}}{+}\frac{{1}}{{6}}{}{{x}}^{{3}}{+}\frac{{1}}{{24}}{}{{x}}^{{4}}{+}\frac{{1}}{{120}}{}{{x}}^{{5}}{+}\frac{{1}}{{720}}{}{{x}}^{{6}}{+}\frac{{1}}{{5040}}{}{{x}}^{{7}}{+}{O}{}\left({{x}}^{{8}}\right)$ (5)
 > $\mathrm{series}\left(\frac{{ⅇ}^{x}}{x},x=0,8\right)$
 ${{x}}^{{-1}}{+}{1}{+}\frac{{1}}{{2}}{}{x}{+}\frac{{1}}{{6}}{}{{x}}^{{2}}{+}\frac{{1}}{{24}}{}{{x}}^{{3}}{+}\frac{{1}}{{120}}{}{{x}}^{{4}}{+}\frac{{1}}{{720}}{}{{x}}^{{5}}{+}\frac{{1}}{{5040}}{}{{x}}^{{6}}{+}{O}{}\left({{x}}^{{7}}\right)$ (6)
 > $\mathrm{series}\left(\mathrm{GAMMA}\left(x\right),x=0,2\right)$
 ${{x}}^{{-1}}{-}{\mathrm{\gamma }}{+}\left(\frac{{{\mathrm{\pi }}}^{{2}}}{{12}}{+}\frac{{{\mathrm{\gamma }}}^{{2}}}{{2}}\right){}{x}{+}{O}{}\left({{x}}^{{2}}\right)$ (7)

The truncation order may be lower than expected if cancellation happens.

 > $\mathrm{series}\left(\frac{1}{{ⅇ}^{x}-1-x},x,6\right)$
 ${2}{}{{x}}^{{-2}}{-}\frac{{2}}{{3}}{}{{x}}^{{-1}}{+}\frac{{1}}{{18}}{+}\frac{{1}}{{270}}{}{x}{+}{O}{}\left({{x}}^{{2}}\right)$ (8)
 > $\mathrm{series}\left(\frac{1}{{ⅇ}^{x}-1-x},x,10\right)$
 ${2}{}{{x}}^{{-2}}{-}\frac{{2}}{{3}}{}{{x}}^{{-1}}{+}\frac{{1}}{{18}}{+}\frac{{1}}{{270}}{}{x}{-}\frac{{1}}{{3240}}{}{{x}}^{{2}}{-}\frac{{1}}{{13608}}{}{{x}}^{{3}}{-}\frac{{1}}{{2041200}}{}{{x}}^{{4}}{+}\frac{{1}}{{874800}}{}{{x}}^{{5}}{+}{O}{}\left({{x}}^{{6}}\right)$ (9)

The caching mechanism is used when series is called again with the original truncation order, leading to a more accurate result than before.

 > $\mathrm{series}\left(\frac{1}{{ⅇ}^{x}-1-x},x,6\right)$
 ${2}{}{{x}}^{{-2}}{-}\frac{{2}}{{3}}{}{{x}}^{{-1}}{+}\frac{{1}}{{18}}{+}\frac{{1}}{{270}}{}{x}{-}\frac{{1}}{{3240}}{}{{x}}^{{2}}{-}\frac{{1}}{{13608}}{}{{x}}^{{3}}{-}\frac{{1}}{{2041200}}{}{{x}}^{{4}}{+}\frac{{1}}{{874800}}{}{{x}}^{{5}}{+}{O}{}\left({{x}}^{{6}}\right)$ (10)

The cache can be cleared by means of the command forget.

 > $\mathrm{forget}\left(\mathrm{series}\right):$
 > $\mathrm{series}\left(\frac{1}{{ⅇ}^{x}-1-x},x,6\right)$
 ${2}{}{{x}}^{{-2}}{-}\frac{{2}}{{3}}{}{{x}}^{{-1}}{+}\frac{{1}}{{18}}{+}\frac{{1}}{{270}}{}{x}{+}{O}{}\left({{x}}^{{2}}\right)$ (11)
 > $∫{ⅇ}^{{x}^{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${-}\frac{{\left({-1}\right)}^{{2}}{{3}}}{}\left(\frac{{2}{}{x}{}{\left({-1}\right)}^{{1}}{{3}}}{}{\mathrm{\pi }}{}\sqrt{{3}}}{{3}{}{\mathrm{\Gamma }}{}\left(\frac{{2}}{{3}}\right){}{\left({-}{{x}}^{{3}}\right)}^{{1}}{{3}}}}{-}\frac{{x}{}{\left({-1}\right)}^{{1}}{{3}}}{}{\mathrm{\Gamma }}{}\left(\frac{{1}}{{3}}{,}{-}{{x}}^{{3}}\right)}{{\left({-}{{x}}^{{3}}\right)}^{{1}}{{3}}}}\right)}{{3}}$ (12)
 > $\mathrm{series}\left(,x=0\right)$
 ${x}{+}\frac{{1}}{{4}}{}{{x}}^{{4}}{+}{O}{}\left({{x}}^{{7}}\right)$ (13)
 > $p≔\mathrm{series}\left({x}^{x},x=0,3\right)$
 ${p}{≔}{1}{+}{\mathrm{ln}}{}\left({x}\right){}{x}{+}\frac{{1}}{{2}}{}{{\mathrm{ln}}{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{O}{}\left({{x}}^{{3}}\right)$ (14)
 > $\mathrm{type}\left(p,'\mathrm{series}'\right)$
 ${\mathrm{true}}$ (15)

The result of the series function will be represented in ordinary sum-of-products form, rather than in a series data structure, if it is a generalized series requiring fractional exponents.

 > $s≔\mathrm{series}\left(\sqrt{\mathrm{sin}\left(x\right)},x=0,4\right)$
 ${s}{≔}\sqrt{{x}}{-}\frac{{{x}}^{{5}}{{2}}}}{{12}}{+}{\mathrm{O}}{}\left({{x}}^{{9}}{{2}}}\right)$ (16)
 > $\mathrm{type}\left(s,'\mathrm{series}'\right)$
 ${\mathrm{false}}$ (17)
 > $\mathrm{whattype}\left(s\right)$
 ${\mathrm{+}}$ (18)

The same holds for expansions at $±\mathrm{\infty }$.

 > $t≔\mathrm{series}\left(\frac{{x}^{3}}{{x}^{4}+4x-5},x=\mathrm{∞}\right)$
 ${t}{≔}\frac{{1}}{{x}}{-}\frac{{4}}{{{x}}^{{4}}}{+}\frac{{5}}{{{x}}^{{5}}}{+}{\mathrm{O}}{}\left(\frac{{1}}{{{x}}^{{7}}}\right)$ (19)
 > $\mathrm{whattype}\left(t\right)$
 ${\mathrm{+}}$ (20)

An example with algebraic number coefficients. By default, series returns a result with a division by an unrecognized zero in the leading term:

 > $p≔{x}^{3}+x+1$
 ${p}{≔}{{x}}^{{3}}{+}{x}{+}{1}$ (21)
 > $\mathrm{alias}\left(\mathrm{α}=\mathrm{RootOf}\left(p\right)\right):$
 > $\mathrm{series}\left(\frac{1}{p},x=\mathrm{α},2\right)$
 $\frac{{1}}{{{\mathrm{\alpha }}}^{{3}}{+}{\mathrm{\alpha }}{+}{1}}{-}\frac{{3}{}{{\mathrm{\alpha }}}^{{2}}{+}{1}}{{\left({{\mathrm{\alpha }}}^{{3}}{+}{\mathrm{\alpha }}{+}{1}\right)}^{{2}}}{}\left({x}{-}{\mathrm{\alpha }}\right){+}{O}{}\left({\left({x}{-}{\mathrm{\alpha }}\right)}^{{2}}\right)$ (22)

Defining $\mathrm{Normalizer}$ appropriately helps. Note that we also need to clear the cache of series first.

 > $\mathrm{Normalizer}≔\mathrm{evala}:$
 > $\mathrm{series}\left(\frac{1}{p},x=\mathrm{α},2\right)$
 $\frac{{1}}{{{\mathrm{\alpha }}}^{{3}}{+}{\mathrm{\alpha }}{+}{1}}{-}\frac{{3}{}{{\mathrm{\alpha }}}^{{2}}{+}{1}}{{\left({{\mathrm{\alpha }}}^{{3}}{+}{\mathrm{\alpha }}{+}{1}\right)}^{{2}}}{}\left({x}{-}{\mathrm{\alpha }}\right){+}{O}{}\left({\left({x}{-}{\mathrm{\alpha }}\right)}^{{2}}\right)$ (23)
 > $\mathrm{forget}\left(\mathrm{series}\right)$
 > $\mathrm{series}\left(\frac{1}{p},x=\mathrm{α},2\right)$
 $\frac{{1}}{{3}{}{{\mathrm{\alpha }}}^{{2}}{+}{1}}{}{\left({x}{-}{\mathrm{\alpha }}\right)}^{{-1}}{+}{O}{}\left({\left({x}{-}{\mathrm{\alpha }}\right)}^{{0}}\right)$ (24)

Compatibility

 • The series command was updated in Maple 2016; see Advanced Math.