Tutorials › Calculus III › Evaluating an Inner Integral Before the Outer Integral

Double Integrals on Rectangles · Tutorial 511 of 999

Evaluating an Inner Integral Before the Outer Integral

Practice evaluating rectangular double integrals one variable at a time, with careful attention to which variable is held constant and how the inner result becomes the outer integrand.

Beginner 9 min read

What You'll Learn

  • Identify the inner and outer variables from the order of integration
  • Treat the outer variable as a constant while finding an inner antiderivative
  • Apply the inner bounds before beginning the outer integration
  • Interpret the inner integral as a function of the outer variable
  • Evaluate and check iterated integrals over rectangular domains
  • Recognize and correct common errors in the order of calculation

Introduction

A double integral over a rectangle can often be evaluated by performing two ordinary definite integrals in succession. The order matters for the calculation: first evaluate the inner integral, then integrate the result with respect to the outer variable.

The central discipline is to keep track of which variable is being integrated at each stage. During the inner integration, the outer variable is treated as a constant. After applying the inner bounds, the result may still depend on the outer variable; that result is the integrand for the second calculation.

Key idea: In an iterated integral, integrate with respect to the variable next to the integral sign first. Apply its bounds, retain any dependence on the other variable, and then perform the outer integration.

Reading an Iterated Integral

Consider a continuous function \(f\) on the rectangle \([a,b]\times[c,d]\). An iterated integral in which \(y\) is integrated first and \(x\) second is written

$$ \int_a^b \left(\int_c^d f(x,y)\,dy\right)dx. $$

The inner integral has \(y\)-bounds \(c\) and \(d\), and its differential is \(dy\). For this calculation, \(x\) is held fixed. The outer integral then uses the \(x\)-bounds \(a\) and \(b\), and its differential is \(dx\).

Because \(f\) is continuous on the rectangle, the inner definite integral exists for each \(x\in[a,b]\). Its value can vary with \(x\). Thus the inner calculation produces a function of \(x\), which is then integrated over \([a,b]\). By Fubini’s theorem for continuous functions, this iterated integral equals the double integral of \(f\) over the rectangle.

Definition: For fixed \(x\), the inner integral is the number \(\int_c^d f(x,y)\,dy\). As \(x\) varies, these numbers define a function \(G(x)=\int_c^d f(x,y)\,dy\). The iterated integral is then \(\int_a^b G(x)\,dx\).

Why the Calculation Works

The fundamental theorem of calculus explains how to compute the inner integral. Suppose an antiderivative with respect to \(y\), denoted \(F(x,y)\), satisfies \(\frac{\partial F}{\partial y}(x,y)=f(x,y)\). The \(x\) in \(F\) is a parameter during this antiderivative calculation. For each fixed \(x\), the fundamental theorem gives

$$ \int_c^d f(x,y)\,dy=F(x,d)-F(x,c). $$

The right-hand side can depend on \(x\), so it is not generally the final answer. Substituting it into the outer integral gives

$$ \int_a^b \left(\int_c^d f(x,y)\,dy\right)dx = \int_a^b \bigl(F(x,d)-F(x,c)\bigr)\,dx. $$

The inner antiderivative has therefore converted the original integrand into a new, one-variable integrand. The inner bounds must be applied before the outer integral is evaluated.

1
Identify the inner variable.
Read the differential beside the inner integral. In the displayed order above, it is \(y\).
2
Integrate with the other variable fixed.
Find an antiderivative in \(y\), treating \(x\) as a constant.
3
Apply the inner bounds.
Evaluate the antiderivative at the upper \(y\)-bound and subtract its value at the lower \(y\)-bound.
4
Integrate the resulting function.
Use the outer bounds and integrate the expression that remains with respect to \(x\).

Worked Examples

Worked Example: A Linear Integrand

Evaluate \(\int_0^2\int_1^3 (2x+y)\,dy\,dx\). The inner variable is \(y\), so hold \(x\) fixed while integrating.

An antiderivative with respect to \(y\) is \(2xy+\frac{y^2}{2}\), since its derivative with respect to \(y\) is \(2x+y\). Apply the inner bounds:

$$ \begin{aligned} \int_1^3 (2x+y)\,dy &=\left[2xy+\frac{y^2}{2}\right]_1^3\\ &=\left(6x+\frac{9}{2}\right)-\left(2x+\frac{1}{2}\right)\\ &=4x+4. \end{aligned} $$

The inner result still depends on \(x\). Now evaluate the outer integral:

$$ \begin{aligned} \int_0^2(4x+4)\,dx &=\left[2x^2+4x\right]_0^2\\ &=(8+8)-0\\ &=16. \end{aligned} $$

Check the antiderivatives: \(\frac{\partial}{\partial y}(2xy+y^2/2)=2x+y\), and \(\frac{d}{dx}(2x^2+4x)=4x+4\). The inner endpoint difference is \(4x+4\), and its outer endpoint difference is \(16\), as calculated.

Worked Example: A Quadratic Term in the Outer Variable

Evaluate \(\int_{-1}^1\int_0^2 (x^2+3y)\,dy\,dx\). Here \(x^2\) is constant during the integration with respect to \(y\).

