# Double Integrals Calculations

Examples to calculate and evaluate double integrals are presented with their detailed solutions. oouble integrals over general regions and double integrals in polar coordinates are also included. 

## Review of Single and Double Integrals

Single integrals are used to find the area under the curve of a given function $$f(x)$$ as shown in the graph below.
Area under curve from $$x = a$$ to $$x = b$$ is given by: $$\displaystyle \int_a^b f(x) \; dx$$

For a 3D shapes, we are interested in calculating the volume under the surface defined by a function in two variables $$f(x,y$$ and whose base is $$R$$ (green) as shown in graph a) below.

In the graph shown above, the base $$R$$ of the 3D shape is a rectangle with defined by $$0 \le x \le a$$ and $$0 \le y \le b$$; but in general $$R$$ can have any 2D shape as we will see in more examples.
There are two ways to calculate the volume of the 3D shape.
1)
split the 3D shape into an infinite number of cross-sectional areas $$A_1(x)$$ perpendicular to the $$x$$ axis at fixed values of $$x$$ , as shown in graph b), and then use the concept of a single integral which is basically a continuous sum to find the volume $$V$$ as
$$\displaystyle V = \int_0^a A_1(x) \; dx$$
The cross-sectional area $$A_1(x)$$ is parallel to the plane z-y and can be found by integration of $$f(x,y)$$ over $$y$$ as you would use a single integral to find the area under a curve, as follows
$$\displaystyle A_1(x) = \int_0^b f(x,y) \; dy$$
We now substitute $$A_1(x)$$ in $$V$$ to obtain
$$\displaystyle V = \int_0^a \int_0^b f(x,y) \; dy \; dx$$

2)
split the 3D shape into an infinite number of cross-sectional areas $$A_2(y)$$ perpendicular to the $$y$$ axis at fixed values of $$y$$ , as shown in graph c), and then use the concept of a single integral which is basically a continuous sum to find the volume $$V$$ as
$$V = \displaystyle \int_0^b A_2(y) \; dy$$
The cross-sectional area $$A_2(y)$$ is parallel to the plane z-x and can be found by integration of $$f(x,y)$$ over $$x$$ as you would use a single integral to find the area under a curve, as follows
$$\displaystyle A_2(y) = \int_0^a f(x,y) \; dx$$
We now substitute $$A_2(x)$$ in $$V$$ to obtain
$$\displaystyle V = \int_0^b \int_0^a f(x,y)\; dx \; dy$$
The above is summarized as Fubini's Theorem
$\iint_R f(x,y) \,dx\,dy = \int_0^b \int_0^a f(x,y) \; dx \; dy = \int_0^a \int_0^b f(x,y) \; dy \; dx$ The region R is a rectangle defined by: $$0 \le x \le a$$ and $$0 \le y \le b$$
The above integrals are called iterated integrals.
All formulas and rules for integrals may be used to calculate these integrals.

## Calculations of Single Integrals with Integrand Having More than one Variable

