Calculus, Linear Algebra & Discrete Math Multivariable & Vector Calculus Fubini's theorem for iterated integrals; polar area element r dr dθ

Double Integral Calculator (Iterated & Polar)

A double integral adds up a quantity over a two-dimensional region, and Fubini's theorem lets you do it as two ordinary integrals one after the other. This calculator evaluates the inner integral for each value of the outer variable and then integrates those slice values, using adaptive quadrature at both levels. Inner limits may be expressions in the outer variable, so general regions bounded by curves work as easily as rectangles. Polar mode supplies the r in r dr dθ for you.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
IntegrandA function of both variables. In Cartesian mode use x and y; in polar mode use r and theta. Use ^ for powers, * for multiplication (2*x, 2x and a plain space all work, so x sin(x) is read as a product), and the function names sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), sqrt, cbrt and abs. The constants pi and e are recognised.x*y
Coordinate systemPolar mode multiplies the integrand by r automatically, integrating r on the inside and theta on the outside.Cartesian (x, y)
Order of integrationCartesian mode only; polar mode always integrates r inside and theta outside.dy dx — y inside, x outside
Outer variable fromLower limit of the outer integral. It must be a constant.0
Outer variable toUpper limit of the outer integral, also a constant.2
Inner lower limitA constant or an expression in the outer variable, such as 0 or x^2.0
Inner upper limitA constant or an expression in the outer variable, such as 3 or sqrt(x).3

It returns

  • Double integral — The accumulated value of the integrand over the whole region.
  • Area of the region — What the same integral gives with an integrand of 1.
  • Mean value of the integrand
  • Inner integral at the middle slice
  • Estimated error

The formula

RfdA=ab[g1(x)g2(x)f(x,y)dy]dx
RfdA=frdrdθ

In plain text: ∬ f dA = ∫ from a to b [ ∫ from g₁(x) to g₂(x) f(x, y) dy ] dx

  • RThe region of integration in the plane (units of x times units of y)
  • g₁, g₂Lower and upper boundaries of the region, as functions of the outer variable (units of the inner variable)
  • a, bConstant limits on the outer variable (units of the outer variable)
  • dAArea element: dy dx in Cartesian coordinates, r dr dθ in polar (area)

Fubini's theorem guarantees that the iterated integral equals the double integral, and that the order may be swapped, whenever the integrand is continuous on a suitably nice region.

Updated Category Multivariable & Vector Calculus Verified against published test cases Reading time 10 min

Two ordinary integrals, one after the other

A double integral accumulates a quantity over a region of the plane rather than over an interval of the line. Slice the region into thin strips, integrate along each strip, and then integrate the strip totals across the region. That two-stage procedure is the iterated integral, and Fubini's theorem is the guarantee that it gives the same answer as the double integral it stands for.

The inner integral runs first, with the outer variable held fixed. Its limits may therefore depend on that outer variable — which is exactly how a region bounded by curves is described. The outer limits must be constants, because by the time you reach them nothing is left to depend on.

This calculator makes that structure visible. The table lists one row per slice: the value of the outer variable, the two inner limits there, and the value of the inner integral. The chart plots the last column against the first, and the double integral is the area under that curve. If your setup is wrong, the mistake almost always shows up as a strange-looking slice column long before it shows up in the final number.

What the integral means depends on the integrand. With f = 1 it is the area of the region. With f a density it is a mass. With f a height it is a volume under a surface. With f a probability density it is a probability.

Setting up the limits, which is the whole difficulty

Rectangles are the easy case. Both inner limits are constants, both outer limits are constants, and the order does not matter. If the integrand also factors as a function of x times a function of y, the double integral factors into a product of two single integrals — which is why the default example, ∬xy over a 2 by 3 rectangle, comes out as 2 × 4.5 = 9.

General regions need the boundary as a function. For the triangle under the line y = x between x = 0 and x = 1, the inner limits are 0 and x. Enter x in the inner upper limit box, and the calculator evaluates it afresh for every slice.

Swapping the order changes the limits completely. The same triangle described with x inside runs from x = y to x = 1, with y from 0 to 1. Both descriptions give 0.5, but neither set of limits is a rearrangement of the other — you have to re-read the geometry. Choosing the easier order is the main skill in this topic, and sometimes an integral that is impossible in one order is elementary in the other.

