Skip to content

SeriesData

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

SeriesData[x, x0, {a0, a1, ...}, nmin, nmax, den]
    represents a power series in the variable x about the point x0.
    The ai are the coefficients in the power series. The powers of
    (x - x0) that appear are nmin/den, (nmin+1)/den, ..., (nmax-1)/den,
    and an O[x - x0]^(nmax/den) term represents the omitted higher-order terms.
SeriesData objects are generated by Series.
SeriesData objects print as sums of coefficients multiplied by powers of x - x0;
    InputForm prints the literal SeriesData[...] form instead.
Normal[expr] converts a SeriesData object into a normal expression, dropping the O-term.

Examples

All examples below are verified against the current Mathilda build.

In[1]:= SeriesData[x, 0, {1, 1, 1/2, 1/6, 1/24, 1/120}, 0, 6, 1]
Out[1]= 1 + x + 1/2 x^2 + 1/6 x^3 + 1/24 x^4 + 1/120 x^5 + O[x]^6

In[2]:= InputForm[%]
Out[2]= SeriesData[x, 0, {1, 1, 1/2, 1/6, 1/24, 1/120}, 0, 6, 1]

In[3]:= SeriesData[x, 0, Table[i^2, {i, 10}], 0, 10, 1]
Out[3]= 1 + 4 x + 9 x^2 + 16 x^3 + 25 x^4 + 36 x^5 + 49 x^6 + 64 x^7 + 81 x^8 + 100 x^9 + O[x]^10

In[4]:= SeriesData[x, 2, {a, b, c}, 0, 3, 1]
Out[4]= a + b (x - 2) + c (x - 2)^2 + O[x - 2]^3

In[5]:= SeriesData[x, 0, {1, 2, 3}, 1, 7, 2]
Out[5]= Sqrt[x] + 2 x + 3 x^(3/2) + O[x]^(7/2)

Implementation notes

Data structures. SeriesData[x, x0, {a0, ..., a_{k-1}}, nmin, nmax, den] is the data head representing a truncated power series produced by Series. The i-th coefficient a_i multiplies (x - x0)^((nmin + i)/den), and the O[x - x0]^(nmax/den) term captures the dropped higher-order tail. The integer den (>= 1) is the common denominator of the exponents, so Laurent (nmin < 0) and Puiseux (den > 1, fractional exponents) series are both representable. It carries only ATTR_PROTECTED — there is no builtin_seriesdata handler; it is an inert container constructed by so_to_expr from the internal SeriesObj and consumed by Normal (which drops the O-term and rebuilds the explicit Plus of powers) and by the printer. The same fields mirror the in-memory SeriesObj struct (x, x0, owned coefficient array, nmin, order, den) used during computation in series_expand.

  • Protected.
  • SeriesData is a pure data head; it has no evaluator and is normally

Attributes: Protected.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References

Notes & additional examples

Worked examples

A SeriesData object prints as a sum of coefficients times powers of x - x0:

In[1]:= SeriesData[x, 0, {1, 1, 1}, 0, 3, 1]
Out[1]= 1 + x + x^2 + O[x]^3

Normal drops the order term, recovering an ordinary expression:

In[1]:= Normal[SeriesData[x, 0, {1, 1, 1}, 0, 3, 1]]
Out[1]= 1 + x + x^2

InputForm reveals the raw representation Series builds — here the Taylor data for Sin[x], with coefficient list, nmin = 0, nmax = 5, denominator 1:

In[1]:= InputForm[Series[Sin[x], {x, 0, 4}]]
Out[1]= SeriesData[x, 0, {0, 1, 0, -1/6, 0}, 0, 5, 1]

A Laurent series has a negative nmin. The expansion of 1/(E^x - 1) starts at x^(-1), so nmin = -1:

In[1]:= InputForm[Series[1/(Exp[x] - 1), {x, 0, 3}]]
Out[1]= SeriesData[x, 0, {1, -1/2, 1/12, 0, -1/720}, -1, 4, 1]

A Puiseux series uses a denominator greater than 1. For Sqrt[x] + x the powers are half-integers, so den = 2:

In[1]:= InputForm[Series[Sqrt[x] + x, {x, 0, 2}]]
Out[1]= SeriesData[x, 0, {0, 1, 1, 0, 0}, 0, 5, 2]

Notes

SeriesData[x, x0, {a0, a1, ...}, nmin, nmax, den] is the internal representation of a power series in x about x0. The powers that appear are nmin/den, (nmin+1)/den, ..., (nmax-1)/den, with a trailing O[x - x0]^(nmax/den) term standing in for the omitted tail. The single uniform structure covers Taylor (nmin >= 0, den = 1), Laurent (nmin < 0), and Puiseux (den > 1) series. These objects are produced by Series; use Normal to convert one back to an ordinary polynomial by discarding the O-term, and InputForm to see the literal SeriesData[...] form instead of the pretty-printed sum.