Before we start examples to calculate double integrals, let us first see how to evaluate integrals when the integrand has more than one variable since this is the basic skill needed to evaluate double and triple integrals..
Example 1
Evaluate the integrals
a) $$\displaystyle \int_0^3 (x^2 + y^2) \; dx$$ , b) $$\displaystyle \int_3^5 (\dfrac{1}{x} + \dfrac{1}{y}) \; dy$$ , c) $$\displaystyle \int_{y+1}^{y^2} ( x y + y) \; dx$$ , d) $$\displaystyle \int_0^{x-1} \sin( x y) \; dy$$
Solution to Example 1
a)
To calculate $$\displaystyle \int_0^3 (x^2 + y^2) \; dx$$, we consider $$y$$ as a constant since the integration is over $$x$$.
Note that $$\displaystyle \int (x^2) \; dx = \dfrac{1}{3} x^3$$ and $$\displaystyle \int ( y^2) \; dx = y^2 x$$ since $$y$$ and therefore $$y^2$$ is considered constant. Hence
$$\displaystyle \int_0^3 (x^2 + y^2) \; dx = \left[ \dfrac{1}{3}x^3 + y^2 x \right]_0^3$$
Substitute to evaluate the integral
$$= (\dfrac{1}{3}(3)^3 + y^2 (3)) - (\dfrac{1}{3}(0)^3 + y^2 (0))$$
Simplify
$$= 3 y^2 + 9$$
b)
To calculate $$\displaystyle \int_3^5 (\dfrac{1}{x} + \dfrac{1}{y}) \; dy$$, we consider $$x$$ as a constant since the integration is over $$y$$.
Note that $$\displaystyle \int \dfrac{1}{x} \; dy = \dfrac{1}{x} y$$ since $$x$$ and therefore $$1/x$$ is considered constant and $$\displaystyle \int \dfrac{1}{y} \; dy = \ln |y|$$. Hence
$$\displaystyle \int_3^5 (\dfrac{1}{x} + \dfrac{1}{y}) \; dy = \left[ \dfrac{1}{x} y + \ln |y| \right]_3^5$$
Substitute to evaluate the integral
$$= ( \dfrac{1}{x} (5) + \ln|5|) - ( \dfrac{1}{x} (3) + \ln|3| )$$
Simplify
$$= \dfrac{2}{x} + \ln(5/3)$$
c)
To calculate $$\displaystyle \int_{y+1}^{y^2} ( x y + y) \; dx$$, we consider $$y$$ as a constant since the integration is over $$x$$.
Note that $$\displaystyle \int x y \; dx = \dfrac{1}{2} x^2 y$$ and $$\displaystyle \int y \; dx = y x$$ since $$y$$ is considered constant. Hence
$$\displaystyle \int_{y+1}^{y^2} ( x y + y ) \; dx = \left[ \dfrac{1}{2} x^2 y + y x \right]_{y+1}^{y^2}$$
Substitute to evaluate the integral noting that the limits of integration are functions of $$y$$
$$= ( \dfrac{1}{2} (y^2)^2 y + y (y^2) ) - ( \dfrac{1}{2} (y+1)^2 y + y (y+1) )$$
Simplify
$$= \dfrac{y^5+y^3-4y^2-3y}{2}$$
d)
To calculate $$\displaystyle \int_0^{x-1} \sin( x y) \; dy$$, we consider $$x$$ as a constant since the integration is over $$y$$.
Note that $$\displaystyle \int \sin( x y) \; dy = - \dfrac{1}{x} \cos(xy)$$ since $$x$$ is considered constant. Hence
$$\displaystyle \int_0^{x-1} \sin( x y) \; dy = \left[ - \dfrac{1}{x} \cos(xy) \right]_0^{x-1}$$
Substitute to evaluate the integral noting that the limits of integration are functions of $$x$$
$$= ( - \dfrac{1}{x} \cos(x(x-1)) ) - ( - \dfrac{1}{x} \cos(x(0)) )$$
Simplify
$$= - \dfrac{1}{x} \cos(x^2 - x) + 1/x$$

## Calculations of Double Integrals

The main idea in computing double integrals is to split the double integral into two single integrals. There are two ways to evaluate double integrals
1) Evaluate the integral in $$x$$ first:
$$\displaystyle \int_0^b \int_0^a f(x,y) dx dy = \int_0^b \left(\int_0^a f(x,y) \;dx\right) \;dy$$
2) Evaluate the integral in $$y$$ first:
$$\displaystyle \int_c^d \int_a^b f(x,y) dx dy = \int_0^a \left(\int_0^b f(x,y) \;dy\right) \;dx$$
Note One way to evaluate a double integral is to evaluate the inner and outer integrals separately.

Example 2
Use both methods given above to evaluate the double integral $$V = \displaystyle \int_1^3 \int_0^4 (x^2-y+2) \;dx \;dy$$
Solution to Example 2
1) We compute the integral in $$x$$ first and then the integral in $$y$$.
$$\displaystyle V = \int_1^3 \int_0^4 (x^2-y+2) dx dy = \int_1^3 \left(\int_0^4 (x^2-y+2) \;dx\right) \;dy$$
First evaluate the inner integral $$I = \displaystyle \int_0^4 (x^2-y+2) dx$$ assuming $$y$$ is constant in a similar way to when you calculate partial derivatives.
$$I = \displaystyle \int_0^4 (x^2-y+2) dx = \left[ \dfrac{1}{3} x^3 - y x + 2 x \right]_{x = 0}^{x=4}$$
Evaluate the above
$$I = \displaystyle (\dfrac{1}{3} 4^3 - 4y + 2\cdot4) - (\dfrac{1}{3} 0^3 - y (0) + 2 (0))$$
Simplify
$$I = \left[ -4y+\dfrac{88}{3} \right]$$
Substitute $$I$$ in $$V$$ and calculate the outer integral
$$\displaystyle V = \int_1^3 \left( -4y +\dfrac{88}{3} \right) \;dy$$
Evaluate the above integral
$$\displaystyle V = \left[ -2 y^2 + \dfrac{88}{3} y \right]_{y= 1}^{y=3}$$
$$\displaystyle V = (-2 (3)^2 + \dfrac{88}{3} (3)) - (-2 (1)^2 + \dfrac{88}{3} (1))$$
$$\displaystyle V = \dfrac{128}{3}$$

2) We compute the integral in $$y$$ first and then the integral in $$x$$.

