Multivariable calculus

Double Integral of x exp(xy) Over the Unit Square

The double integral of x times e to the power xy over the unit square, with x and y each from 0 to 1, equals e - 2, about 0.7183. Integrating in y first is the key: the inner integral collapses to e to the x, minus 1, with no integration by parts needed.

f(x,y)=xexyf(x,y) = x\,e^{xy}
e2e-2

Numerically 0.718282, confirmed by quadrature on every build.

Choose the order that makes the inner integral trivial

Hold xx fixed and integrate in yy. Then xx is a constant, and the leading xx is exactly the constant that exye^{xy} needs when you undo the chain rule.

01xexydy=[exy]y=0y=1=ex1\int_{0}^{1} x\,e^{xy}\,dy = \Big[e^{xy}\Big]_{y=0}^{y=1} = e^{x} - 1

The xx out front vanished into the antiderivative rather than surviving as a factor, which is what makes this order so cheap. Now finish in xx.

01(ex1)dx=[exx]01=(e1)1=e20.7183\int_{0}^{1}\left(e^{x} - 1\right)\,dx = \Big[e^{x} - x\Big]_{0}^{1} = (e - 1) - 1 = e - 2 \approx 0.7183

What the other order costs you

Both orders are legal, since the integrand is continuous on the square. They are not equally pleasant. Integrating in xx first means holding yy fixed and facing 01xexydx\int_{0}^{1} x\,e^{xy}\,dx, which needs integration by parts.

01xexydx=eyyey1y2\int_{0}^{1} x\,e^{xy}\,dx = \frac{e^{y}}{y} - \frac{e^{y}-1}{y^{2}}

It looks singular at y=0y = 0, but the singularity is removable: the limit there is 12\frac{1}{2}, which is just 01xdx\int_{0}^{1} x\,dx. To finish, you have to recognise the expression as a quotient-rule derivative.

ddy(ey1y)=eyyey1y201(eyyey1y2)dy=[ey1y]01=(e1)1=e2\frac{d}{dy}\left(\frac{e^{y}-1}{y}\right) = \frac{e^{y}}{y} - \frac{e^{y}-1}{y^{2}} \quad \Longrightarrow \quad \int_{0}^{1}\left(\frac{e^{y}}{y} - \frac{e^{y}-1}{y^{2}}\right)\,dy = \left[\frac{e^{y}-1}{y}\right]_{0}^{1} = (e-1) - 1 = e - 2

So the other order does close, and on the same e2e - 2. It costs integration by parts, a removable singularity to argue about, and a derivative you have to read backwards. The first order cost one line.

The habit worth building: before integrating anything, glance at both inner integrals and pick the one that needs no technique at all.

The mistake: treating the leading x as an inert constant

A frequent error is to pull xx out of the inner integral and then also treat exye^{xy} as if the xx inside it were not there, writing x01eydy=x(e1)x \int_{0}^{1} e^{y}\,dy = x(e-1).

That drops the xx from the exponent, which changes the function entirely. Test it inside the square at x=12x = \tfrac{1}{2}, y=1y = 1: the real integrand is 12e1/20.824\tfrac{1}{2}e^{1/2} \approx 0.824, the corrupted one is 12e1.359\tfrac{1}{2}e \approx 1.359.

Pulling a factor out is legal, forgetting a variable inside a composition is not. When you factor xx out of xexyx\,e^{xy}, the exye^{xy} that remains still depends on xx, so it cannot be integrated as eye^{y}.

Frequently asked questions

Why does the inner integral come out to e^x - 1 with no extra constant?

Because yexy=xexy\frac{\partial}{\partial y}e^{xy} = x\,e^{xy}, the integrand is already the exact yy derivative of exye^{xy}. Evaluating at y=1y=1 and y=0y=0 gives exe0=ex1e^{x} - e^{0} = e^{x}-1.

Is e - 2 really positive?

Yes. e2.71828e \approx 2.71828, so e20.7183e - 2 \approx 0.7183. The integrand is non-negative on the square, so a negative answer would have signalled an arithmetic slip.