Multivariable calculus

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

The double integral of sin(x + y) over the square where x and y each run from 0 to pi/2 equals exactly 2. The inner integral in y gives sin(x) + cos(x), and integrating that over 0 to pi/2 gives 1 + 1 = 2.

f(x,y)=sin(x+y)f(x,y) = \sin(x+y)
22

Numerically 2.000000, confirmed by quadrature on every build.

Treat x as a constant shift inside the sine

During the inner integration xx is frozen, so sin(x+y)\sin(x+y) is a sine wave in yy shifted by the constant xx. Its antiderivative in yy is cos(x+y)-\cos(x+y), with no chain-rule factor because the coefficient on yy is 11.

0π/2sin(x+y)dy=[cos(x+y)]y=0y=π/2=cosxcos ⁣(x+π2)\int_{0}^{\pi/2}\sin(x+y)\,dy = \Big[-\cos(x+y)\Big]_{y=0}^{y=\pi/2} = \cos x - \cos\!\left(x + \frac{\pi}{2}\right)

Now use cos ⁣(x+π2)=sinx\cos\!\left(x + \frac{\pi}{2}\right) = -\sin x to clean it up.

=cosx+sinx= \cos x + \sin x
0π/2(cosx+sinx)dx=[sinxcosx]0π/2=(10)(01)=2\int_{0}^{\pi/2}\left(\cos x + \sin x\right)\,dx = \Big[\sin x - \cos x\Big]_{0}^{\pi/2} = (1 - 0) - (0 - 1) = 2

The mistake: distributing the sine over the sum

The wrong move is to write sin(x+y)=sinx+siny\sin(x+y) = \sin x + \sin y. Sine is not additive, and the correct identity is the angle addition formula.

sin(x+y)=sinxcosy+cosxsiny\sin(x+y) = \sin x\cos y + \cos x\sin y

Integrating the bogus sinx+siny\sin x + \sin y over the same square gives π21+1π2=π3.1416\frac{\pi}{2}\cdot 1 + 1\cdot\frac{\pi}{2} = \pi \approx 3.1416, against the true 22. That is an error of about 1.141.14, produced entirely by the false identity.

The angle addition formula is also a legitimate second route to the answer. Expanding and integrating term by term over the square gives 11+11=21\cdot 1 + 1\cdot 1 = 2, which is a useful independent check on the first method.

A sanity check on the size of the answer

On this square x+yx+y ranges from 00 to π\pi, so sin(x+y)\sin(x+y) stays between 00 and 11 and never goes negative. The volume must therefore be positive and no larger than the base area.

  • Base area: (π2)22.467\left(\frac{\pi}{2}\right)^{2} \approx 2.467.
  • Maximum height: 11, attained along the anti-diagonal x+y=π/2x + y = \pi/2.
  • So the answer must lie in (0,2.467)(0, 2.467), and 22 does.

If the square were extended to [0,π]2[0,\pi]^2 the integrand would go negative on part of the region and the integral would be signed volume, not volume. Bounds decide which of the two you are computing.

Frequently asked questions

Why is there no 1/2 or other constant from the chain rule?

The chain-rule factor is the derivative of the inside with respect to the integration variable. Here y(x+y)=1\frac{\partial}{\partial y}(x+y) = 1, so no factor appears. For sin(2y)\sin(2y) you would need a 1/21/2.

Does swapping the order of integration change anything?

No. The integrand is symmetric in xx and yy and the region is a square, so integrating in xx first produces the identical inner answer siny+cosy\sin y + \cos y and the same total of 22.