$$V = \displaystyle \int_1^3 \int_0^4 (x^2-y+2) dx dy = \int_0^4 \left(\int_1^3 (x^2-y+2) dy\right) \; dx$$
Evaluate the inner integral $$I = \displaystyle \int_1^3 (x^2-y+2) dy$$ assuming $$x$$ is constant
$$I = \left[ x^2 y - \dfrac{1}{2} y^2 x + 2 x y \right]_{y = 1}^{y=3}$$
$$= \displaystyle \left( ( x^2 (3) - \dfrac{1}{2} (3)^2 x + 2 x (3) ) - (x^2 (1) - \dfrac{1}{2} (1)^2 x + 2 x (1)) \right)$$
Simplify
$$I = 2x^2$$
Substitute $$I$$ in $$V$$
$$\displaystyle V = \int_0^4 2x^2 dx$$
Evaluate the above integral
$$V = \displaystyle \left[ \dfrac{2}{3} x^3 \right]_{x=0}^{x=4}$$
$$V = \dfrac{128}{3}$$
Notes
1) the two ways to split the integral give the same answer.
2) Although we were calculating a double integral, we were in fact dealing with single integrals and of course all formulas and properties of integrals may be used.

## More Examples with Solutions

Example 3
Evaluate the double integral $$V = \displaystyle \int_1^3 \int_0^4 \sqrt {2+x+y} \; dx \; dy$$
Solution to Example 3
Start with the inner integral
Let $$\displaystyle I = \int_0^4 \sqrt {2+x+y} \; dx$$
Evaluate $$I$$
$$\displaystyle I = \left[ \dfrac{2}{3} (2+x+y)^{3/2} \right]_0^4$$
Evaluate the above
$$\displaystyle I = \left( \dfrac{2}{3} (2+4+y)^{3/2} - \dfrac{2}{3} (2+0+y)^{3/2} \right)$$
Simplify
$$\displaystyle I = \dfrac{2}{3} \left( (6+y)^{3/2} - (2+y)^{3/2} \right)$$
Substitute inner integral $$I$$ in $$V$$
$$\displaystyle V = \int_1^3 \dfrac{2}{3} \left( (6+y)^{3/2} - (2+y)^{3/2} \right) \; dy$$
Calculate the above integrals
$$\displaystyle V = \dfrac{4}{15} \left[ (6+y)^{5/2} - (2+y)^{5/2} \right]_1^3$$
Evaluate using the limts of integration
$$\displaystyle V = \dfrac{4}{15} \left[ (6+3)^{5/2} - (2+3)^{5/2} \right] - \dfrac{4}{15} \left[ (6+1)^{5/2} - (2+1)^{5/2} \right]$$
$$\displaystyle \approx 19.48$$

Example 4 Limits of integration may have variables
Evaluate the double integral $$\displaystyle V = \int _{1\:}^2\:\int _{y-1}^{y}\:\:\left(x+\dfrac{1}{y}\right) \; dx \; dy$$
Solution to Example 4
Let the inner integral be $$\displaystyle I = \int _y^{y+1}\:\:\left(x+\dfrac{1}{y}\right) \; dx$$
Calculate the above integral
$$I = \left[ \dfrac{x^2}{2}+ \dfrac {x}{y} \right]_{y-1}^{y}$$
Evaluate $$I$$ using the limits of integration
$$I = \left( \dfrac{(y)^2}{2}+ \dfrac {y}{y} \right) - \left( \dfrac{(y-1)^2}{2}+ \dfrac {y-1}{y} \right)$$
Simplify
$$I = y - 1/2 + \dfrac{1}{y}$$
Substitute $$I$$ in $$V$$ and calculate the outer integral
$$\displaystyle V = \int _{1\:}^2 ( y - 1/2 + \dfrac{1}{y} ) \; dy$$
Calculate the above integral
$$\displaystyle V = \left [\dfrac{y^2}{2} - \dfrac{y}{2} + \ln |y| \right]_1^2$$
$$\displaystyle V = (\dfrac{(2)^2}{2} - \dfrac{(2)}{2} + \ln |(2)|) - (\dfrac{(1)^2}{2} - \dfrac{(1)}{2} + \ln |(1)|)$$
Simplify
$$V = \ln 2 + 1$$

Example 5
Evaluate the double integral $$\displaystyle V = \int _0^{\pi}\:\int _0^1\left(x \sin(x^2)+y\:\right)dy\:dx$$
Solution to Example 5
Let the inner integral be $$\displaystyle I = \int _0^1\left(x\sin\left(x^2\right)+y\:\right)dy$$
Calculate the above integral
$$I = \left[ x\sin(x^2) y + \dfrac{y^2}{2} \right]_{0}^{1}$$
Evaluate $$I$$ using the limits of integration
$$I = x\sin(x^2) + \dfrac{1}{2}$$
Substitute $$I$$ in $$V$$ and calculate the outer integral
$$\displaystyle V = \int _{0\:}^{\pi} ( x\sin(x^2) + \dfrac{1}{2} ) \; dx$$
Calculate the above integral
$$\displaystyle V = \left [ -\dfrac{1}{2} \cos (x^2) + \dfrac{1}{2} x\right]_0^{\pi}$$
Simplify
$$\displaystyle V = \dfrac{-\cos(\pi^2)+\pi+1}{2}$$

