Example 1: Rectangular midpoint sampling
Suppose:
on the rectangle
Using \(n=2\) samples per dimension gives:
The four midpoint values are:
The midpoint estimate is:
For this linear function, the midpoint estimate matches the exact integral:
Use this Double Integral Calculator to enter values, adjust options, and review results in a compact responsive workspace.
Results are calculated automatically as you enter data.
Enter an integrand and bounds.
Run a calculation to create a textual graph summary.
▼ See explanations and tips below ▼
A double integral measures accumulation over a two-dimensional region. Instead of adding values along a line, as a single integral does, a double integral adds values over an area in the \(xy\)-plane.
For a function \(f(x,y)\) over a region \(R\), the double integral is written as:
When \(f(x,y)\) is nonnegative and represents height, this integral can be interpreted as the volume under the surface \(z=f(x,y)\) and above the region \(R\). When the function has both positive and negative values, the result is a signed accumulation: positive values add to the total, while negative values subtract from it.
Many double integrals can be evaluated exactly by hand, but not all of them are convenient or even possible to express using elementary antiderivatives. Numerical evaluation solves this practical problem by estimating the integral from a finite set of sample points.
This calculator begins with midpoint sampling. It then doubles the grid and uses Richardson extrapolation to compare successive estimates. A result is shown only when the adaptive estimates agree within the calculator's numerical tolerance.
Double integrals are useful because many quantities are spread across a region rather than located at one point. In calculus, physics, engineering, statistics, and applied modeling, they can represent ideas such as:
Numerical double integration is especially useful when the region is easy to describe but the antiderivative is difficult, when the function is complicated, or when a student wants to check whether an integral setup is reasonable.
For a rectangular region
the exact double integral can be written as:
A midpoint approximation divides the \(x\)-interval and \(y\)-interval into \(n\) parts:
The midpoint sample coordinates are:
The rectangular midpoint approximation is:
This means each sample value is treated as the representative height for one small rectangle.
Let \(M_n\) be the midpoint estimate from an \(n\)-by-\(n\) grid. Because the midpoint rule is second order for sufficiently smooth inputs, the calculator combines two grid levels using Richardson extrapolation:
It then compares consecutive extrapolated values. The displayed internal error estimate is based on \(\lvert R_{4n}-R_{2n}\rvert/15\). This check catches many unstable, singular, and undersampled inputs, but it is not a rigorous bound for every possible function.
A common nonrectangular region is described by \(x\) running from \(a\) to \(b\), while \(y\) runs from a lower curve \(g(x)\) to an upper curve \(h(x)\):
For this type of region, each vertical slice can have a different height. The calculator samples an \(x\) midpoint, computes the lower and upper \(y\)-bounds there, then applies midpoint sampling within that slice.
At an \(x\) midpoint \(x_i^*\), the vertical cell height is:
A corresponding midpoint sample in that slice is:
The custom-region approximation follows the same idea:
Polar coordinates are often simpler for disks, circles, annular regions, sectors, and regions with circular symmetry. The coordinate conversion is:
In polar form, area is not just \(dr\,d\theta\). The area element is:
So a polar double integral is written as:
The midpoint approximation becomes:
The factor \(r_i^*\) is important. It accounts for the fact that polar cells farther from the origin cover more area than polar cells near the origin.
The area of a region can be found by integrating \(1\) over that region:
The average value of \(f\) over a region of positive area is:
The average value has the same units as the function. The double integral has function-value times area units.
Suppose:
on the rectangle
Using \(n=2\) samples per dimension gives:
The four midpoint values are:
The midpoint estimate is:
For this linear function, the midpoint estimate matches the exact integral:
For the unit disk, use:
Let:
Since \(x^2+y^2=r^2\), the polar integral is:
The second \(r\) is the polar area factor, not part of the original function. Evaluating gives:
In polar mode, the function should still be entered in terms of \(x\) and \(y\). The coordinate conversion and the polar area factor are handled as part of the polar setup.
Suppose the region lies between:
from \(x=0\) to \(x=1\). If \(f(x,y)=1\), then the double integral gives the area of the region:
Evaluate the inner integral first:
Then integrate with respect to \(x\):
This illustrates how custom \(y\)-bounds describe a region whose vertical height changes with \(x\).
The main numerical result is an approximation of the signed double integral over the selected region. A positive result means positive sampled values dominate the accumulation. A negative result means negative sampled values dominate. A result near zero can mean the function is small, the region is small, or positive and negative contributions mostly cancel.
The region area is the area of the integration domain in the \(xy\)-plane. It is not the surface area of \(z=f(x,y)\).
The average value is:
It represents the mean value of \(f(x,y)\) over the region. If the function represents height, the average value can be thought of as the constant height that would give the same total volume over the same base region.
The sampled value range shows the smallest and largest function values found at the sample points. This is useful for a quick check, but it is not a proof of the true global minimum or maximum over the entire region.
For polar regions, the result already includes the polar factor \(r\). Do not multiply the function by \(r\) yourself unless the mathematical integrand truly contains that factor in addition to the polar area element.
Entering \(r\) or \(\theta\) in the function field: The function is entered as \(f(x,y)\). In polar mode, the calculator evaluates that function at \(x=r\cos(\theta)\) and \(y=r\sin(\theta)\).
Multiplying by \(r\) manually in polar mode: The polar area element already includes \(r\). Manually adding another \(r\) changes the integral.
Confusing region area with surface area: The region area is the flat area in the input domain. Surface area of \(z=f(x,y)\) is a different calculation.
Expecting an exact symbolic answer: Midpoint sampling gives a numerical approximation. It does not find antiderivatives or simplify symbolic expressions.
Reversing lower and upper bounds: Lower bounds must be less than upper bounds. In custom mode, the upper function \(h(x)\) should be above the lower function \(g(x)\) over a positive-area part of the interval.
Using unsupported variables or notation: The function uses \(x\) and \(y\). Decimal values should use a decimal point, not a decimal comma.
Assuming the sampled value range is exact: The displayed minimum and maximum are based on sampled points only. A function may reach a higher or lower value between sample points.
Use numerical double integration when you need to estimate accumulation over a two-dimensional region and an exact symbolic calculation is inconvenient, unnecessary, or hard to obtain.
It is especially helpful for:
For formal coursework, engineering, physics, or other high-stakes applications, use numerical estimates as part of a broader checking process. Compare with exact methods, error estimates, or appropriate professional tools when accuracy requirements matter.
This calculator uses adaptive composite midpoint refinement with Richardson extrapolation. It does not compute exact symbolic integrals, and its reported numerical error is an internal estimate rather than a guaranteed mathematical error bound.
The entered sample density is the starting grid. The calculator doubles it automatically, up to \(480\) samples per dimension, and suppresses the main result if consecutive extrapolated estimates do not converge. Functions with sharp spikes, discontinuities, singularities, rapid oscillation, or narrow important features can still evade finite sampling and require a specialized method.
The function must evaluate to finite numbers at the sampled points. Expressions that produce non-finite values such as undefined results or infinity are not treated as improper integrals.
Rectangular and polar bounds are constant bounds. Custom mode supports regions of the form:
It does not represent every possible irregular region, multiple disconnected \(y\)-intervals for the same \(x\), or regions better described with \(x\) as a function of \(y\).
In custom mode, the upper curve must remain at or above the lower curve. The calculator checks this at the interval endpoints and at its finite set of sampled \(x\)-positions; any representably distinct finite upper value below the lower value at a checked position is rejected instead of silently clipped or treated as an oriented integral. A narrow crossing between checked positions can evade any finite sampling grid, so analyze unusual or closely spaced bounds independently.
Polar radius lower bounds must be nonnegative, and \(\theta\) values are interpreted in radians.
Starting sample density must be a whole number from \(12\) through \(120\). If the field is left blank, the calculator starts at \(48\). Invalid, fractional, or out-of-range values are rejected rather than silently changed.
Small nonzero results are preserved and may be shown in scientific notation. The calculator displays \(0\) only when the computed floating-point result is zero. Inputs whose area, samples, result, or midpoint coordinates exceed the supported floating-point resolution are rejected explicitly; shift or rescale large-offset bounds before retrying.
Graph previews are visual aids. They help you inspect the region and surface, but they are not a substitute for checking the bounds, function, and numerical accuracy.
The function field supports \(x\), \(y\), common constants such as \(\pi\) and \(e\), and common functions such as trigonometric, logarithmic, exponential, absolute-value, square-root, minimum, and maximum functions.
No. It gives a midpoint-rule numerical approximation. For exact symbolic work, you still need algebraic integration methods, a computer algebra system, or a formal solution process.
The function field is based on Cartesian variables. In polar mode, the calculator substitutes \(x=r\cos(\theta)\) and \(y=r\sin(\theta)\) when it samples the function.
No, not when \(r\) is only the polar area factor. Polar mode already multiplies by \(r\) as part of \(dA=r\,dr\,d\theta\). Only include an extra factor if the actual function you want to integrate contains that factor for a separate mathematical reason.
The average value is the double integral divided by the region area. It is the constant function value that would produce the same total accumulation over the same region.
A double integral is signed. Negative function values subtract from the total, so positive and negative regions can cancel. A near-zero result does not always mean the function is zero everywhere.
Not necessarily. It shows the minimum and maximum values found among the sampled points. The true extrema could occur between sample points or on a boundary that the midpoint grid does not sample directly.
Books and Open Textbooks
Online Course Notes