1001Ferramentas
Calculators

Numeric Function Integral

Computes a definite integral over an interval using composite Simpson 1 3 rule.

Numerical integration (quadrature)

Numerical integration, also called quadrature, approximates ∫ₐᵇ f(x) dx as a weighted sum of function values. The trapezoidal rule Σ (f(xᵢ) + f(xᵢ₊₁))/2 · Δx carries error O(h²). The Simpson's 1/3 rule fits parabolas instead and gets you to O(h⁴): (h/3)·[f(x₀) + 4Σf(xodd) + 2Σf(xeven) + f(xₙ)]. If you want to climb higher still, Romberg integration runs Richardson extrapolation on top of trapezoidal estimates, and Gauss–Legendre picks its abscissas and weights so cleverly that n points integrate any polynomial of degree 2n−1 exactly. Take ∫₀¹ x² dx by Simpson with n = 2: you get (1/6)·[0 + 4·0.25 + 1] = 0.3333…, which is the exact 1/3.

Applications and context

Quadrature earns its keep whenever ∫ f(x) dx has no closed-form antiderivative, like ∫ e^(−x²) dx (the error function) or ∫ sin(x)/x dx (sinc). You'll find it behind area under a curve (ROC AUC in ML), volume of revolution, and plenty of physics (work, electric flux, probability under PDFs). It also shows up in engineering (Fourier coefficients, FEM stiffness matrices) and in finance, where option pricing under custom densities leans on it.

FAQ

Trapezoidal or Simpson? For a smooth f, Simpson wins nearly every time. The number of function calls is the same, and you pick up two extra orders of accuracy.

When does Simpson fail? It struggles on integrands that are non-smooth, oscillatory or singular. For those, reach for adaptive quadrature, Gauss–Kronrod, or a specialized rule like Clenshaw–Curtis.

What about high dimensions? Grid-based rules hit the curse of dimensionality fast. Once you're past 4–5 dimensions, switch to Monte Carlo or quasi-Monte Carlo integration.

Related Tools