NSeries[f,{x,x0,n}]
gives a numerical approximation to the series expansion of f about the point x=x0 including the terms (x-x0)-n through (x-x0)n.
NSeries
NSeries[f,{x,x0,n}]
gives a numerical approximation to the series expansion of f about the point x=x0 including the terms (x-x0)-n through (x-x0)n.
Details and Options
- To use NSeries, you first need to load the Numerical Calculus Package using Needs["NumericalCalculus`"].
- The function f must be numeric when its argument x is numeric.
- NSeries will construct standard univariate Taylor or Laurent series.
- NSeries samples f at points on a circle in the complex plane centered at x0 and uses InverseFourier. The option Radius specifies the radius of the circle.
- The region of convergence will be the annulus (containing the sampled points) where f is analytic.
- NSeries will not return a correct result if the disk centered at x0 contains a branch cut of f.
- The result of NSeries is a SeriesData object.
- If the result of NSeries is a Laurent series, then the SeriesData object is not a correct representation of the series, as higher-order poles are neglected.
- No effort is made to justify the precision in each of the coefficients of the series.
- NSeries is unable to recognize small numbers that should in fact be zero. Chop is often needed to eliminate these spurious residuals.
- The number of sample points chosen is
. - The following options can be given:
-
Radius 1 radius of circle on which f is sampled WorkingPrecision MachinePrecision precision used in internal computations
Examples
open all close allBasic Examples (1)
Needs["NumericalCalculus`"]This is a power series for the exponential function around
:
NSeries[Exp[x], {x, 0, 5}]Chop is needed to eliminate spurious residuals:
%//ChopUsing extended precision may also eliminate spurious imaginaries:
NSeries[Exp[x], {x, 0, 5}, WorkingPrecision -> 17]Scope (2)
Needs["NumericalCalculus`"]Find expansions in the complex plane:
NSeries[Exp[x], {x, I, 5}]//ChopNeeds["NumericalCalculus`"]Find Laurent expansions about essential singularities:
NSeries[Sin[x + 1 / x], {x, 0, 10}]//ChopSeries will not find Laurent expansions about essential singularities:
Series[Sin[x + 1 / x], {x, 0, 10}]Options (2)
Radius (2)
Needs["NumericalCalculus`"]Use Radius to pick the annulus within which the Laurent series will converge:
NSeries[(1/(1 + x)(3 + x)), {x, 0, 10}, Radius -> 2]//ChopNSeries[(1/(1 + x)(3 + x)), {x, 0, 10}, Radius -> 5]//ChopNeeds["NumericalCalculus`"]Changing Radius can improve accuracy:
NSeries[(1/1 - x), {x, 0, 10}, Radius -> (7/8)]//ChopNSeries[(1/1 - x), {x, 0, 10}, Radius -> (1/5)]//ChopApplications (1)
Needs["NumericalCalculus`"]A function defined only for numerical input:
f[a_ ? NumericQ] := NIntegrate[Sin[a Sin[x] + Cos[x]], {x, 0, a}]g[a_] = Normal@NSeries[f[a], {a, 0, 10}]//ChopPlot[{f[a], g[a]}, {a, 0, 2}]Properties & Relations (1)
Needs["NumericalCalculus`"]NResidue can also be used to construct a series of a numerical function:
f[x_ ? NumericQ] := Exp[x]NSeries[f[x], {x, 0, 5}]//ChopUsing NResidue:
NResidue[f[x]x^Range[-1, -6, -1], {x, 0}, Radius -> 1].x^Range[0, 5]//ChopPossible Issues (2)
Needs["NumericalCalculus`"]NSeries can have aliasing problems due to InverseFourier:
NSeries[ArcSin[x], {x, 0, 20}]//ChopThe correct expansion is analytic at the origin:
Series[ArcSin[1.x], {x, 0, 20}]Needs["NumericalCalculus`"]SeriesData cannot correctly represent a Laurent series. Here is the square of the series of Exp[
+x]:
NSeries[Exp[(1/x) + x], {x, 0, 5}]^2//ChopHere is the SeriesData representation of the Laurent series of
:
NSeries[Exp[(1/x) + x]^2, {x, 0, 5}]//ChopNeat Examples (1)
Needs["NumericalCalculus`"]Find the series expansion of the generating function for unrestricted partitions:
q[z_ ? NumericQ] := NProduct[(1/1 - z^n), {n, ∞}]NSeries[q[z], {z, 0, 20}, Radius -> (1/2), WorkingPrecision -> 17]//ChopPartitionsP[Range[0, 20]]Tech Notes
Related Guides
Text
Wolfram Research (2007), NSeries, Wolfram Language function, https://reference.wolfram.com/language/NumericalCalculus/ref/NSeries.html.
CMS
Wolfram Language. 2007. "NSeries." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/NumericalCalculus/ref/NSeries.html.
APA
Wolfram Language. (2007). NSeries. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/NumericalCalculus/ref/NSeries.html
BibTeX
@misc{reference.wolfram_2026_nseries, author="Wolfram Research", title="{NSeries}", year="2007", howpublished="\url{https://reference.wolfram.com/language/NumericalCalculus/ref/NSeries.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_nseries, organization={Wolfram Research}, title={NSeries}, year={2007}, url={https://reference.wolfram.com/language/NumericalCalculus/ref/NSeries.html}, note=[Accessed: 13-June-2026]}