
Power Series Expansions
Often our goal in studying certain physical phenomena is to find a function that best describes the phenomena. The intended purpose of such a function is to yield output that is exact for the given input. However, the form of the function may be such that conducting certain mathematical operations on it may be difficult, thus limiting the scope of an analysis on the function. Thus it may be appealing to replace a given function with a simpler function, one that approximates the original function at certain values of the variable or variables, provided we can find one that will serve well enough as such a replacement.
One method of approximating a function is by means of a power series expansion of the function about a given point. If f(x) is a given function, then a power series expansion of f(x) about the point x = x0 is a series of the form
f(x) = am (x - x0)m + am+1 (x - x0)m+1 + am+2 (x - x0)m+2 + ···,
where am, am+1, am+2, ... are specific real numbers, and m is an integer--either positive, negative, or 0. We have no guarantee that the power series expansion will converge for a given value of x, but note that when x is approximately x0, then each x - x0 term is approximately 0. Thus there is a possibility that the power series expansion will converge for values of x near x0. To find the values of x at which a power series converges requires knowing the actual form of the values am, am+1, am+2, ..., and requires more work than we are able to do here.
We can obtain a finite part, the first few terms, of a power series expansion of a function about a point by means of the Mathematica function Series as follows:
Series[function,{x,x0,n}]
where function is the function we wish to represent in terms of a power series expansion, n is the order of the expansion, x is the variable of the function, and x = x0 is the point about which we wish to find the expansion. This yields the power series terms in (x - x0) of degree less than or equal to n, along with a term that indicates the next higher degree terms of (x - x0) that will occur in the expansion if it were carried out further.
-
Example 1: Find the 2nd order power series expansion of
f(x) = ex - e-x
about the point x = 1.
To do this we utilize the Mathematica function Series as follows:
In[1]:= Series[Exp[x]-Exp[-x],{x,1,2}]
1 1 -1 E
Out[1]= (- - + E) + (- + E) (-1 + x) + (--- + -) (-1 + x)2
E E 2 E 2
+ O[-1 + x]3
Note that the coefficients of this expansion are all in terms of the number e. We can obtain numerical values for these coefficients by numerically evaluating this expression with the function N:
In[2]:= N[%]
Out[2]= 2.3504 + 3.0862 (-1. + x) + 1.1752 (-1. + x)2 +
O[-1. + x]3
To truncate the extra power series term that holds the information for the terms beyond the nth order, we utilize the command
Normal[series]
where series is the power series expansion that we have obtained by means of the function Series.
-
Example 2: We can obtain a truncation of the series from the previous problem as follows:
In[3]:= Normal[%%]
1 1 -1 E
Out[3]= (- - + E) + (- + E) (-1 + x) + (--- + -) (-1 + x)2
E E 2 E 2
To rewrite this polynomial expression in terms of its expansion we can utilize the Mathematica function Expand as follows:
In[4]:= Expand[%]
-5 E 2 x x2 E x2
Out[4]= --- + - + --- - --- + ----
2 E 2 E 2 E 2
To compare how well the truncated power series compares with the original function f(x), consider the graphs of the two functions on the same set of coordinate axes:

