Multivariable calculus

Double Integral of sin x cos y Over a Square

The double integral of sin(x) times cos(y) over the square where x runs from 0 to pi/2 and y runs from 0 to pi/2 equals 1. The integrand is a product of a function of x alone and a function of y alone, so over a rectangle it splits into two single integrals, each equal to 1.

f(x,y)=sinxcosyf(x,y) = \sin x \cos y
11

Numerically 1.000000, confirmed by quadrature on every build.

Integrate in y first, then in x

Fubini's theorem says you may do the two integrations one after the other, in either order. Hold xx fixed and run the inner integral in yy.

0π/2sinxcosydy=sinx0π/2cosydy=sinx[siny]0π/2=sinx\int_{0}^{\pi/2} \sin x \cos y\,dy = \sin x \int_{0}^{\pi/2} \cos y\,dy = \sin x\Big[\sin y\Big]_{0}^{\pi/2} = \sin x

The factor sinx\sin x came out front because it is a constant as far as yy is concerned. That leaves a one-variable integral in xx.

0π/2sinxdx=[cosx]0π/2=0+1=1\int_{0}^{\pi/2} \sin x\,dx = \Big[-\cos x\Big]_{0}^{\pi/2} = 0 + 1 = 1
RsinxcosydA=1,R=[0,π2]×[0,π2]\iint_{R} \sin x \cos y\,dA = 1, \qquad R = \left[0,\tfrac{\pi}{2}\right] \times \left[0,\tfrac{\pi}{2}\right]

The separable shortcut and its two conditions

When the integrand factors as g(x)h(y)g(x)h(y) and the region is a rectangle with constant bounds, the double integral is just the product of two single integrals.

[a,b]×[c,d]g(x)h(y)dA=(abg(x)dx)(cdh(y)dy)\iint_{[a,b]\times[c,d]} g(x)h(y)\,dA = \left(\int_{a}^{b} g(x)\,dx\right)\left(\int_{c}^{d} h(y)\,dy\right)

Both factors here integrate to 11 over [0,π/2][0,\pi/2], so the answer is 11=11 \cdot 1 = 1. Use the shortcut only when both conditions hold.

  • The integrand must be a genuine product. A sum like sinx+cosy\sin x + \cos y does not split this way, and neither does a composition like sin(xy)\sin(xy).
  • Every bound must be a constant. The instant one bound involves the other variable, the two integrals are no longer independent.

The mistake: reusing the product split on a non-rectangle

Once the shortcut works here, students reach for it whenever they see sinxcosy\sin x \cos y again, even when the region has changed. Take the triangle 0yxπ/20 \le y \le x \le \pi/2 instead of the square.

0π/2 ⁣ ⁣0xsinxcosydydx=0π/2sin2xdx=π40.7854\int_{0}^{\pi/2}\!\!\int_{0}^{x} \sin x \cos y\,dy\,dx = \int_{0}^{\pi/2} \sin^2 x\,dx = \frac{\pi}{4} \approx 0.7854

The product split would have predicted 11 again, overstating the true value by more than a quarter, because the inner integral now stops at y=xy = x and therefore depends on xx. The moment a bound carries the other variable, you must finish the inner integral and carry its answer into the outer one.

Frequently asked questions

Does the order of integration change the answer here?

No. The integrand is continuous on a closed rectangle, so Fubini's theorem guarantees both orders give 11. Integrating in xx first leaves cosy\cos y, which integrates to 11 over [0,π/2][0,\pi/2].

Why is the answer positive when sine and cosine both change sign?

Neither one changes sign on this region. Both sinx\sin x and cosy\cos y are non-negative on [0,π/2][0,\pi/2], so the surface stays above the xyxy plane and the integral is a true volume.