The double integral of sin(x + y) over the square from 0 to pi/2 in both x and y equals 2. Integrating in y first gives cos x plus sin x, and integrating that from 0 to pi/2 gives 1 plus 1. The sum inside the sine means the integrand is not a function of x times a function of y.
f(x,y)=sin(x+y)
∫0π/2∫0π/2sin(x+y)dydx=2
Numerically 2.000000, confirmed by quadrature on every build.
Integrate in y, then in x
With x frozen, ∂y∂(x+y)=1, so the antiderivative is just −cos(x+y) with no correcting factor.
Why it does not factor, and the identity that rescues it
There is no way to write sin(x+y) as one function of x times one function of y, so the product shortcut is off the table. The angle sum identity does the next best thing: it turns the integrand into a sum of two products, and each of those splits.
sin(x+y)=sinxcosy+cosxsiny
∬RsinxcosydA+∬RcosxsinydA=(1)(1)+(1)(1)=2
That also explains the size. Pointwise sin(x+y) exceeds sinxcosy on this square by the non-negative amount cosxsiny, and that excess contributes exactly 1.
The mistake: treating sin(x + y) as sin x + sin y
Replacing the integrand with sinx+siny gives 2π+2π=π≈3.1416 instead of 2, because each term picks up the length 2π of the other side. The sine of a sum is never the sum of the sines.
∫sin(x+y)dy=−cos(x+y), since the inner derivative is 1.
∫sin(x+3y)dy=−3cos(x+3y), since the inner derivative is 3.
Differentiating your antiderivative back is a five second check, and it catches both slips.
One more size check: the integrand never exceeds 1 and the square has area 4π2≈2.467, so the answer must be at most about 2.47. The value 2 fits, and π does not.
Frequently asked questions
Why is this bigger than the integral of sin x cos y on the same square?
Because sin(x+y)=sinxcosy+cosxsiny, and on this square the extra term cosxsiny is non-negative. It contributes exactly 1, taking the total from 1 to 2.
What is the value over the square from 0 to pi in both variables?
It is 0. The inner integral becomes [−cos(x+y)]0π=2cosx, and ∫0π2cosxdx=0: the surface sits as far below the plane as above it there.