The graph of f(x) verses the graph of the truncation of the second order expansion of f(x) about x = 1.
-
Example 3: If an electric charge is placed at the point (0, 0) in the xy-plane, and another charge is placed on the horizontal line y = 1, then the magnitude of the force that results between the two charges can be written as a function of the position (x, 1) of the second charge as follows:
A
F(x) = -----
1 + x2
where A is some constant. We can approximate this function with a power series in x as x approaches 0 (as the second charge approaches the point (0, 1)). The power series about x = 0 to the 6th order is given by
In[5]:= f[x_]=A/(1+x^2);
Series[f[x],{x,0,6}]
Out[5]= A - A x2 + A x4 - A x6 + O[x]7
Thus we see that near x = 0 the function
A
F(x) = -----
A - A x2 + A x4 - A x6.
1 + x2
Let us compare the values of these two functions, F(x) and the truncated power series, at the points x = .001, .01, .1, 1, 10, and 100.
First we designate the truncated power series as a fuction
In[6]:= pf[x_]=Normal[%];
and create a list for our points
In[7]:= points={.001,.01,.1,1.,10.,100.};
We then evaluate both functions at each point:
In[8]:= f[points]
pf[points]
Out[8]= {0.999999 A, 0.9999 A, 0.990099 A, 0.5 A,
0.00990099 A, 0.00009999 A}
Out[9]= {0.999999 A, 0.9999 A, 0.990099 A, 0. A,
-990099. A, -9.999×1011 A}
Thus we see that these two functions yield values that are similar at x = .001, .01, and .1, but for the other values, the functions are significantly different.
-
Example 4: Let us find the 5th order power series expansion of the function
cos(x) - 1
f(x) = ---------
sin(x) - x
about the point x = 0, and compare the power series expansion with the function f(x) at the values of x = .01, .1, 1, 10, and 100.
Before we actually attempt this, let us consider the expressions that are contained in each of the numerator and the denominator. In the numerator we have the function cos(x) - 1, which itself has a power series expansion about the point x = 0:
In[10]:= Series[Cos[x]-1,{x,0,5}]
-x2 x4
Out[10]= --- + -- + O[x]6
2 24
The function in the denominator is sin(x) - x, which has the following power series expansion about x = 0:
In[11]:= Series[Sin[x]-x,{x,0,5}]
-x3 x5
Out[11]= --- + --- + O[x]6
6 120
Thus, as power series expansions, the numerator has a factor of x2 and the denominator has a factor of x3. This implies that the function f(x) should have a power series expansion about x = 0 with a leading term involving 1/x:
In[12]:= f[x_]=(Cos[x]-1)/(Sin[x]-x);
Series[f[x],{x,0,5}]
3 x x3 x5
Out[12]= - - -- - ---- + ------ + O[x]6
x 10 4200 126000
To compare the values of the power series expansion of f(x) of order 5 to the actual function f(x), we need to truncate the power series
In[13]:= g[x_]=Normal[%]
3 x x3 x5
Out[13]= - - -- - ---- + ------
x 10 4200 126000
and evaluate each of these at the given points:
In[14]:= points={.01,.1,1.,10.,100.};
f[points]
g[points]
Out[14]= {299.999, 29.99, 2.89977, 0.174418, 0.00136987}
Out[15]= {299.999, 29.99, 2.89977, -0.144444, 79117.}
Thus we see that the truncated series represents the values of our function f(x) fairly well for x = .01, .1, and 1, but not for x = 10 or 100.
-
Example 5: A moving electron suddenly slows from a speed of v1 to a speed of v2, where v1 > v2, and in the process emits a quanta of electromagnetic radiation. In relativistic terms, the energy E of the radiation is given by
m0 c2 m0 c2
E = ------------- - -------------
(1 - (v1/c)2)1/2 (1 - (v2/c)2)1/2
where c is the speed of light in a vacuum (in the same units as v1 and v2), and m0 is the rest mass of an electron. Let us find an expression that represents an approximate value for the energy of the radiation in terms of polynomials in v1 and v2 of degree 4 or less.
The above expression for energy is actually the difference between the relativistic mass-energy of an object of mass m0 moving at the speed v1 and the relativistic mass-energy of an object of the same mass moving at the speed v2. Thus it is the difference of two values of the same function. We input this function as follows:
In[16]:= f[v_]=m0*c^2/Sqrt[1-(v/c)^2];
We now wish to find a power series expansion of order 4 for the difference in values of this function at our two speeds. We did not specify the point about which we wish to make these expansions, so to keep things as simple as possible, we shall make the expansions about 0:
In[17]:= g[v_]=Normal[Series[f[v],{v,0,4}]]
m0 v2 3 m0 v4
Out[17]= c2 m0 + ----- + -------
2 8 c2
The energy E is then approximated by the following difference:
In[18]:= g[v1]-g[v2]
m0 v12 3 m0 v14 m0 v22 3 m0 v24
Out[18]= ------ + -------- - ------- - --------
2 8 c2 2 8 c2
Thus we have
m0 v12 3 m0 v14 m0 v22 3 m0 v24
E
------ + -------- - ------ - --------
2 8 c2 2 8 c2
for values of v1 and v2 that are sufficiently small. Note that if we had represented the energy in terms of polynomials in v1 and v2 of degree 2 or less, we would have obtained
m0 v12 m0 v22
E
------ - ------
2 2
which is the Newtonian expression for the difference in the kinetic energy of the electron before and after the emission of radiation.
Additional information on power series expansions of functions and their applications can be found in Section 3.6 of The Mathematica Book.
Exercises
Last modified: Wed Oct 17 2001