Making Power Series Expansions

Functions for creating power series.

Here is the power series expansion for exp(x) about the point x==0 to order (x^4):

Series[Exp[x],{x,0,4}]

Here is the series expansion of exp(x) about the point x==1:

Series[Exp[x],{x,1,4}]

If the Wolfram Language does not know the series expansion of a particular function, it writes the result symbolically in terms of derivatives:

Series[f[x],{x,0,3}]

In mathematical terms, (RefLink[Series, paclet:ref/Series]) can be viewed as a way of constructing Taylor series for functions.

The standard formula for the Taylor series expansion about the point x==(Subscript[x, 0]) of a function g(x) with k(^th) derivative (g^((k)))(x) is g(x)==(∑_(k=0)^∞)(g^((k)))((Subscript[x, 0]))((((x-(Subscript[x, 0])))^k)/(k!)). Whenever this formula applies, it gives the same results as (RefLink[Series, paclet:ref/Series]). (For common functions, (RefLink[Series, paclet:ref/Series]) nevertheless internally uses somewhat more efficient algorithms.)

(RefLink[Series, paclet:ref/Series]) can also generate some power series that involve fractional and negative powers, not directly covered by the standard Taylor series formula.

Here is a power series that contains negative powers of x:

Series[Exp[x]/x^2,{x,0,4}]

Here is a power series involving fractional powers of x:

Series[Exp[Sqrt[x]],{x,0,2}]

(RefLink[Series, paclet:ref/Series]) can also handle series that involve logarithmic terms:

Series[Exp[2x] Log[x],{x,0,2}]

There are, of course, mathematical functions for which no standard power series exist. The Wolfram Language recognizes many such cases.

(RefLink[Series, paclet:ref/Series]) sees that exp((1/x)) has an essential singularity at x==0, and does not produce a power series:

Series[Exp[1/x],{x,0,2}]

(RefLink[Series, paclet:ref/Series]) can nevertheless give you the power series for exp((1/x)) about the point x==∞:

Series[Exp[1/x],{x,Infinity,3}]

Especially when negative powers occur, there is some subtlety in exactly how many terms of a particular power series the function (RefLink[Series, paclet:ref/Series]) will generate.

One way to understand what happens is to think of the analogy between power series taken to a certain order, and real numbers taken to a certain precision. Power series are "approximate formulas" in much the same sense as finite-precision real numbers are approximate numbers.

The procedure that (RefLink[Series, paclet:ref/Series]) follows in constructing a power series is largely analogous to the procedure that (RefLink[N, paclet:ref/N]) follows in constructing a real-number approximation. Both functions effectively start by replacing the smallest pieces of your expression by finite-order, or finite-precision, approximations, and then evaluating the resulting expression. If there are, for example, cancellations, this procedure may give a final result whose order or precision is less than the order or precision that you originally asked for. Like (RefLink[N, paclet:ref/N]), however, (RefLink[Series, paclet:ref/Series]) has some ability to retry its computations so as to get results to the order you ask for. In cases where it does not succeed, you can usually still get results to a particular order by asking for a higher order than you need.

(RefLink[Series, paclet:ref/Series]) compensates for cancellations in this computation, and succeeds in giving you a result to order (x^3):

Series[Sin[x]/x^2,{x,0,3}]

When you make a power series expansion in a variable x, the Wolfram Language assumes that all objects that do not explicitly contain x are in fact independent of x. (RefLink[Series, paclet:ref/Series]) thus does partial derivatives (effectively using (RefLink[D, paclet:ref/D])) to build up Taylor series.

Both a and n are assumed to be independent of x:

Series[(a+x)^n,{x,0,2}]

a[x] is now given as an explicit function of x:

Series[(a[x]+x)^n,{x,0,2}]

You can use (RefLink[Series, paclet:ref/Series]) to generate power series in a sequence of different variables. (RefLink[Series, paclet:ref/Series]) works like (RefLink[Integrate, paclet:ref/Integrate]), (RefLink[Sum, paclet:ref/Sum]), and so on, and expands first with respect to the last variable you specify.

(RefLink[Series, paclet:ref/Series]) performs a series expansion successively with respect to each variable. The result in this case is a series in x, whose coefficients are series in y:

Series[Exp[x y],{x,0,3},{y,0,3}]