Polar coordinates suit circular regions. A disc of radius 2 is 0 ≤ r ≤ 2, 0 ≤ θ ≤ 2π — two constant limits, where the Cartesian description would need ±sqrt(4 − x²). The price is the Jacobian factor r in the area element, which this calculator inserts for you. Enter your integrand in terms of r and theta and do not write the extra r yourself.

Worked example: ∬ (x + y) over the triangle 0 ≤ y ≤ x, 0 ≤ x ≤ 1

Inner integral first, holding x fixed and integrating in y from 0 to x:

  1. An antiderivative in y is xy + y²/2.
  2. At the upper limit y = x: x·x + x²/2 = x² + x²/2 = 1.5x².
  3. At the lower limit y = 0: zero.
  4. So the inner integral is 1.5x², and that is the slice value the table reports at each x.

Outer integral second, integrating the slice values from x = 0 to x = 1:

  1. ∫ from 0 to 1 of 1.5x² dx = [0.5x³] from 0 to 1 = 0.5.

The region's area is ∫ from 0 to 1 of (x − 0) dx = 0.5, so the mean value of x + y over the triangle is 0.5/0.5 = 1. That is a satisfying check: the centroid of this triangle is at (2/3, 1/3), where x + y = 1, and for a linear integrand the mean value equals the integrand at the centroid.

Now the same region in the other order. With x inside, the strip at height y runs from x = y to x = 1, and y runs from 0 to 1. The inner integral is [x²/2 + xy] from y to 1, which is 0.5 + y − y²/2 − y² = 0.5 + y − 1.5y². Integrating that from 0 to 1 gives 0.5 + 0.5 − 0.5 = 0.5. Same answer, entirely different intermediate expressions.

And a polar check. A disc of radius 2 with integrand 1 gives ∫ from 0 to 2π ∫ from 0 to 2 of r dr dθ = ∫ from 0 to 2π of 2 dθ = 4π = 12.5663706, which is πr² with r = 2, as it must be.

How to read the outputs

The area is a free consistency check. It is computed by the same machinery with an integrand of 1, so if the area does not match the region you had in mind, your limits are wrong and the main value is wrong too. Checking it takes one glance and catches most setup errors.

The mean value is the integral divided by the area. It answers the question the raw integral does not: is this a large accumulation because the integrand is large, or because the region is large? For a density it is the average density; for a height it is the average height of the surface.

The middle-slice value tells you whether the inner integral is behaving. If it is blank while the outer integral returns something, the region has a slice where the integrand is undefined, and the outer quadrature stepped around it rather than through it.

The error estimate compares two runs. Nested adaptive quadrature is harder to control than the one-dimensional kind, because the inner integral is itself an approximation and the outer routine sees its noise. Rerunning at a looser tolerance and comparing gives an honest read on how many digits survived.

A zero area with a zero integral is not a failure. If the two inner limits coincide, the region is degenerate and both are correctly zero, which is one of the test vectors on this page.

Standard double integrals with exact values

Each row is a setup you can type into this calculator directly, with the exact value for comparison.
IntegrandRegionExact valueDecimal
10 ≤ x ≤ 1, 0 ≤ y ≤ 111.0000000
x·y0 ≤ x ≤ 2, 0 ≤ y ≤ 399.0000000
x²·y0 ≤ x ≤ 2, 0 ≤ y ≤ 31212.000000
x + y0 ≤ x ≤ 1, 0 ≤ y ≤ x1/20.5000000
x·y0 ≤ x ≤ 1, 0 ≤ y ≤ x1/80.1250000
1 (polar)0 ≤ r ≤ 2, 0 ≤ θ ≤ 2π12.566371
r (polar)0 ≤ r ≤ 1, 0 ≤ θ ≤ 2π2π/32.0943951
e^(−r²) (polar)0 ≤ r ≤ 3, 0 ≤ θ ≤ 2ππ(1 − e⁻⁹)3.1412050

The last row is the finite-radius version of the Gaussian integral. Letting the radius grow gives π, and taking its square root is the classic derivation of the normalising constant of the normal distribution.