Example 6
Find the constant $$k$$ so that $$\displaystyle \int _0^1\:\int _0^3 k x^2 (y+1) dy\:dx = 5$$
Solution to Example 6
Let $$\displaystyle V = \int _0^1\:\int _0^3 k x^2 (y+1) dy\:dx$$
Let the inner integral be $$\int _0^3 k x^2 (y+1) dy$$
Calculate $$I$$
$$I = \left [k x^2 (\dfrac{y^2}{2}+y) \right]_0^3 = k \dfrac{15}{2} x^2$$
Substitute $$I$$ in $$V$$
$$\displaystyle V = \int _0^1 k \dfrac{15}{2} x^2 dx$$
Evaluate $$V$$
$$V = \left [ \dfrac{5 k}{2} x^3 \right]_0^1 = \dfrac{5 k}{2}$$
We now solve for $$k$$ the equation
$$k = 2$$

Example 7
Find the constant $$b$$ so that $$\displaystyle \int _1^2\:\int _0^b (2x+y )dy\:dx = 10$$ and $$b \gt 0$$
Solution to Example 7
Let $$\displaystyle V = \int _1^2\:\int _0^b (2x+y )dy\:dx$$
Let $$I$$ be the inner integral
$$I = \displaystyle \int _0^b (2x+y )dy$$
Evaluate $$I$$
$$\displaystyle I = \left[\dfrac{y^2}{2}+2xy\right]_0^b = \dfrac{b^2}{2}+2bx$$
Substitute $$I$$ in $$V$$ and evaluate $$V$$
$$\displaystyle V = \int _1^2\ \left(\dfrac{b^2}{2}+2bx \right) dx$$
$$= \left[ \dfrac{b^2}{2}x+bx^2 \right]_1^2$$
$$= \dfrac{b^2}{2}+3b$$
In order to find $$b$$, we need to solve the equation
$$\dfrac{b^2}{2}+3b = 10$$
Solve the above equation
and select the positive solution given by
$$b = -3+\sqrt{29}$$

## More Questions with Answers

Part 1: Calculate the integrals
1. $$\displaystyle \int _1^2\:\int _0^4\left( x^2+y^2 \right)dy\:dx$$
2. $$\displaystyle \int _2^4\:\int _1^4\left(\:\:x^2\:\:+\dfrac{1}{y^{\:}}\right)dy\:dx$$
3. $$\displaystyle \int _2^3\:\int _1^5\:\left(\dfrac{x}{y}+\dfrac{y}{x}\right)dx \: dy$$
4. $$\displaystyle \int _0^{\frac{\pi }{2}}\:\int _0^{\frac{\pi }{2}}\left(\sin\left(x+y\right)\right)dy\:dx$$
Part 2: Find $$b$$ not equal to $$-1$$ or $$-2$$ so that $$\displaystyle \int _{-1}^b\:\int _{-2}^b\left(\:\:x\:y\:e^{x^2+y^2}\:\:\right)dy\:dx = 0$$

## Answers to the Above Questions

Part 1:
1. $$\dfrac{92}{3}$$
2. $$4\ln (2) +56$$
3. $$\dfrac{5}{2} \ln (5)+12 \ln (3/2)$$
4. $$2$$
Part 2: $$\displaystyle \int _{-1}^b\:\int _{-2}^b\left(\:\:x\:y\:e^{x^2+y^2}\:\:\right)dy\:dx = \dfrac{1}{4}\left(e^{b^2}-e^4\right)\left(e^{b^2}-e\right)$$
Solve the equation: $$\dfrac{1}{4}\left(e^{b^2}-e^4\right)\left(e^{b^2}-e \right) = 0$$
which gives two solutions: $$b = 1$$ and $$b = 2$$

## More References and Links

area under the curve
Evaluate Integrals
Formulas and Rules for Integrals in Calculus
Fubini's Theorem
Gilbert Strang; MIT, Calculus, Wellesley-Cambridge Press, 1991
Joel Hass, University of California, Davis; Maurice D. Weir Naval Postgraduate School; George B. Thomas, Jr.Massachusetts Institute of Technology ; University Calculus , Early Transcendentals, Third Edition , Boston Columbus , 2016, Pearson.
Engineering Mathematics with Examples and Solutions