Normal¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
Normal[expr]
converts expr to a normal expression. If expr is a SeriesData object, the
O-term is dropped and the truncated polynomial (or Laurent/Puiseux sum) is
returned. Other expressions pass through unchanged.
Examples¶
All examples below are verified against the current Mathilda build.
In[1]:= Normal[Series[Exp[x], {x, 0, 5}]]
Out[1]= 1 + x + 1/2 x^2 + 1/6 x^3 + 1/24 x^4 + 1/120 x^5
In[2]:= Normal[a + b]
Out[2]= a + b
In[3]:= Normal[Series[BesselJ[0, x], {x, Infinity, 2}]]
Out[3]= Sqrt[2/Pi] Sqrt[1/x] Cos[1/4 Pi - x] - 1/8 Sqrt[2/Pi] (1/x)^(3/2) Sin[1/4 Pi - x]
Implementation notes¶
Algorithm. builtin_normal converts a SeriesData[x, x0, {a0,...,a_{k-1}},
nmin, nmax, den] into an ordinary polynomial by dropping the O-term. It builds
the base (x - x0) (series_build_xmx0), then for each non-zero coefficient a_i
forms the term a_i (x - x0)^((nmin+i)/den) — using an integer exponent when
den == 1, otherwise Rational[num, den], and emitting the coefficient bare when
the exponent is 0 — and sums the terms (Plus, or the single term / literal 0
for degenerate cases), evaluating the result. Any argument that is not a 6-element
SeriesData is passed through unchanged (expr_copy).
Data structures. A direct read of the SeriesData arg slots (coefficient
List, nmin, den); no SeriesObj is reconstructed.
Protected.- Returns the Plus of the coefficient-times-power terms (zero coefficients skipped). For non-
SeriesDatainput,Normalis the identity. - Recurses through the whole expression, dropping the O-term of every
SeriesDataat any depth. This matters for expansions around+-Infinity, whoseSeriesDatais wrapped insidePlus/Times(e.g. the trig- or exponential-prefactored asymptotic forms ofBesselJ,BesselY,BesselK,BesselI,AiryAi,AiryBiPrime); the surrounding factors are preserved and recombined by the evaluator.
Attributes: Protected.
Implementation status¶
Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
References¶
- Source:
src/calculus/series.c - Specification:
docs/spec/builtins/power-series.md
Notes & additional examples¶
Worked examples¶
Drop the O-term from the Maclaurin series of Sin[x]/x to recover the truncated
polynomial:
The tangent series, with its Bernoulli-number coefficients laid bare:
The alternating-harmonic expansion of Log[1 + x]:
Notes¶
Normal[expr] converts expr to a normal expression. Applied to a SeriesData
object it drops the O-term and returns the truncated polynomial (or
Laurent/Puiseux sum) as an ordinary Plus expression, ready to be added,
differentiated, or substituted into. Expressions that are already normal pass
through unchanged.