Where double integrals go wrong

  • Putting a variable in the outer limits. The outer limits must be constants. If your setup needs the outer limit to depend on something, you have the order the wrong way round.
  • Forgetting the r in polar coordinates. The area element is r dr dθ, not dr dθ. Omitting it makes the area of a disc come out as 2πR instead of πR². This calculator supplies the factor, so do not enter it a second time.
  • Swapping the order without redrawing the region. New order, new limits. The limits for dy dx are almost never the same expressions with the letters exchanged.
  • Using the wrong boundary as the upper limit. If the lower limit exceeds the upper one on some slices, those slices contribute negatively and the total is wrong. Check the two inner-limit columns in the table.
  • Integrating across a singularity. Nested quadrature will return a number for a divergent integral if the singularity falls between sample points. Check the error estimate and the slice column.
  • Assuming a rectangular region factors. The integral splits into a product only when the integrand itself factors as g(x)·h(y). x + y over a rectangle does not factor, even though the region does.

Where this fits among the multivariable tools

Triple integrals are the same idea with one more layer. Integrate over the innermost variable, then the middle one, then the outermost, with limits that may depend on the variables still to come. Everything about setting up limits transfers directly.

Changing variables generalises the polar factor. The r in r dr dθ is the determinant of the Jacobian matrix of the polar transformation. Any substitution in two dimensions carries the absolute value of its Jacobian determinant, which the Jacobian calculator computes for an arbitrary map.

The integrand often comes from a derivative. Surface area, flux and moment integrals all build their integrands from partial derivatives, which the partial derivative calculator supplies, and from the gradient, available in the gradient vector calculator.

The vector calculus theorems turn double integrals into line integrals and vice versa. Green's theorem relates a double integral of a combination of partial derivatives over a region to a line integral around its boundary, and the divergence theorem does the analogous thing in three dimensions; the divergence calculator and the curl calculator compute the operators those theorems use.

For one-dimensional problems, use the definite integral calculator, which is the same adaptive quadrature applied once rather than twice.

Frequently asked questions

Why must the outer limits be constants?

Because the outer integral is the last one performed, and by then every variable has been integrated away. If the outer limit depended on the inner variable there would be nothing left for it to refer to. When your region seems to need that, you have chosen the order the wrong way round — swap it and re-derive the limits from the geometry.

Do I need to include the r in polar mode?

No. The calculator multiplies your integrand by r automatically, because the polar area element is r dr dθ. Enter the integrand as the function you actually want to integrate, in terms of r and theta. Entering an extra r yourself would compute a different integral.

How do I set up a general region rather than a rectangle?

Put the boundary curves in the inner limit boxes as expressions in the outer variable. For the region under y = x² from x = 0 to x = 2, enter 0 as the inner lower limit and x^2 as the inner upper limit, with outer limits 0 and 2. The calculator re-evaluates both boundaries for every slice.

Does the order of integration change the answer?

Not the value, provided the integrand is continuous on the region — that is Fubini's theorem. It changes the limits completely and it can change the difficulty enormously. Some integrals are elementary in one order and impossible in the other, which is why swapping the order is a standard technique.

How do I get the area of a region?

Enter 1 as the integrand, or simply read the area output, which the calculator computes that way regardless of what you typed. Comparing that number against the region you intended is the fastest check that your limits describe the right shape.

How accurate is nested adaptive quadrature?

Typically eight or more correct digits on a smooth integrand over a smooth region, but less reliable than the one-dimensional case: the outer routine sees the inner result as a slightly noisy function, and that noise limits how far the outer refinement can go. The error estimate reruns the whole calculation at a looser tolerance so you can see how many digits actually survived.

Can it do triple integrals?

No, this calculator handles two levels. For a triple integral, evaluate the innermost integral by hand or symbolically to reduce the problem to two levels, then use this page. Alternatively, exploit symmetry: many triple integrals over solids of revolution reduce to a double integral in cylindrical coordinates.

What does the mean value output mean?

It is the double integral divided by the area of the region — the constant value that would produce the same total. For a density it is the average density over the region, and for a linear integrand it equals the integrand evaluated at the centroid, which makes it a useful sanity check on simple examples.

References

  • Calculus, 8th edition (multiple integrals, chapter 15) — James Stewart, Cengage Learning
  • Thomas' Calculus, 14th edition (multiple integrals and change of variables) — Hass, Heil & Weir, Pearson
  • Numerical Recipes: The Art of Scientific Computing, 3rd edition (multidimensional quadrature) — Press, Teukolsky, Vetterling & Flannery, Cambridge University Press