Multivariable calculus

Double Integral of x^2 + y^2 Over [0,1] by [0,2]

The double integral of x squared plus y squared over the rectangle x from 0 to 1 and y from 0 to 2 equals 10/3, about 3.3333. Integrating in y first gives 2 x squared plus 8/3, and integrating that from x = 0 to x = 1 gives 2/3 plus 8/3, which is 10/3.

f(x,y)=x2+y2f(x,y) = x^2 + y^2
0102(x2+y2)dydx=103\int_{0}^{1}\int_{0}^{2} \left(x^2 + y^2\right)\,dy\,dx = \frac{10}{3}

Numerically 3.333333, confirmed by quadrature on every build.

The inner integral treats x as a number

Freeze xx and integrate in yy. The term x2x^2 contains no yy, so it behaves exactly as the number 7 would and integrates to x2yx^2 y.

02(x2+y2)dy=[x2y+y33]02=2x2+83\int_{0}^{2} \left(x^2 + y^2\right)\,dy = \left[x^2 y + \frac{y^3}{3}\right]_{0}^{2} = 2x^2 + \frac{8}{3}

Nothing there involves yy any more, which is the check that the inner step is complete. Finish in xx.

01(2x2+83)dx=[2x33+8x3]01=23+83=103\int_{0}^{1} \left(2x^2 + \frac{8}{3}\right)\,dx = \left[\frac{2x^3}{3} + \frac{8x}{3}\right]_{0}^{1} = \frac{2}{3} + \frac{8}{3} = \frac{10}{3}

A sum splits by linearity, but it does not factor

Linearity lets you break the integral into one piece per term, and each of those pieces does factor, because each is a function of one variable times the constant 1.

R(x2+y2)dA=(01x2dx)(021dy)+(011dx)(02y2dy)=23+83\iint_R \left(x^2 + y^2\right)\,dA = \left(\int_{0}^{1} x^2\,dx\right)\left(\int_{0}^{2} 1\,dy\right) + \left(\int_{0}^{1} 1\,dx\right)\left(\int_{0}^{2} y^2\,dy\right) = \frac{2}{3} + \frac{8}{3}

Those two constant integrals are the width and the height of the rectangle. They look like they do nothing, and skipping them is exactly how the wrong answer below appears.

The mistake: forgetting the length of the other side

The tempting wrong answer is 01x2dx+02y2dy=13+83=3\int_{0}^{1} x^2\,dx + \int_{0}^{2} y^2\,dy = \frac{1}{3} + \frac{8}{3} = 3. Each single integral sweeps only one direction, but the term x2x^2 still has to be summed across every yy from 0 to 2, which multiplies it by that length.

  • Rx2dA=132=23\iint_R x^2\,dA = \frac{1}{3}\cdot 2 = \frac{2}{3}: the xx integral times the yy width.
  • Ry2dA=183=83\iint_R y^2\,dA = 1 \cdot \frac{8}{3} = \frac{8}{3}: the yy integral times the xx width.
  • The missing factor is always the constant integral, so it is the one to write down first.

A size check will not rescue you here. The integrand runs from 0 at the origin to 1+4=51 + 4 = 5 at the far corner, so the wrong 3 and the right 103\frac{10}{3} are both perfectly plausible totals. Test the recipe instead. Feed it f=1f = 1, taking g(x)=1g(x) = 1 and h(y)=0h(y) = 0: it returns 011dx+020dy=1\int_{0}^{1} 1\,dx + \int_{0}^{2} 0\,dy = 1, while the integral of 1 over the rectangle is its area, 2. A rule that cannot find the area of a rectangle is not a rule.

Frequently asked questions

Why is the answer not just the sum of the two single integrals?

Because each term still has to be integrated over the other variable, which multiplies it by the length of that side. 01x2dx=13\int_{0}^{1} x^2\,dx = \frac{1}{3} becomes 23\frac{2}{3} over this rectangle, since the yy side has length 2.

What is the average value on the rectangle?

Divide by the area: 10/32=53\frac{10/3}{2} = \frac{5}{3}. The integrand equals 53\frac{5}{3} along the circle x2+y2=53x^2 + y^2 = \frac{5}{3}, which does cut through the rectangle, so the average is attained inside it.