Multivariable calculus

Double Integral of sin(x + y) Over a pi/2 Square

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)f(x,y) = \sin(x + y)
∫0π/2∫0π/2sin⁡(x+y) dy dx=2\int_{0}^{\pi/2}\int_{0}^{\pi/2} \sin(x+y)\,dy\,dx = 2

Numerically 2.000000, confirmed by quadrature on every build.

Integrate in y, then in x

With xx frozen, ∂∂y(x+y)=1\frac{\partial}{\partial y}(x+y) = 1, so the antiderivative is just −cos⁡(x+y)-\cos(x+y) with no correcting factor.

∫0π/2sin⁡(x+y) dy=[−cos⁡(x+y)]y=0y=π/2=cos⁡x−cos⁡(x+π2)=cos⁡x+sin⁡x\int_{0}^{\pi/2} \sin(x+y)\,dy = \left[-\cos(x+y)\right]_{y=0}^{y=\pi/2} = \cos x - \cos\left(x + \frac{\pi}{2}\right) = \cos x + \sin x

The last step uses cos⁡(x+π2)=−sin⁡x\cos\left(x + \frac{\pi}{2}\right) = -\sin x. Now the outer integral is a one-variable problem.

∫0π/2(cos⁡x+sin⁡x) dx=[sin⁡x−cos⁡x]0π/2=(1−0)−(0−1)=2\int_{0}^{\pi/2} \left(\cos x + \sin x\right)\,dx = \left[\sin x - \cos x\right]_{0}^{\pi/2} = (1 - 0) - (0 - 1) = 2

Why it does not factor, and the identity that rescues it

There is no way to write sin⁡(x+y)\sin(x+y) as one function of xx times one function of yy, 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)=sin⁡xcos⁡y+cos⁡xsin⁡y\sin(x+y) = \sin x \cos y + \cos x \sin y
∬Rsin⁡xcos⁡y dA+∬Rcos⁡xsin⁡y dA=(1)(1)+(1)(1)=2\iint_R \sin x \cos y\,dA + \iint_R \cos x \sin y\,dA = (1)(1) + (1)(1) = 2

That also explains the size. Pointwise sin⁡(x+y)\sin(x+y) exceeds sin⁡xcos⁡y\sin x \cos y on this square by the non-negative amount cos⁡xsin⁡y\cos x \sin y, and that excess contributes exactly 1.

The mistake: treating sin(x + y) as sin x + sin y

Replacing the integrand with sin⁡x+sin⁡y\sin x + \sin y gives π2+π2=π≈3.1416\frac{\pi}{2} + \frac{\pi}{2} = \pi \approx 3.1416 instead of 2, because each term picks up the length π2\frac{\pi}{2} of the other side. The sine of a sum is never the sum of the sines.

  • ∫sin⁡(x+y) dy=−cos⁡(x+y)\int \sin(x+y)\,dy = -\cos(x+y), since the inner derivative is 1.
  • ∫sin⁡(x+3y) dy=−cos⁡(x+3y)3\int \sin(x+3y)\,dy = -\frac{\cos(x+3y)}{3}, 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 π24≈2.467\frac{\pi^2}{4} \approx 2.467, so the answer must be at most about 2.47. The value 2 fits, and π\pi 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)=sin⁡xcos⁡y+cos⁡xsin⁡y\sin(x+y) = \sin x \cos y + \cos x \sin y, and on this square the extra term cos⁡xsin⁡y\cos x \sin y 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π=2cos⁡x\left[-\cos(x+y)\right]_{0}^{\pi} = 2\cos x, and ∫0π2cos⁡x dx=0\int_{0}^{\pi} 2\cos x\,dx = 0: the surface sits as far below the plane as above it there.