Multivariable calculus

Triple Integral of x/(1 + y^2) over a Box

The triple integral of x divided by 1 + y squared, over the box where x runs 0 to 2, y runs 0 to 1 and z runs 0 to 3, equals 3 pi over 2, about 4.712389. The x factor gives 2, the y factor is arctan(1) which is pi/4, and the z factor gives 3.

f(x,y,z)=x1+y2f(x,y,z) = \frac{x}{1 + y^2}
020103x1+y2dzdydx=3π2\int_0^2 \int_0^1 \int_0^3 \frac{x}{1 + y^2} \,dz\,dy\,dx = \frac{3\pi}{2}

Numerically 4.712389, confirmed by quadrature on every build.

The variable that is missing does the least work

No zz appears in the integrand, so the inner integral in zz just multiplies by the length of that edge. That is the fastest stage on the page and it is easy to skip by accident.

03x1+y2dz=3x1+y2\int_0^3 \frac{x}{1 + y^2} \,dz = \frac{3x}{1 + y^2}

What is left separates. The xx factor is a plain power rule and the yy factor is the standard arctangent form.

(02xdx)(01dy1+y2)(3)=2arctan(1)3=2π43\left(\int_0^2 x \,dx\right)\left(\int_0^1 \frac{dy}{1 + y^2}\right)(3) = 2\cdot\arctan(1)\cdot 3 = 2\cdot\frac{\pi}{4}\cdot 3

That product is 6π4=3π24.712389\frac{6\pi}{4} = \frac{3\pi}{2} \approx 4.712389.

The mistake: turning the denominator into a logarithm

Seeing 11+y2\frac{1}{1 + y^2} triggers the reflex ln(1+y2)\ln\left(1 + y^2\right), but that antiderivative belongs to 2y1+y2\frac{2y}{1 + y^2}, where the numerator is the derivative of the denominator. Here the numerator is 11, so no substitution applies and the answer is arctany\arctan y.

  • dy1+y2=arctany+C\int \frac{dy}{1 + y^2} = \arctan y + C, giving π4\frac{\pi}{4} over [0,1][0, 1].
  • 2ydy1+y2=ln(1+y2)+C\int \frac{2y \,dy}{1 + y^2} = \ln\left(1 + y^2\right) + C, giving ln20.693\ln 2 \approx 0.693 over [0,1][0, 1].
  • The gap is arctan(1)=0.785398\arctan(1) = 0.785398 against ln2=0.693147\ln 2 = 0.693147, close enough to look plausible and wrong enough to lose the question.

Differentiating your candidate answer takes five seconds and separates the two immediately.

Why a pi shows up with no circle in sight

The region is a rectangular box and the integrand is a rational function, so a π\pi in the answer surprises people. It arrives through arctan\arctan, whose values at nice inputs are angles, and arctan(1)=π4\arctan(1) = \frac{\pi}{4} is the angle of a 4545 degree line.

Change the yy edge and the π\pi can disappear from the neat form. Running yy from 00 to tan(1)\tan(1) would give arctan(tan1)=1\arctan(\tan 1) = 1 instead, and the answer becomes exactly 66.

Frequently asked questions

Why does the missing z variable still change the answer?

Integrating a zz free function over the zz edge multiplies by the length of that edge, here 33. Only an edge of length 11 leaves the value untouched, and an edge of length 00 would collapse the solid and the integral with it.

Is the integrand ever undefined on this box?

No. The denominator 1+y21 + y^2 is at least 11 for every real yy, so the integrand is smooth and bounded everywhere on the box. That is what makes this a safe example, unlike xy21\frac{x}{y^2 - 1}, which blows up at y=1y = 1.