Multivariable calculus

Double Integral of y/(1 + x^2) Over [0,1] by [0,2]

The double integral of y divided by 1 plus x squared, over x from 0 to 1 and y from 0 to 2, equals pi/2, about 1.5708. The integrand factors, so the answer is the integral of 1 over 1 plus x squared from 0 to 1, which is pi/4, times the integral of y from 0 to 2, which is 2.

f(x,y)=y1+x2f(x,y) = \frac{y}{1 + x^2}
0102y1+x2dydx=π2\int_{0}^{1}\int_{0}^{2} \frac{y}{1+x^2}\,dy\,dx = \frac{\pi}{2}

Numerically 1.570796, confirmed by quadrature on every build.

Factor, then recognise the arctangent

The integrand is 11+x2\frac{1}{1+x^2} times yy, one factor per variable, and both limits are constants. That is the separable case.

0102y1+x2dydx=(0111+x2dx)(02ydy)\int_{0}^{1}\int_{0}^{2} \frac{y}{1+x^2}\,dy\,dx = \left(\int_{0}^{1} \frac{1}{1+x^2}\,dx\right)\left(\int_{0}^{2} y\,dy\right)
=[arctanx]01[y22]02=π42=π2= \left[\arctan x\right]_{0}^{1}\left[\frac{y^2}{2}\right]_{0}^{2} = \frac{\pi}{4}\cdot 2 = \frac{\pi}{2}

The π4\frac{\pi}{4} is arctan1\arctan 1, the angle whose tangent is 1. Every π\pi in the final answer traces back to that single evaluation.

The same thing one layer at a time

If you would rather not use the shortcut, freeze xx and note that 11+x2\frac{1}{1+x^2} is then a constant multiplier.

02y1+x2dy=11+x2[y22]02=21+x2\int_{0}^{2} \frac{y}{1+x^2}\,dy = \frac{1}{1+x^2}\left[\frac{y^2}{2}\right]_{0}^{2} = \frac{2}{1+x^2}
0121+x2dx=2[arctanx]01=π2\int_{0}^{1} \frac{2}{1+x^2}\,dx = 2\left[\arctan x\right]_{0}^{1} = \frac{\pi}{2}

A size check before you trust it: on this rectangle the integrand runs from 0 to 2 and the area is 2, so the answer has to lie between 0 and 4. The value 1.5708 passes.

The mistake: the logarithm that is not there

Writing 11+x2dx=ln(1+x2)\int \frac{1}{1+x^2}\,dx = \ln\left(1+x^2\right) is the standard wrong turn. The substitution u=1+x2u = 1 + x^2 needs du=2xdxdu = 2x\,dx, and there is no xx in this numerator to supply it.

  • 11+x2dx=arctanx\int \frac{1}{1+x^2}\,dx = \arctan x, an inverse trigonometric function.
  • x1+x2dx=12ln(1+x2)\int \frac{x}{1+x^2}\,dx = \frac{1}{2}\ln\left(1+x^2\right), a logarithm, and note the 12\frac{1}{2}.
  • One factor of xx in the numerator is the whole difference between the two.

That extra xx changes the answer, not just its form. With integrand xy1+x2\frac{xy}{1+x^2} over the same rectangle you get (ln22)(2)=ln20.693\left(\frac{\ln 2}{2}\right)(2) = \ln 2 \approx 0.693 rather than π21.571\frac{\pi}{2} \approx 1.571.

Frequently asked questions

Why does the y integral not disturb the arctangent?

Because the two variables live in separate factors. Integrating in yy multiplies 11+x2\frac{1}{1+x^2} by the number 02ydy=2\int_{0}^{2} y\,dy = 2, and a constant multiple passes straight through the xx integral.

What if the numerator were xy instead of y?

Then the xx integral becomes 01x1+x2dx=ln22\int_{0}^{1}\frac{x}{1+x^2}\,dx = \frac{\ln 2}{2}, and the double integral is ln20.693\ln 2 \approx 0.693. The single factor xx converts an arctangent into a logarithm.