Multiple Integral Calculator

Compute the double integral (volume under surface) over a rectangular region [a,b]×[c,d]. The tool uses an adaptive 2D Simpson (cubature) method with high accuracy. Visualize the surface in real-time 3D.

Use variables x and y. Supported: + - * / ^, sin, cos, tan, exp, log (natural), sqrt.
Numerical method: Adaptive 2D Simpson (cubature). Tolerance ~1e-8.
Integrability Note: The numerical method assumes f(x,y) is continuous over the rectangle. If your function has singularities (e.g., division by zero, log of negative values), the result may be inaccurate or the integration may fail. Always verify the domain.
Examples:
∬ (x²+y²) over [-1,1]²
∬ sin(x)cos(y) [0,π]²
Gaussian bell
∬ xy [0,1]² = 0.25
Area = 6
Local & Private — All computations run in your browser (nerdamer for evaluation + custom numerical integrator). No data leaves your device.
Surface z = f(x,y)
Volume ∬ f(x,y) dA
Drag to rotate, scroll to zoom. Surface color mapped to z-value (blue = low, red = high).
The visualization helps inspect the volume under the surface; actual integral value is numeric.

What is a Double Integral?

The double integralR f(x,y) dA extends the concept of a definite integral to two dimensions. Over a rectangular region R = [a,b] × [c,d], it represents the signed volume between the surface z = f(x,y) and the xy‑plane. Formally, it is defined as the limit of Riemann sums over subdivisions of the region.

\[ \iint_R f(x,y)\,dA = \lim_{m,n\to\infty} \sum_{i=1}^{m}\sum_{j=1}^{n} f(x_i^*, y_j^*)\,\Delta x \Delta y \]

Double integrals are used to compute volumes, average values, centers of mass, and probabilities in two dimensions. This calculator provides a high‑precision numerical estimate using an adaptive 2D Simpson (cubature) algorithm, and displays the surface in interactive 3D.

Numerical Method: Adaptive 2D Simpson Cubature

The algorithm recursively subdivides each rectangular cell into four sub‑rectangles, applying Simpson's 1/3 rule in both dimensions (the “cubature” formula). The error is estimated by comparing the integral on the cell with the sum of integrals on its four children. The process continues until the estimated error falls below a tolerance (default 1e-8). This method is robust for smooth functions and provides accurate results even for moderately oscillatory integrands.

Implementation details: Our integrator is based on the algorithm described in Numerical Recipes (Press et al., 3rd ed., Section 4.4). Maximum recursion depth is 20, tolerance ε = 1e-8 for most computations.

Common Double Integrals (Rectangular Region)

f(x,y) [a,b]×[c,d] f(x,y) dA Example (a,b,c,d)
1 (b−a)(d−c) (area) ∬[0,1]² 1 dA = 1
x^n y^m (b^{n+1}−a^{n+1})/(n+1) · (d^{m+1}−c^{m+1})/(m+1) ∬[0,1]² xy dA = 1/4
sin(x) cos(y) (cos(a)−cos(b))·(sin(d)−sin(c)) ∬[0,π]² sin(x)cos(y) = 0
e^{-(x²+y²)} √π·(erf(b)−erf(a))/2 · √π·(erf(d)−erf(c))/2 (numerical) Gaussian integral
Fubini's theorem: Over a rectangle, the order of integration does not matter: ∬ f(x,y) dA = ∫∫ f(x,y) dx dy = ∫∫ f(x,y) dy dx. Our 2D cubature integrates simultaneously without fixing order.

Step-by-Step Example

Compute ∬[-1,1]×[-1,1] (x² + y²) dA

  1. Enter x^2 + y^2 as function.
  2. Set x range: -1 to 1, y range: -1 to 1.
  3. Click “Compute Double Integral & Render”.
  4. Exact value = ∫₋₁¹∫₋₁¹ (x²+y²) dx dy = 2·(2/3) + 2·(2/3) = 8/3 ≈ 2.6666667.
  5. The numerical result will be ≈ 2.6666667, and the 3D surface shows a paraboloid.

When Is Numerical Integration Necessary?

Many functions do not have elementary antiderivatives in two variables, or the iterated integration is cumbersome. Examples include exp(-x²-y²), sin(x²+y²), or any function where the inner integral cannot be expressed in closed form. This calculator always uses numerical cubature, ensuring a reliable result for any continuous function over the rectangle.

The adaptive Simpson cubature aims for an absolute error less than 1e-8 for the integral over the whole region. For most functions, the achieved accuracy is even higher. The recursion stops when the estimated error falls below the tolerance or after 20 subdivisions.

This tool currently supports only rectangular regions. For general domains, you can transform the integral using change of variables or split into multiple rectangles.

If the function contains discontinuities or very sharp peaks, the mesh generation may fail. Ensure the function is defined over the entire rectangle and produces finite values. If problems persist, try simpler ranges.

Fubini's theorem states that over a rectangle, the double integral equals the iterated integral (integrate with respect to x, then y, or vice versa). Our numerical method directly approximates the double integral without assuming order.
Academic validation & references: The adaptive cubature algorithm is based on Press, Teukolsky, Vetterling, Flannery, Numerical Recipes (3rd ed.), Section 4.4 “Adaptive Quadrature”. The method has been benchmarked against exact integrals from Abramowitz & Stegun, Handbook of Mathematical Functions.

? Further reading: Double Integral (MathWorld) | Multiple Integral – Wikipedia | OpenStax Calculus Volume 3

? Digital reference: Numerical Recipes (Online) – Chapter 4.4 “Adaptive Quadrature”.

All computations are performed locally. The surface visualization uses Three.js (MIT licensed).