Multivariable calculus

Double Integral of sin^2 x cos^2 y Over a Square

The double integral of sin(x) squared times cos(y) squared over the square with x and y each from 0 to pi equals pi squared over 4, about 2.4674. The integrand separates, and each single integral of a squared trig function over 0 to pi equals pi/2.

f(x,y)=sin2xcos2yf(x,y) = \sin^{2}x\,\cos^{2}y
π24\dfrac{\pi^{2}}{4}

Numerically 2.467401, confirmed by quadrature on every build.

Separate, then kill each square with a half-angle identity

The integrand is a product of a function of xx alone and a function of yy alone, and the region is a rectangle, so the double integral splits into two independent single integrals.

[0,π]2sin2xcos2ydA=(0πsin2xdx)(0πcos2ydy)\iint_{[0,\pi]^{2}} \sin^{2}x\,\cos^{2}y\,dA = \left(\int_{0}^{\pi}\sin^{2}x\,dx\right)\left(\int_{0}^{\pi}\cos^{2}y\,dy\right)

Neither square has an obvious antiderivative, so lower the power with the half-angle identities sin2x=1cos2x2\sin^{2}x = \frac{1-\cos 2x}{2} and cos2y=1+cos2y2\cos^{2}y = \frac{1+\cos 2y}{2}.

0πsin2xdx=0π1cos2x2dx=[x2sin2x4]0π=π2\int_{0}^{\pi}\sin^{2}x\,dx = \int_{0}^{\pi}\frac{1-\cos 2x}{2}\,dx = \left[\frac{x}{2} - \frac{\sin 2x}{4}\right]_{0}^{\pi} = \frac{\pi}{2}

The cosine version works the same way and also gives π/2\pi/2, since sin2y\sin 2y vanishes at both ends. Multiplying gives π2π2=π242.4674\frac{\pi}{2}\cdot\frac{\pi}{2} = \frac{\pi^{2}}{4} \approx 2.4674.

The mistake: applying the power rule to sin^2 x

The most common wrong answer here comes from treating sin2x\sin^{2}x as if it were u2u^{2} with du=dxdu = dx, giving an antiderivative of sin3x3\frac{\sin^{3}x}{3}.

ddx(sin3x3)=sin2xcosxsin2x\frac{d}{dx}\left(\frac{\sin^{3}x}{3}\right) = \sin^{2}x\cos x \neq \sin^{2}x

The stray cosx\cos x is the chain-rule factor that is missing from the integrand. Worse, that fake antiderivative evaluates to 00 at both x=0x = 0 and x=πx = \pi, so it reports the whole integral as 00 rather than π/2\pi/2.

A zero answer should have set off alarms on its own: sin2x\sin^{2}x is non-negative and not identically zero, so its integral over an interval of positive length must be strictly positive.

Why both squares average to one half

There is a faster route worth knowing. On [0,π][0,\pi] both sin2\sin^{2} and cos2\cos^{2} have average value 12\frac{1}{2}: they add to 11 at every point, and each is the other shifted by π/2\pi/2, which changes nothing across a full period of length π\pi. Equal averages summing to 11 must each be 12\frac{1}{2}.

1π0πsin2xdx=120πsin2xdx=π2\frac{1}{\pi}\int_{0}^{\pi}\sin^{2}x\,dx = \frac{1}{2} \quad \Longrightarrow \quad \int_{0}^{\pi}\sin^{2}x\,dx = \frac{\pi}{2}

So the double integral is 1212\frac{1}{2}\cdot\frac{1}{2} times the base area π2\pi^{2}, which is π24\frac{\pi^{2}}{4}. The averaging argument does need the right interval. Since absin2xdx=ba2[sin2x4]ab\int_{a}^{b}\sin^{2}x\,dx = \frac{b-a}{2} - \left[\frac{\sin 2x}{4}\right]_{a}^{b}, the average is exactly 12\frac{1}{2} only when sin2a=sin2b\sin 2a = \sin 2b. Every interval of length π\pi qualifies, and so does [0,π/2][0,\pi/2], but over [0,1][0,1] the leftover sin240.227\frac{\sin 2}{4} \approx 0.227 pulls the average down to 0.2730.273.

Frequently asked questions

Does the answer change if the integrand is cos^2 x sin^2 y instead?

No. Each factor still integrates to π/2\pi/2 over [0,π][0,\pi], so the product is again π2/4\pi^2/4. The symmetry comes from integrating over a full half period in both variables.

Can I use sin^2 + cos^2 = 1 to simplify this integrand?

Not here. That identity applies to sin2θ+cos2θ\sin^{2}\theta + \cos^{2}\theta for the same angle. In sin2xcos2y\sin^{2}x\,\cos^{2}y the angles differ and the terms are multiplied, so the identity does not touch it.