An inner antiderivative is \(x^2y+\frac{3y^2}{2}\). Substitution of \(y=2\) and \(y=0\) gives

$$ \begin{aligned} \int_0^2(x^2+3y)\,dy &=\left[x^2y+\frac{3y^2}{2}\right]_0^2\\ &=(2x^2+6)-0\\ &=2x^2+6. \end{aligned} $$

Now integrate this expression with respect to \(x\):

$$ \begin{aligned} \int_{-1}^1(2x^2+6)\,dx &=\left[\frac{2x^3}{3}+6x\right]_{-1}^1\\ &=\left(\frac{2}{3}+6\right) -\left(-\frac{2}{3}-6\right)\\ &=\frac{20}{3}+\frac{20}{3}\\ &=\frac{40}{3}. \end{aligned} $$

For a check, differentiating \(x^2y+\frac{3y^2}{2}\) with respect to \(y\) gives \(x^2+3y\). Differentiating \(\frac{2x^3}{3}+6x\) with respect to \(x\) gives \(2x^2+6\), the inner result. The outer endpoint substitution gives \(\frac{40}{3}\).

Worked Example: A Reciprocal Term in the Inner Variable

Evaluate \(\int_0^2\int_1^e \left(\frac{x}{y}+y\right)\,dy\,dx\). Since \(y\) ranges from \(1\) to \(e\), it is positive throughout the interval, so the logarithmic antiderivative is defined.

With \(x\) fixed, an antiderivative in \(y\) is \(x\ln y+\frac{y^2}{2}\). The inner calculation is

$$ \begin{aligned} \int_1^e\left(\frac{x}{y}+y\right)\,dy &=\left[x\ln y+\frac{y^2}{2}\right]_1^e\\ &=\left(x+\frac{e^2}{2}\right)-\left(0+\frac{1}{2}\right)\\ &=x+\frac{e^2-1}{2}. \end{aligned} $$

Integrate the resulting function of \(x\):

$$ \begin{aligned} \int_0^2\left(x+\frac{e^2-1}{2}\right)\,dx &=\left[\frac{x^2}{2}+\frac{e^2-1}{2}x\right]_0^2\\ &=\left(2+e^2-1\right)-0\\ &=e^2+1. \end{aligned} $$

To check, \(\frac{\partial}{\partial y}(x\ln y+y^2/2)=x/y+y\), and \(\frac{d}{dx}\left(x^2/2+(e^2-1)x/2\right)=x+(e^2-1)/2\). Evaluating at the stated endpoints yields the inner result and then \(e^2+1\).

A Common Mistake: Integrating the Wrong Variable

In an inner integral with \(dy\), the variable \(y\) changes and \(x\) is fixed. A common error is to treat \(x\) as the integration variable simply because it appears in the integrand.

For example, consider the inner integral \(\int_0^2(x+y)\,dy\). The incorrect calculation

$$ \int (x+y)\,dy \ \overset{\text{wrong}}{=}\ \frac{x^2}{2}+\frac{y^2}{2} $$

is wrong because differentiating the proposed expression with respect to \(y\) gives \(y\), not \(x+y\). The \(x^2/2\) term arose from integrating with respect to \(x\), which is not the indicated variable.

The correction is to keep \(x\) constant:

$$ \int_0^2(x+y)\,dy =\left[xy+\frac{y^2}{2}\right]_0^2 =(2x+2)-0 =2x+2. $$

If this is the inner part of \(\int_0^1\int_0^2(x+y)\,dy\,dx\), it is not yet the final answer. The remaining calculation is

$$ \int_0^1(2x+2)\,dx =\left[x^2+2x\right]_0^1 =3. $$

The check is direct: the derivative of \(xy+y^2/2\) with respect to \(y\) is \(x+y\), and the derivative of \(x^2+2x\) is \(2x+2\).

What to Keep in View

The written order of an iterated integral records a sequence of operations. The inner variable is not chosen by which variable looks easier or appears first in the formula; it is specified by the inner differential. Likewise, the inner bounds belong to that variable, and the outer bounds belong to the outer variable.

The result of the inner integration may contain the outer variable, as in \(4x+4\) or \(2x^2+6\). That dependence is expected: the inner integral measures an accumulated value for each fixed outer coordinate. Only after applying the outer bounds and completing the second integration is the iterated integral a single number.

Practical check: After finding an inner antiderivative, differentiate it with respect to the inner variable. After applying the inner bounds, confirm that only the outer variable remains. Then verify the outer antiderivative by differentiating with respect to the outer variable.

Check Your Understanding

For each question, identify which variable is fixed during the inner integration and show the intermediate inner result before evaluating the outer integral.

  1. Evaluate \(\int_0^1\int_0^2 (3x+y)\,dy\,dx\).
  2. For \(\int_{-1}^1\int_1^2 (x+y^2)\,dy\,dx\), what variable is held fixed in the inner integral?
  3. Find the inner integral \(\int_0^3 (x^2+2y)\,dy\), treating \(x\) as a constant.
  4. Explain why the result of an inner integral may still depend on the outer variable.
  5. What is wrong with using an antiderivative in \(x\) when the inner differential is \(dy\)?