This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / The Mathematica Book / Advanced Mathematics in Mathematica / Series, Limits and Residues /

3.6.2 Advanced Topic: The Representation of Power Series

Power series are represented in Mathematica as SeriesData objects.

The power series is printed out as a sum of terms, ending with O[x] raised to a power.

In[1]:= Series[Cos[x], {x, 0, 4}]


Internally, however, the series is stored as a SeriesData object.

In[2]:= InputForm[%]

Out[2]//InputForm= SeriesData[x, 0, {1, 0, -1/2, 0, 1/24}, 0, 5, 1]

By using SeriesData objects, rather than ordinary expressions, to represent power series, Mathematica can keep track of the order and expansion point, and do operations on the power series appropriately. You should not normally need to know the internal structure of SeriesData objects.

You can recognize a power series that is printed out in standard output form by the presence of an O[x] term. This term mimics the standard mathematical notation , and represents omitted terms of order . For various reasons of consistency, Mathematica uses the notation O[x]^n for omitted terms of order , corresponding to the mathematical notation , rather than the slightly more familiar, though equivalent, form .

Any time that an object like O[x] appears in a sum of terms, Mathematica will in fact convert the whole sum into a power series.

The presence of O[x] makes Mathematica convert the whole sum to a power series.

In[3]:= a x + Exp[x] + O[x]^3