NResidue[expr,{z,z0}]
numerically finds the residue of expr near the point z=z0.
NResidue
NResidue[expr,{z,z0}]
numerically finds the residue of expr near the point z=z0.
Details and Options
- To use NResidue, you first need to load the Numerical Calculus Package using Needs["NumericalCalculus`"].
- The expression expr must be numeric when its argument x is numeric.
- The residue is defined as the coefficient of (z-z0)-1 in the Laurent expansion of expr.
- NResidue numerically integrates around a small circle centered at the point z0 in the complex plane. NResidue will return an incorrect result when the punctured disk is not analytic.
- NResidue is unable to recognize small numbers that should in fact be zero. Chop is often needed to eliminate these spurious residuals.
- Although Residue usually needs to be able to evaluate power series at a point, NResidue can find residues even if the power series cannot be computed.
- NResidue has the same options as NIntegrate, with the following additions and changes:
-
Radius 1/100 radius of contour on which integral is evaluated Method Trapezoidal integration method to use
Examples
open all close allBasic Examples (1)
Scope (2)
Needs["NumericalCalculus`"]NResidue can find residues of functions with essential singularities:
NResidue[Sin[(1/10x)], {x, 0}]//ChopSince Series is unable to handle essential singularities, Residue returns unevaluated:
Residue[Sin[(1/10x)], {x, 0}]Needs["NumericalCalculus`"]NResidue allows for some error in the location of the pole:
NResidue[(1/1.7 - 2.7z + z^2), {z, 1.}]//ChopDue to machine-precision arithmetic, z -> 1. is not a pole:
(1/1.7 - 2.7z + z^2) /. z -> 1.With Residue, the error in the location of the pole yields a result of zero:
Residue[(1/1.7 - 2.7z + z^2), {z, 1.}]Generalizations & Extensions (1)
Needs["NumericalCalculus`"]NResidue threads element-wise over lists:
NResidue[{Exp[(1/x)], Sin[(1/x)], Cos[(1/x)]}, {x, 0}, Radius -> 1]//ChopOptions (3)
Radius (2)
Needs["NumericalCalculus`"]Use Radius to shrink the radius of the contour of integration to isolate a single pole:
NResidue[(1/x) + (1/x + 0.005), {x, 0}]//ChopNResidue[(1/x) + (1/x + .005), {x, 0}, Radius -> .001]//ChopNeeds["NumericalCalculus`"]Increase the radius to improve convergence of the integration if no other poles are nearby:
NResidue[Exp[(1/x)], {x, 0}]//ChopNResidue[Exp[(1/x)], {x, 0}, Radius -> 1]//ChopWorkingPrecision (1)
Needs["NumericalCalculus`"]NResidue accepts options for NIntegrate, which are sometimes necessary to get an accurate result:
NResidue[Exp[(1/x)] + Exp[(1/x - (1/100))], {x, 0}, Radius -> (1/200), MaxRecursion -> 10, WorkingPrecision -> 100, PrecisionGoal -> 10]//ChopApplications (2)
Needs["NumericalCalculus`"]Use NResidue to evaluate derivatives of a function evaluated at a point:
Derivative[10][Zeta][0]//N[#, {30, 30}]&10!NResidue[(Zeta[x]/x^11), {x, 0}, Radius -> (1/2), WorkingPrecision -> 30]Needs["NumericalCalculus`"]Residues of numerical functions:
f[a_ ? NumericQ] := NIntegrate[Exp[(t^2/a)](1/10 + a t), {t, 0, 1}]NResidue[f[a], {a, 0}, Radius -> 1]//ChopProperties & Relations (1)
Needs["NumericalCalculus`"]NSeries can also compute residues of numerical functions:
f[x_ ? NumericQ] := Exp[(1/x)]NResidue[f[x], {x, 0}, Radius -> 1]//ChopUsing NSeries:
SeriesCoefficient[NSeries[f[x], {x, 0, 5}], -1]//ChopPossible Issues (1)
Needs["NumericalCalculus`"]NResidue will return an incorrect result when the integration contour contains branch cuts:
Residue[Sqrt[x - 1]Sqrt[x + 1], {x, 0}]NResidue[Sqrt[x - 1]Sqrt[x + 1], {x, 0}, Radius -> 2]Tech Notes
Related Guides
Text
Wolfram Research (2007), NResidue, Wolfram Language function, https://reference.wolfram.com/language/NumericalCalculus/ref/NResidue.html.
CMS
Wolfram Language. 2007. "NResidue." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/NumericalCalculus/ref/NResidue.html.
APA
Wolfram Language. (2007). NResidue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/NumericalCalculus/ref/NResidue.html
BibTeX
@misc{reference.wolfram_2026_nresidue, author="Wolfram Research", title="{NResidue}", year="2007", howpublished="\url{https://reference.wolfram.com/language/NumericalCalculus/ref/NResidue.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_nresidue, organization={Wolfram Research}, title={NResidue}, year={2007}, url={https://reference.wolfram.com/language/NumericalCalculus/ref/NResidue.html}, note=[Accessed: 13-June-2026]}