Multivariable calculus

Double Integral of (x + y)^2 Over the Unit Square

The double integral of (x + y) squared over the unit square, with x and y each running from 0 to 1, equals 7/6, about 1.1667. Integrating in y first gives one third of (x + 1) cubed minus x cubed, and integrating that from 0 to 1 gives 7/6.

f(x,y)=(x+y)2f(x,y) = (x + y)^2
0101(x+y)2dydx=76\int_{0}^{1}\int_{0}^{1} (x+y)^2\,dy\,dx = \frac{7}{6}

Numerically 1.166667, confirmed by quadrature on every build.

The inner integral is a shift, so no extra factor appears

Hold xx fixed and substitute u=x+yu = x + y. Because xx is frozen, uy=1\frac{\partial u}{\partial y} = 1 and du=dydu = dy exactly, with no constant to divide by.

01(x+y)2dy=[(x+y)33]y=0y=1=(x+1)3x33\int_{0}^{1} (x+y)^2\,dy = \left[\frac{(x+y)^3}{3}\right]_{y=0}^{y=1} = \frac{(x+1)^3 - x^3}{3}

Both endpoints matter. The x3x^3 comes from the lower limit y=0y = 0, and dropping it is the single most common slip on this problem.

01(x+1)3x33dx=13[(x+1)44x44]01=13(1614104)=76\int_{0}^{1} \frac{(x+1)^3 - x^3}{3}\,dx = \frac{1}{3}\left[\frac{(x+1)^4}{4} - \frac{x^4}{4}\right]_{0}^{1} = \frac{1}{3}\left(\frac{16 - 1}{4} - \frac{1 - 0}{4}\right) = \frac{7}{6}

Expanding first is the same work in a different order

Since (x+y)2=x2+2xy+y2(x+y)^2 = x^2 + 2xy + y^2, one substitution becomes three monomials, and each of the three factors over the square.

Rx2dA+2RxydA+Ry2dA=13+214+13=76\iint_R x^2\,dA + 2\iint_R xy\,dA + \iint_R y^2\,dA = \frac{1}{3} + 2\cdot\frac{1}{4} + \frac{1}{3} = \frac{7}{6}

Agreement between the two routes is the cheapest check available on your algebra, because past the setup they share no steps at all.

The mistake: squaring the integral instead of integrating the square

Computing R(x+y)dA=1\iint_R (x+y)\,dA = 1 and then squaring gives 1, not 76\frac{7}{6}. Averaging and then squaring is never larger than squaring and then averaging, and it is strictly smaller unless the function is constant. The gap 761=16\frac{7}{6} - 1 = \frac{1}{6} is exactly the variance of x+yx + y on the square.

  • (x+y)2dy=(x+y)33\int (x+y)^2\,dy = \frac{(x+y)^3}{3} needs y(x+y)=1\frac{\partial}{\partial y}(x+y) = 1. With (x+2y)2(x+2y)^2 the antiderivative is (x+2y)36\frac{(x+2y)^3}{6} instead.
  • Evaluate at both limits: (x+1)33\frac{(x+1)^3}{3} alone is missing the x33-\frac{x^3}{3} from y=0y = 0, and it gives 54\frac{5}{4} rather than 76\frac{7}{6}.
  • Expanding is never wrong here, only slower, so use it when the substitution feels shaky.

Sanity check the size: on the unit square (x+y)2(x+y)^2 runs from 0 to 4, and it exceeds 1 on exactly half the square, the half above the diagonal x+y=1x + y = 1. So an average just above 1 is right, and anything near 4 is not.

Frequently asked questions

Why is there no factor of one half from the substitution?

Because u=x+yu = x + y has uy=1\frac{\partial u}{\partial y} = 1 while xx is held fixed, so du=dydu = dy. With (x+2y)2(x + 2y)^2 the derivative would be 2, and the antiderivative in yy would be (x+2y)36\frac{(x+2y)^3}{6}.

What is the value over the square from -1 to 1 in both variables?

It is 83\frac{8}{3}. Expanding, x2dA=43\iint x^2\,dA = \frac{4}{3} and y2dA=43\iint y^2\,dA = \frac{4}{3}, while the cross term 2xydA2\iint xy\,dA vanishes because xx is odd on [1,1][-1,1].