Double-Exponential (DE) Quadrature: Integral over (-∞, ∞)

Double-Exponential (DE) Quadrature: Integral over (-∞, ∞)

Emerging AI Skill PRO

Enter Calculation

Use x, operators + - * / ^ and functions exp, log, ln, sin, cos, tan, sqrt, abs, atan. Must decay at infinity (non-periodic).

Results

Integral over (-∞, ∞)
3.1415926536
approximate value of ∫ f(x) dx
Method Double-Exponential (tanh-sinh family) quadrature
Transform x = sinh((π/2) sinh t)
Requested digits 15
Converged Yes

Formula

∫−∞∞f(x)dx≈h∑k=−NNf(xk)wkwhere{xk=sinh⁡(π2sinh⁡(kh))wk=π2cosh⁡(kh)cosh⁡(π2sinh⁡(kh))h,N=chosen for digits precision\begin{gathered} \int_{-\infty}^{\infty} {f(x)}\,dx \;\approx\; h\sum_{k=-N}^{N} f\!\left(x_k\right)\, w_k \\[1.5em] \text{where}\quad \left\{ \begin{aligned} x_k &= \sinh\!\left(\tfrac{\pi}{2}\sinh(kh)\right) \\ w_k &= \tfrac{\pi}{2}\cosh(kh)\,\cosh\!\left(\tfrac{\pi}{2}\sinh(kh)\right) \\ h,N &= \text{chosen for } \text{digits} \text{ precision} \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Report an error on this page

What this calculator does

This tool numerically evaluates the definite integral of a function f(x) over the entire real line, from minus infinity to plus infinity, using Double-Exponential (DE) quadrature — also called the tanh-sinh family or the Takahasi-Mori method. DE quadrature is one of the most efficient general-purpose schemes for smooth integrands and converges astonishingly fast: the number of correct digits grows nearly linearly with the number of sample points.

How to use it

Type a math expression for f(x) using x, the operators + - * / ^, parentheses, and standard functions such as exp, log/ln, sin, cos, tan, sqrt, abs and atan. Then choose how many significant digits you want (6 to 50). Higher precision uses a finer step size and a wider truncation range. The integrand should be analytic on the real line and must decay as x grows; it must not be periodic or oscillate without decaying.

Symmetric bell curve decaying very fast on both sides representing the quadrature weight
The weight φ'(t) decays double-exponentially, so distant terms contribute almost nothing.

The formula explained

The DE method applies the change of variable \(x = \sinh\!\left(\tfrac{\pi}{2}\sinh t\right)\), whose derivative is \(\varphi'(t) = \tfrac{\pi}{2}\cosh t\,\cosh\!\left(\tfrac{\pi}{2}\sinh t\right)\). After substitution the integral becomes the integral of \(f(\varphi(t))\,\varphi'(t)\) in t. Because \(\varphi'(t)\) decays like a double exponential as |t| grows, the simple trapezoidal rule with uniform step h, $$I \approx h \cdot \sum f(\varphi(kh))\,\varphi'(kh),$$ becomes extremely accurate. The calculator starts with a coarse step, then halves h repeatedly (reusing nodes) until two successive estimates agree to the requested tolerance.

Advertisement

Worked example

For \(f(x) = \tfrac{1}{1+x^2}\) the exact integral is \([\arctan x]\) from minus to plus infinity $$\int_{-\infty}^{\infty} \frac{1}{1+x^2}\,dx = \pi \approx 3.14159265358979.$$ A coarse DE sum with step 0.5 over nodes k = -8..8 already gives about 3.15; refining the step converges to the full-precision value of pi. Likewise \(\exp(-x^2)\) returns \(\sqrt{\pi} \approx 1.77245385090552\).

Equally spaced points in t mapped to points clustering near zero and spreading toward both infinities in x
The DE transformation maps a uniform grid in t onto the real line, concentrating points near the center.

FAQ

Why does it say "did not converge"? Most often the integral diverges (the integrand does not decay, e.g. f = 1) or the function is periodic/oscillatory. DE quadrature assumes a non-periodic, endpoint-analytic integrand.

What precision should I pick? 15 digits matches double precision and is a good default. Asking for far more digits than double precision can support will not improve the answer.

Can I integrate singular functions? The method tolerates endpoint behavior because extreme nodes are weighted to nearly zero, but interior poles on the real axis will break it.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators