Multivariable calculus
Double Integral of y sin(xy) Over [1,2] by [0, pi/2]
The double integral of y times sin(xy), with x running from 1 to 2 and y from 0 to pi/2, equals 1. Integrate in x first: the factor y is exactly what the substitution u = xy needs, so the inner integral is cos y minus cos 2y, and integrating that from 0 to pi/2 gives 1.
Numerically 1.000000, confirmed by quadrature on every build.
Integrate in x first and the leading y disappears
Hold fixed and substitute , so . The loose factor is consumed exactly, leaving .
No survives, so the inner stage is done. The outer integral is now an ordinary trigonometric one.
The second term vanishes because , so the whole answer comes from .
The other order needs integration by parts
Integrating in first, the factor is no longer the derivative of anything convenient, since . You would need parts with and .
It gets to the same 1 in the end. The point is that the loose factor tells you which order is cheap: match it against and and take the one that fits.
The mistake: dividing by the wrong variable
The antiderivative of in is , dividing by . Dividing by instead leaves , and differentiating that in does not return the integrand.
- Multiply the correct antiderivative back out: , with the gone.
- If the inner answer still contains the loose factor, you divided by the wrong variable.
- Differentiating your antiderivative with respect to the integration variable settles it every time.
The edge is a useful check. There the integrand is 0, and the inner result agrees, so no stray factor of ever appears in the final expression.
Frequently asked questions
Why does the leading y vanish from the answer?
Because the substitution in the integral has , so the is absorbed into . Equivalently, , and the in front cancels the .
What changes if x runs from 1 to 3 instead?
The inner integral becomes , and , since .