Professional Documents
Culture Documents
Block 5
Block 5
Block 5
Block 5
Multivariable intergration
The first time one is introduced to the concept of integral, it is common to think about the area below a curve.
The integral of a one variable function f (x) can be understood as the sum of infinitely small area elements
below the plot of the function.
Figure 5.1: The integral as the limit of the sum of infinitely small area elements below the plot of f (x).
Imagine, as shown in Figure 5.1, that we could approximate the area under the plot of f (x) from the point
x = a to the point x = b by dividing the interval in N small segments of length δxi and computing the sum
of the area δAi of all the small rectangles of base δxi and height f (xi )
N
X N
X
A≈ δAi = f (xi )δxi
i i
If we make these rectangles infinitely small, i.e. we take the limit N → ∞ and δx1 → 0 keeping constant the
product of the two N δxi = b − a we get exactly the area between the x axis and the plot of f (x):
N
X Z b
A = lim f (xi )δxi = dx f (x)
δxi →0 a
N →∞ i
We generalize this to the two variable case ‘upgrading’ the concept of ‘Area under the plot’ to ‘volume
under the plot’. We can approximate the volume under the plot of a two-dimensional function f (x, y) over
the rectangle R ≡ [a, b] × [c, d] by dividing the rectangle in small rectangles of sides δxi and δyi (which will
have an area δAi = δxi δyi ), and summing up the volume of all the small parallelepipeds of base Ai and height
f (xi , yi ), as seen in Figure 5.2. This is,
Figure 5.2: The integral as the limit of the sum of infinitely small volume elements below the plot of f (x, y).
N X
X N N X
X N N X
X N
V ≈ δVij = δAij f (xi , yj ) = δxi δyj f (xi , yi )
i j i j i j
in the limit of infinitely many infinitesimally small area elements we obtain the exact volume, which is the
integral of the two variable function:
N X
X N Z ZZ Z b Z d
V = lim = f (xi , yj )δxi = dAi = dxdy f (x, y) = dx dy f (x, y)
δxi →0 R R a c
δyi →0 i j
N →∞
Example 5.1.1. An example of application of the double integral: consider a thin rectangular plate of constant
thickness and density ρ. Its specific heat capacity (heat capacity per unit mass) Cp . The temperature of the
plate varies as a function of x, y on the plate. What is the total thermal energy on the plate?
We know that the thermal energy will be the product of the temperature times the mass times the
specific heat capacity. However, the temperature varies from point to point on the plane. We can think of
approximating the value of the energy by dividing the plate into infinitesimally small volume elements of
instant temperature and computing the infinitesimal energy in all of them, to finally add them up. For every
single one of these volume elements we would have
The total energy can be approximated by the sum of all these small energy contributions
X
E≈ δEij
ij
Being exactly equal in the limit of infinitely many infinitesimally small volume elements
ZZ ZZ
E= dxdy ρ Cp T (x, y) = ρ Cp dxdy T (x, y)
In single variable integrals, it is enough with specifying two integration limits. Being the dimension of the
integration region only one, there is no freedom to give any shape to integration contours other than segments
in the real line. The scenario is different in multidimensional integrals. Already in two-dimensional integrals
one can see that the integration contours can be of varied nature. Actually, one of the trickiest parts of
performing multivariable integrals is to correctly implement the integration contours. In general, we will
consider integrals of two-variable functions over a given region A of the XY plane:
ZZ
I= dx dy f (x, y)
A
To see how this Let us illustrate this with a very simple example:
Example 5.1.2. Compute the integral of the function f (x, y) = x2 + xy 2 over the triangle formed by the
lines y = ax, y = 0, x = 1.
This is a rather simp integration contour, which is shown in Fig 5.3. As we can see, in that triangle
0 ≤ x ≤ 1 and y = ax. the way to proceed, is t perform the integrals with respect to x and y sequentially.
y=ax
x=y/a
x=1
y=0
If we do the integral over y, we need to write y(x) in the integration contour. From Fig. 5.3 we see that the
lower limit on y is y = 0 and the upper limit is y(x) = ax. Fized that x will vary between 0 and 1, so we get:
Z 1 Z ax Z 1 Z ax Z 1 y=ax Z 1
y3x a3 x4
2 2 2 3
I= dx dy f (x, y) = dx dy (x + xy ) = dx yx + = dx ax +
0 0 0 0 0 3 y=0 0 3
and now, we can perform the integral over x
Z 1 x=1
a3 x4
4
a3 x5 a a3
3 ax
I= dx ax + = + = +
0 3 4 15 x=0 4 15
If we perform the integral over x first, we need to write x(y) in the integration contour. From Fig. 5.3 we see
that the lower limit on x is x(y) = y/a and the upper limit is x = 1. Fixed that, y will vary between 0 and a,
so we get:
Z a Z 1 Z a Z 1 Z a 3 x=1 Z a
y 2 x2 1 y2 y3 y4
2 2 x
I= dy dx f (x, y) = dy dx (x + xy ) = dy + = dy + − 3− 2
0 y/a 0 y/a 0 3 2 x= y 0 3 2 3a 2a
a
As we can see, both methods produce the same result, though one of them yields a simpler integral. In
general, we will always expect that. For any contour in the XY plane, we can write
Z x2 Z y2 (x) ! Z !
ZZ y2 Z x2 (y)
I= dx dy f (x, y) = dx dy f (x, y) = dy dx f (x, y)
A x1 y1 (x) y1 x1 (y)
which tells us that it is up to us to decide in which order we integrate, as long as we are careful with expressing
the integration contour correctly.
Let us see another example
Example 5.1.3. Compute ZZ
x
dx dy sin
D y
√
over the area D defined by the intersection of {x = 0, y = π, y = x}.
y2
√
x
√
y= x
If we try to do the integration over y first we would find a rather difficult integral: from Fig. 5.4 we see
√
that y would run from y = x to y = π and x would run from x = 0 to x = π 2
Z π2 Z π Z π2 Z π
x
I= dx √ dy f (x, y) = dx √ dy sin
0 x 0 x y
which is definitely not a very easy integral to solve.
On the other hand, if we perform the integral over x first, we get that x would run from x = 0 to x = y 2
and y would run from y = 0 to y = π, and therefore
Z π Z y2 Z π Z y2
x
I= dy dx f (x, y) = dy dx sin
0 0 0 0 y
π y2 π x=y2 π π
π2
Z Z Z Z Z
x
I= dy dx f (x, y) = dy −y cos =− dy (y cos y − y) = − dy y cos y
0 0 0 y x=0 0 2 0
the integral which is left is one of the simplest by-parts integrals: by applying
Z Z
dv u = uv − du v
choosing
u = y ⇒ du = dy, dv = cos y dy ⇒ v = sin y
we get Z π Z π
dy y cos y = [y sin y]π0 − dy sin y = cos π − cos 0 = −2
0 0
This is a good example of a case where one way the integral is very difficult but integrating the other
variable first it becomes easy.
Let us go through another example that we will see is artificially involved:
Example 5.1.4. Compute the area of the disc of radius R. The integral we have to solve is
ZZ
dx dy
D
where D is the unit disk x2 + y 2 ≤ R2 . We will see a much better way to solve this integral when we study
multidimensional change of variables, but for the sake of practice, let us use the brute-force approach we have
learned so far. we will do the integral over y first (there is no advantage of choosing one or the other in this
!
y= R2 − x2
!
y = − R2 − x2
√
Z R Z R2 −x2 Z R p Z R p
I= dx dy = 2 2 2
dx R − x = 4 dx R 2 − x2
√
−R − R2 −x2 −R 0
where in the last step we used that the integrand is an even function of x. Now, this is the typical example
where a trigonometric change of variables does the trick:
x = R sin t ⇒ dx = R cos t dt
As said above, we will see a much simpler way of doing this integral when we study multidimensional
changes of variables.
Although no longer easy to picture as an ‘area’ or as a ‘volume’, it is trivial to extend the concept of multiple
integral to many variables. In particular, we can think of the integration of a tridimensional function f (x, y, z)
(whose plot lives in a 4-dimensional space) over an infinitesimally small volume element dV = dx, dy, dz. In
a similar fashion as two-variable integrals. It can be understood as the sum of the values of a function in an
infinitesimally small region of space over some volume V , it is usually denoted as
ZZZ ZZZ
dV f (x, y, z) = dx dy dz f (x, y, z)
V V
Example 5.2.1. The density of an object is given by ρ(x, y, z) and we know that the object has tridimensional
shape W . What is the total mass of the object?
If we divide the space W , containing the object, in infinitesimal parts dV , the mass of every single one of
these small parts will be ρ(x, y, z)dV . Summing up all the infinite infinitesimally small parts we obtain the
total mass, given by the volume integral:
ZZZ
M= dx dy dz ρ(x, y, z)
W
When it comes to setting up the integration contours, this time it is trickier than in the two-dimensional
case: There are, in principle, 6 different ways to split the domain of integration
ZZZ Z z2 Z y2 (z) Z x2 (y,z) Z x2 Z z2 (x) Z y2 (x,z)
dV f (x, y, z) = dz dy dx f (x, y, z) = dx dz dy f (x, y, z) = . . .
V z1 y1 (z) x1 (y,z) x1 z1 (x) y1 (x,z)
So, same as before, and even more so when we integrate over a larger number of variables, paying attention
to the integration contour is crucial to solve these integrals. Let us first compute a very simple example and
then we will tackle some more involved examples.
Example 5.2.2. Integrate the function f (x, y, z) = x2 + y 2 + z 2 over the cube V = [0, 1] × [0, 1] × [0, 1]
In this simple case, the integration contours have no complication
1 1 1 1 1 1
x3
ZZZ Z Z Z Z Z
2 2 22 2
I= dV f (x, y, z) = dz dy dx (x + y + z ) = dz dy + xy + xz
V 0 0 0 0 0 3 0
Z 1 Z 1 Z 1 3
1 Z 1 1
2z + z 3
1 2 2 y y 2 1 1 2
= dz dy +y +z = dz + + yz = dz + +z = =1
0 0 3 0 3 3 0 0 3 3 3 0
Example 5.2.3. Calculate the volume of the tetrahedron of vertices (0, 0, 0), (a, 0, 0), (0, b, 0), (0, 0, c).
Figure 5.6: The tetrahedron of vertices (0, 0, 0), (a, 0, 0), (0, b, 0), (0, 0, c).
This tetrahedron is depicted in Fig. 5.6. Since we are going to need the integration contour, we need to
characterize the volume of integration as a surface or as the intersection of several surfaces. In particular, in
this case, the tetrahedron is clearly the volume enclosed into 4 intersecting planes:
• The XY plane
• The YZ plane
• The XZ plane
x y z
• The plane with intersects on a, b, c respectively for the z, y, z axes. This is P ≡ + + =1
a b c
We will integrate with respect to x first. We obtain the integration limits with respect to x by looking at the
figure: the domain of x starts from zero and increases up to the point where it touches the plane P . This is,
it goes from 0 to a − ay az
b − c (which is the value of x on that plane, obtained solving for x in the equation of
the plane).
Now, once the limits of integration on x are set up, we need to set up the integration limits for y. We
see that the lower limit of y is zero, and the upper limit is, again, the plane P . However, we have already
accounted for the variation of x on that plane when we integrated over x, therefore, we only need to find
what’s the variation of y on that plane projected onto the Y Z plane. We see that on that plane, (where x = 0)
the relationship between z and y on the plane P is y = b − bzc , which sets the upper integration limit for y,
therefore, the integral we have to compute becomes
ZZZ Z c Z b− bz Z a− ay − az Z c Z b− bz
c b c
ay az c
I= dV = dz dy dy a −
dx = − dz
V 0 0 0 0 0 b c
bz Z " 2 # Z c
b− c
a b − bzc bz
Z c c
ay 2 ayz az b − abz 2 abz ab
bz c
= dz ay − − = dz − +a b− − = dz − +
0 2b c 0 0 2b c c 0 2c2 c 2
c
abz 3 abz 2 abz
abc abc abc abc
= − + = − + =
6c2 2c 2 0 6 2 2 6
which is the well known formula of the volume of the tetrahedron.
Example 5.2.4. What is the thermal energy stored in a piece of material with the shape of a tetrahedron,
constant density ρ and specific heat capacity Cp but where it’s temperature increases with the heigh of the
tetrahedron as follows T (x, y, z) = Tmin + z.
we know that
ZZZ ZZZ ZZZ
E= dV ρ Cp T (x, y, z) = ρ Cp t Tmin dV + zdV
Z c Z b− bz Z a− ay − az ! Z c " Z b− bz Z a− ay − az #!
abc c b c abc c b c
= ρ Cp Tmin + dz dy dx z = ρ Cp Tmin + dz z dy dx
6 0 0 0 6 0 0 0
from the previous example, we know the content of the innermost bracket:
Z b− bz Z a− ay − az
abz 2 abz ab
c b c
dy dx = − +
0 0 2c2 c 2
so substituting this we arrive at
c
abz 3 abz 2 abz
Z
abc
E = ρ Cp Tmin + dz z − +
6 0 2c2 c 2
since
c
abz 3 abz 2 abz abc2 abc2 abc2 abc2
Z
dz − + = − + =
0 2c2 c 2 8 3 4 24
we substitute in E to finally get
abc 1
E = ρ Cp Tmin + c
6 4
Where S is the volume inside the sphere of radius R: x2 + y 2 + z 2 ≤ R2 . Same as with the area of the disc,
the volume of the sphere will be much easier to compute once we see how to make multidimensional changes
of variable, but let us keeping all cartesian for sake of practice. The tricky part is, as usual, to set up the
integration contour. Let us first look at one of the cartesian coordinates, given the symmetry of the problem
we would get the same kind of expressions no matter which variable we decide to integrate first.
Figure 5.7: Differential volume elements in the x coordinate which sum up to the volume of the sphere.
Z R Z √
R2 −x2 Z √R2 −x2 −y2 Z R Z √
R2 −x2 Z √R2 −x2 −y2 Z R Z √
R2 −x2 p
I= dx √ dy √ dz = 2 dx √ dy dz = 2 dx √ dy R2 −x2 −y 2
−R − R2 −x2 − R2 −x2 −y 2 −R − R2 −x2 0 −R − R2 −x2
where we have made use of the fact that the integrand is even in z. The new integrand is also even in y, so
we can write √
Z R Z R2 −x2 p
I=4 dx dy R2 −x2 −y 2
−R 0
So, substituting all this, the integral over y can be easily done
π
Z R Z
2
2 2
I=4 dx(R − x ) dt cos2 t
−R 0
which is the well known formula for the volume of the sphere.
Now that you know how to compute double and triple integrals, the extension to quadruple and higher level
integrals is straightforward. The difficulties will come from the characterization of the integration boundary,
and the same techniques learnt for two and three variable integrals most certainly work with many-variable
ones.
In single variable integration, we are very much used to changes of variable. Consider, for example, the integral
Z
I = dx f (x)
We know that when we change the variable x to a variable t such that x = x(t), the integral has to be
consistently changed to
Z Z
dx
dx f (x) = dt f [x(t)]
dt
this is to say, not only the function changes from
f (x) → f [x(t)]
In the case of a multivariable function, the effect of the change of variables on the differential element is
not as simple as this. If the change of variables mixes more than one variable at a time, the change of the
differential has to account for the deformation of the volume or surface element.
Let us consider that we have a n variables (x1 , . . . , xn ), and we apply a map to a new whole set of n
variables (u1 , . . . un ) such that
x1 = x1 (u1 , . . . , un )
x2 = x2 (u1 , . . . , un )
..
.
xn = xn (u1 , . . . , un )
We define the Jacobian matrix of the change of variables as the n × n matrix made of the following matrix
elements
∂xi
{Jij } =
∂uj
in other words
∂x ∂x1 ∂x1 ∂x1
1
...
∂u1 ∂u2 ∂u3 ∂un
∂x2 ∂x2 ∂x2 ∂x2
...
J=
∂u1 ∂u2 ∂u3 ∂un
.. .. .. .. ..
. . . . .
∂x ∂xn ∂xn ∂xn
n
...
∂u1 ∂u2 ∂u3 ∂un
We define the Jacobian determinant |J| (or simply, Jacobian) as the absolute value of determinant of the
Jacobian matrix
∂x ∂x1 ∂x1 ∂x1
1
...
∂u1 ∂u2 ∂u3 ∂un
∂x2 ∂x2 ∂x2 ∂x2
...
|J| = Abs ∂u1 ∂u2 ∂u3 ∂un
.. .. .. .. ..
. . . . .
∂x ∂x ∂x ∂xn
n n n
...
∂u1 ∂u2 ∂u3 ∂un
x1 = x1 (u1 , . . . , un )
x2 = x2 (u1 , . . . , un )
..
.
xn = xn (u1 , . . . , un )
any function of x transforms as f [x1 (u1 , . . . , un ), . . . , xn (u1 , . . . , un )], and the differential elements transform
with the Jacobian
dx1 dx2 . . . dxn → du1 du2 . . . dun |J|
For example, let us consider the very simple case of the integral
ZZ
I= dS (xy 2 + x)
D
where D is the area [0, 1] × [0, 3]. We could easily solve this integral
Z 1 Z 3 Z 1
2
I= dx dy (xy + x) = dx 12x = 6
0 0 0
x = 0 ⇒ v = 0, x = 1 ⇒ v = 1, y = 0 ⇒ u = 0, y = 3 ⇒ u = 3v
The differential element will transform with the Jacobian dxdy = dudv|J|, therefore
Z 1 Z 3v
I= dv du |J|(u2 + v)
0 0
Polar coordinates
This is the following change of variables between cartesian coordinates (x, y) to polar coordinates (r, θ)
x = r cos θ
y = r sin θ
These curvilinear coordinates are very well suited for integration of functions with some degree of radial
symmetry, angular symmetry or integration contours with radial symmetry. It can be seen very easily, directly
from Figure 5.9 that the sides of the area element in polar coordinates are r dr and dθ, therefore the surface
element is
dS = r dr dθ
Therefore we can do the change of coordinates in an integral as follows
ZZ ZZ
dx dy f (x, y) = dr dθ r f [x(r, θ), y(r, θ)]
S S
However, a more systematic approach is to compute the Jacobian of the transformation The determinant
of the Jacobian matrix in this case is
∂x ∂x
∂r ∂θ cos θ −r sin θ
det J = =
= r(cos2 θ + sin2 θ) ⇒ |J| = r
∂y ∂y sin θ r cos θ
∂r ∂θ
Example 5.3.1. Let us revisit an old problem: Compute the area of the disc of radius R.
The problem is obviously very well suited for polar coordinates. In these ordinates, the equation of the
circle is as simple as r = R. Therefore the integration limits will be 0 ≤ r ≤ R and 0 ≤ θ ≤ 2π. The integral
then will be Z R Z 2π Z R
R2
S= dr dθ r = 2π dr r = 2π = πR2
0 0 0 2
Example 5.3.2. Find the integral of f (x, y) = xy in the first quarter of the unit circle
In polar coordinates f (r, θ) = r2 sin θ cos θ, and in the unit circle, r goes from 0 to 1 and, in the first
quarter, θ only runs half its domain from 0 to π/2
The problem is obviously very well suited for polar coordinates. In the second quadrant, the quarter of
circle will be defined by 0 ≤ r ≤ R and 0 ≤ θ ≤ π/2. The integral then will be
Z 1 Z π Z R π
1 1
Z
3 1 1
2 2
3 2
I= dr dθ r sin θ cos θ = dr r sin θ = dr r3 =
0 0 0 2 0 2 0 8
Example 5.3.3. Find the area of the ellipse of semiaxes a and b. It’s equation is
x2 y 2
+ 2 =1
a2 a
In this case, the change of variables that simplifies the integration contour is slightly different from the usual
polar change. Let us propose the following change
x = ar cos θ
y = br sin θ
The equation of the ellipse in these polar coordinates is simply (by substituting int he equation)
r=1
Cylindrical coordinates
This is the following change of variables between cartesian coordinates (x, y, z) to polar cylyndrical coordinates
(r, θ, z)
x = r cos θ
y = r sin θ
z=z
These curvilinear coordinates are very well suited for integration of functions with some degree of cylindrical
symmetry, angular symmetry in sections of constant z or integration contours with cylindrical symmetry. It
can be seen very easily, directly from Figure 5.10 that the sides of the volume element in polar coordinates
are r dr, dθ and dz, therefore the volume element is
dV = r dr dθ dz
However, a more systematic approach is to compute the Jacobian of the transformation. The determinant
of the Jacobian matrix in this case is
∂x ∂x ∂x
∂r ∂θ ∂z cos θ −r sin θ 0
∂y ∂y ∂y
det J = = sin θ r cos θ 0 = r(cos2 θ + sin2 θ) ⇒ |J| = r
∂r ∂θ ∂z
∂z ∂z ∂z 0 0 1
∂r ∂θ ∂z
over the region U enclosed by the surface x2 + y 2 = 1 and the planes z = 0 and z = 1
Writing the integrand in cylindrical coordinates is trivial If one quickly realizes that
x4 + 2x2 y 2 + y 4 = (x2 + y 2 )2 = r4
| {z }
r2
The integration region is rather simple in this case, as shown in figure 5.11. r goes from 0 to 1, θ goes
from 0 to 2π and z goes from 0 to 1, therefore
Z 1 Z 2π Z 1 Z 1 1
5 5 r6 π
I= dr r dθ dz = 2π dr r = 2π =
0 0 0 0 6 0 3
Example 5.3.5. A bit more challenging: Find the integral of the function f (x, y, z) = x2 + y 2 in the volume
U contained inside the paraboloid x2 + y 2 = 3z and the plane z = 3
Given the symmetry of the integrand, it seems cylindrical coordinates may simplify the integral quite a
bit. Thus, we want to compute the integral
ZZZ ZZZ ZZZ
2 2 2
I= dV (x + y ) = dr dθ dz |J| r = dr dθ dz r3
U U U
Now to set up the integration contours we can take a look at Figure 5.12.
To get the integration contours we need to know the form of the surface of the paraboloid, which is
x2 + y 2 = 3z, in cylindrical coordinates: the equation of the paraboloid is
x2 + y 2 = 3z ⇒ r2 cos2 θ + r2 sin2 θ = 3z ⇒ r2 = 3z
Now, we can integrate deciding which variable is better to integrate first. Since I prefer to avoid square roots
if possible, I am going to integrate first with respect to z. According to Fig. 5.12, the z coordinate rums from
the surface of the paraboloid to the plane z = 3, therefore, it runs from r2 /3 to 3. Then r runs from 0 to 3
and θ runs over all its range:
Z 3 2π 3 Z 3 1 Z 3 3
r2
4
r6
Z Z Z
3 3 3 3r 4 3 81π
I = dr r dθ dz = 2π dr r dz = 2π dr r 3 − = 2π − =3 π −1 =
0 0 r2
0 r2
0 3 4 18 0 2 2
3 3
p
Example 5.3.6. Find the integral of the function f (x, y, z) = x2 + y 2 in the volume U bounded by the
paraboloid z = 4 − x2 − y 2 , the cylinder x2 + y 2 = 4 and the planes z = 0, y = 0.
Again, cylindrical coordinates seem appropriate to solve this integral:
ZZZ p ZZZ ZZZ
I= 2
dV x + y = 2 dr dθ dz |J| r = dr dθ dz r2
U U U
Now to set up the integration contours we can take a look at Figure 5.13.
To get the integration contours we need to know the form of the surface of the paraboloid, which is
z = 4 − x2 − y 2 , in cylindrical coordinates: the equation of the paraboloid is
z = 4 − x2 − y 2 ⇒ z = 4 − r 2
From the figure we see it’s most convenient to integrate over z first. z goes from z = 0 to the surface of the
paraboloid, therefore the limits on z will be from z = 0 to z = 4 − r2 . We see that once z is integrated, r goes
from r = 0 to r = 2, and finally, θ has to cover half the complete circle, therefore θ goes from 0 to π:
Z 2 Z π Z 4−r2 Z 2 4−r2 Z 3 3 2
r5
Z
2 2 2 2
4r 5 1 1 64π
I = dr r dθ dz = π dr r dz = π dr r 4 − r = π − =2 π − =
0 0 0 0 0 0 3 5 0 3 5 15
Example 5.3.7. Find the integral of the function f (x, y, z) = y in the volume U bounded by the planes
z = x + 1, z = 0 and between the cylindrical surfaces x2 + y 2 = 1 and x2 + y 2 = 4
Once again, cylindrical coordinates seem appropriate to solve this integral:
ZZZ ZZZ ZZZ
I= dV y = dr dθ dz |J| r sin θ = dr dθ dz r2 sin θ
U U U
Now to set up the integration contours we can take a look at Figure 5.14.
To get the integration contours we need to know the form of the integration boundaries in cylindrical
coordinates:
• z = x + 1 ⇔ z = r cos θ + 1
• z=0
• x2 + y 2 = 1 ⇔ r = 1
• x2 + y 2 = 4 ⇔ r = 2
From the figure we see it’s most convenient to integrate over z first. z goes from z = 0 to the plane z = x + 1,
or in cylindrical coordinates z = r cos θ + 1, therefore the limits on z will be from z = 0 to z = r cos θ + 1.
We see that once z is integrated, r goes from r = 1 to r = 2, and finally, θ has to cover the complete circle,
therefore θ goes from 0 to 2π:
Z 2 Z 2π Z r cos θ+1 Z 2 Z π Z 2 Z π Z 2 Z π
2 2 3 2
I = dr r dθ sin θ dz = dr r dθ sin θ(r cos θ+1) = dr r dθ sin θ cos θ+ dr r dθ sin θ
0 0 0 0 0 0 0 0 0
We need to integrate no more: the integrals over theta are directly zero
Z 2π 2π Z π
1 2
2π
dθ sin θ cos θ = sin θ = 0, dθ sin θ = − cos θ = 0
0 2 0 0 0
Although need not integrate them! those are integrals of odd functions over a symmetric interval! Thus, they
are directly zero, therefore.
I=0
This result could have been easily predicted beforehand: the whole integration contour is symmetric with
respect to the y = 0 plane and f (x, y, z) = y is an odd function.
Spherical coordinates
Another way to characterize a point in a three-dimensional space by giving its distance to the origin, the polar
angle and the azimuthal angle, as depicted in Fig. 5.15. The following is the change of variables between
cartesian coordinates (x, y, z) to polar cylindrical coordinates (r, θ, z)
x = r sin θ cos φ
y = r sin θ sin φ
z = r cos θ
These curvilinear coordinates are very well suited for integration of functions with some degree of spherical
symmetry, equatorial or azimuthal symmetry or integration contours with spherical symmetry. It can be seen
very easily, directly from Figure 5.15 that the sides of the volume element in spherical coordinates are dr, r dθ
and r sin θ dφ, therefore the volume element is
dV = r2 sin θ dr dθ dφ
However, a more systematic approach is to compute the Jacobian of the transformation. The determinant
of the Jacobian matrix in this case is
∂x ∂x ∂x
∂r ∂θ ∂φ sin θ cos φ r cos θ cos φ −r sin θ sin φ
∂y ∂y ∂y
det J = = sin θ sin φ r cos θ sin φ r sin θ cos φ
∂r ∂θ ∂φ
∂z ∂z ∂z
cos θ
−r sin θ 0
∂r ∂θ ∂φ
Computing the determinant using the adjoints method with the third row
det J = r2 cos θ cos2 φ sin θ cos θ + sin2 φ sin θ cos θ +r2 sin θ sin2 θ cos2 φ + sin2 θ sin2 φ
| {z } | {z }
sin θ cos θ sin2 θ
Yielding
det J = r2 sin θ(cos2 θ + sin2 θ) = r2 sin θ
Therefore we know that
dV = dx dy dz = dr dθ dφ |J| = dr dθ dφ r2 sin θ
Example 5.3.8. Revisiting and old friend: compute the volume of the sphere of radius R.
We would like to integrate the volume element
ZZZ
V = dV
Sphere
over the sphere of radius R. We already did that in cartesian coordinates, and was long and tedious. How
about writing the volume and the contour in spherical coordinates. The contour is rather easy: r goes from
r = 0 to r = R. The polar angle runs over all its possible values θ = 0 to θ = π and the azimuthal angle runs
over the whole domain too, φ = 0 to φ = 2π, therefore
ZZZ ZZZ Z R Z π Z 2π Z R Z π
2 2 2
V = dV = dr dθ dφ r sin θ = dr r dθ sin θ dφ = 2π dr r dθ sin θ
Sphere Sphere 0 0 0 0 0
ρ(x, y, z) = (x2 + y 2 + z 2 )2
Calculate the mass of an object of the shape of an eight of a sphere of radius 1 made of that material.
The function is totally symmetric with respect to sign changes in any of the coordinates, this means it
does not matter in which octant we place the quarter of sphere. Let us place it in the first octant as shown in
Figure 5.17
The integration region is again rather simple in this case, as shown in figure 5.17. r goes from 0 to 1, θ
goes through half its range (from the pole to the equator) from 0 to π/2 and φ goes through a quarter of its
range, from 0 to π/2, therefore
Z 1 Z π Z π
2 2
M= dr dθ dφ r2 sin θ ρ[x(r, θ, φ), y(r, θ, φ), z(r, θ, φ)]
0 0 0
The integrand ρ(z, y, z) has a very simple expression in spherical coordinates, since x2 + y 2 + z 2 = r2 ,
ρ(r, θ, φ) = r4
hence π π 1 h
1
r7 iπ π
Z Z Z
6
2 2 2 π
M= dr r dθ sin θ dφ = − cos θ =
0 0 0 7 0 0 2 14
Example 5.3.10. Find the volume of an ellipsoid of semiaxes a, b, c, depicted in Fig. 5.17
The equation of an ellipsoid of semiaxes a, b and c is
x2 y 2 z 2
+ 2 + 2 =1
a2 b c
In this occasion, it is convenient to cook up our own change of coordinates to simplify the problem. Much in
the same fashion as in the case of elliptical coordinates, we can define now ellipsoidal coordinates that capture
the symmetries of the elliptical contour
x = a r sin θ cos φ
y = b r sin θ sin φ
z = c r cos θ
Being a bit clever, we don’t need to go over the whole Jacobian calculation again. If we observe that the
Jacobian determinant will be almost identical to the spherical coordinates case, only that each row is going
to be multiplied by a, b and c respectively
where the partial derivatives of x0 , y 0 , z 0 here correspond to the spherical coordinates derivatives . Using the
properties of determinants
Notice that these coordinates are not the same as Spherical coordinates and as such, r, for instance, does
not represent the usual isotropic radial coordinate. We need to rewrite the equation of the ellipsoid in these
elliptical coordinates, it is straightforward to see that this equation is simply
r=1
therefore
ZZZ Z 1 Z π Z 2π Z 1 Z π
2 2 2
V = abc dr dθ dφ r sin θ = abc dr r dθ sin θ dφ = 2π dr r dθ sin θ
Ellipsoid 0 0 0 0 0
Substituting we get
R6 R6
1 1
I= · − · =−
6 4 2 48
A vector field is a vector function of many variables. I.e. A vector whose magnitude and orientation depends
on the point of space
F(x) ≡ F(x1 , . . . , xn )
These vector functions map vectors in Rn to vectors in Rm . For example, commonly we could have maps from
R2 to R2 or R3 to R3
Fx (x, y, z)
F(x, y, z) = Fy (x, y, z)
Fz (x, y, z)
when a vector field depends on space, or maps from R4 to R3 when the vector field depends on time
Fx (x, y, z, t)
F(x, y, z, t) = Fy (x, y, z, t)
Fz (x, y, z, t)
Examples of vector fields in Physics are the gravitational or electrostatic field (see for instance Fig. 5.18), or
the velocity of a fluid (see for instance Fig. 5.19) or any force field.
Figure 5.18: Gravitational field created by a mass at the origin and electrostatic field created by a positive
charge
Divergence
The divergence of a vector field F(x, y, z) is defined as the dot product of the nabla operator with the vector
field
∂Fx ∂Fy ∂Fz
∇·F = + +
∂x ∂y ∂z
It represents the amount of ‘density’ of the generators of the vector field (density of fluid, density of mass,
density of charge....) which enters or exists a differential region of space per unit volume.
F = x2 y i + xz 2 j + zx k
Figure 5.19: Velocity field in a fluid flowing uniformly in a given direction and moving around a vortex
It is convenient to find expressions for the divergence in cylindrical and spherical coordinates. To do that
we express the canonical vectors in cylindrical (êr , êθ , k) and spherical (êr , êθ , êφ ) in terms of the canonical
vectors in cartesian coordinates (i, j, k), and taking into account that, contrary to cartesian canonical vectors,
the point to different directions depending of their position in space, we have to carefully compute all the
nested derivatives. The result is as follows.
Fr
F(r, θ, z) = Fθ
Fz
the divergence is
1 ∂ 1 ∂Fθ ∂Fz
∇·F= (rFr ) + +
r ∂r r ∂θ ∂z
Fr
F(r, θ, φ) = Fθ
Fφ
the divergence is
1 ∂ 2 1 ∂ ∂Fφ
∇·F= (r Fr ) + (sin θFθ ) +
r2 ∂r r sin θ ∂θ ∂φ
Curl
The divergence of a vector field F(x, y, z) is defined as the cross product of the nabla operator with the vector
field
i j k
∂ ∂ ∂ ∂Fz ∂Fy ∂Fx ∂Fz ∂Fy ∂Fx
∇×F = = − i + − j + − k
∂x ∂y ∂z ∂y ∂z ∂z ∂x ∂x ∂y
F Fy Fz
x
It is the vector characterizing the amount and direction of rotation of a vector field in an infinitesimally small
region.
Same as before, it is useful to provide expressions for the curl in cylindrical and spherical coordinates.
They are obtained following the same procedure as with the divergence.
There are a few important identities which are very easy to prove and they are extremely useful in math and
physics
The curl of the gradient of any scalar field (function) V (x, y, z) is always zero
∇ × (∇V ) = 0
The divergence of the curl of any vector field A(x, y, z) is always zero
∇ · (∇ × A) = 0
The curl of the curl of any vector field A(x, y, z) can be expressed in terms of the gradient of its divergence
and its Laplacian
∇ × (∇ × A) = ∇(∇ · A) − ∇2 A
where
∂2 ∂2 ∂2
∇2 = ∇ · ∇ = 2
+ 2+ 2
∂x ∂y ∂z
A line integral, sometimes called path integral, curve integral or curvilinear integral, is an integral of a vector
function along a curve in space. It can be seen as the sum of all the infinitesimal projections of the vector
field along the infinitesimally small line tangent to the curve at every point.
Consider the parametric curve C defined by
x(t)
rC (t) = y(t)
z(t)
drC
Given that the tangent vector to the curve rC (t) is the velocity vector v = , the projection of the vector
dt
field F(x, y, z) onto the tangent to the curve will be the dot product of F(r) (evaluated on the curve) with the
velocity vector
drC
F(rC ) ·
dt
if we want to sum up all the infinitesimal projections alongside the curve from the points where t = a to t = b
(this is, r(a), r(b)) in infinitesimally small increments dt we get
Z
drC
I= F[rC (t)] · dt
C dt
which is the line integral of F alongside the curve. The usual notation, which is of course self-consistent, is
Z Z r(b) Z b
drC
I= F(r) · dr = F (r) · dr = F[rC (t)] · dt
C r(a) a dt
Example 5.5.1. Consider the vector field
xyz
F(x, y, z) = y 2
z
First we need to compute F · v(t). Since x(t) = t, y(t) = t, z(t) = t we get that
3
t 1
t2 dr(t)
F(x, y, z) = , v(t) = =1
dt
t 1
Therefore
F · v = t3 + t2 + t
Substituting in the line integral
Z b Z 1 Z 1
1 1 1 13
F · dr = F · v(t) dt = (t3 + t2 + t) dt = + + =
a 0 0 4 3 2 12
Application: Work
Imagine that we want to compute the work done when moving a mass through a given force field F. We know
that for constant forces and displacements
W = F · ∆r
But what if the force field varies at every single point of space? What if the displacement is not a uniform
trajectory (think of the gravitational field, for example). We need to sum all the small elements of work along
the movement of the particle, describing a curve r(t).
The work done against (or by) a force field to move a mass along a curve C from a point r(a) to r(b) will
be given by
Z Z b
dr
W = F(r) · dr = F[r(t)] · dt
C a dt
Example 5.5.2. Prove that the work done by any force field F(x, y, z) going on an arbitrary trajectory r(t)
between the times t = a and t = b is equal to the change of kinetic energy between these two times:
1
∆EK = m [v(b)]2 − [v(a)]2
2
We know that Z Z Z
dr
W = F(r) · dr = F· dt = F · v dt
C C dt C
Now, from Newton’s second Law F = m a:
Z Z
dv
W =m a · v dt = m · v dt
C C dt
An extremely interesting remark: What if the vector field F is the gradient of a scalar field (a scalar function):
F(x, y, z) = ∇V (x, y, z)
Consider that we want to integrate this gradient field along a curve r(t) from t = a to t = b. This will be
Z r(b) Z b
dr
I= F(r) · dr = ∇V (r) · dt
r(a) a dt
Let us first make the following observation, If we compute the total derivative of V (x, y, z) along the curve
r(t) with respect to t we get
dV [r(t)] dV [x(t), y(t), z(t)] ∂V dx ∂V dy ∂V dz dr
= = + + = ∇V ·
dt dt ∂x dt ∂y dt ∂z dt dt
dr dV [r(t)]
therefore, we can substitute ∇V · by in the line integral, yielding
dt dt
Z b
dV [r(t)]
I= dt = V [r(b)] − V [r(a)]
a dt
So, the line integral of a gradient field only cares about the starting point r(t = a) and the ending point
r(t = b), and does not care about the different trajectories that we use to connect these two points.
We call these fields that satisfy that F = ∇V gradient fields or conservative fields.
As an observation, the gravitational field or the electrostatic fields are conservative fields, so the work done
when moving subjected to these forces is independent of the path, only depends on the value of the potential
V at the beginning and the end of the path.
Example 5.5.3. Consider the potential V (x, y, z) = x2 + y 2 + z and the force field
2x
F = ∇V = 2y
1
Compute the work done to move a mass from the point (0, 0, 0) to the point (1, 2, 4), first using the fact that
this is a conservative field (F = ∇V ), and then performing the line integral over these two different paths
1
t 2t
r = 2t , and r= t
4t t2
Since we are integrating a conservative field, we know that the line integral in this case will be just the
difference between the value of the potential at the end of the trajectory and at the starting point
Z
I= F · dr = V [r(b)] − V [r(a)] = V (1, 2, 4) − V (0, 0, 0) = 9 − 0 = 9
C
And this is independent of the trajectory we choose to go from one place to the other.
Now, let us compute it explicitly for the two trajectories given. For the first one
t
r = 2t
4t
we obtain that the extremes (0, 0, 0) and (1, 2, 4) correspond respectively to t = 0 and t = 1, therefore
Z 1 Z 1
dr(t)
I= F · dr = F· dt
0 0 dt
Which, of course, coincide with the potential evaluation we did in the first place.
Now, for the second trajectory
1
2t
r= t
t2
we obtain that the extremes (0, 0, 0) and (1, 2, 4) correspond respectively to t = 0 and t = 2, therefore
Z 2 Z 1
dr(t)
I= F · dr = F· dt
0 0 dt
Which, of course, coincide with the potential evaluation we did in the first place and the previous result.
If the integration path is a closed loop, the starting and end points coincide r(a) = r(b). We call the line
integrals over closed loops circulations, and we use a special notation for them
I
F · dr
C
The convention is that the integration in this case is done counterclockwise, i.e. the interior of the loop is
always on the left when looking in the direction of the tangent vector to the curve, as shown in Figure 5.20
Figure 5.20: Circulation of a vector field F. T̂ represents the tangent vector to the curve at each point.
From the previous result, we know that the circulation of any conservative field (F = ∇V ) is zero, since it
will be the difference between the potential evaluated at the beginning and end of the trajectory, and in the
case of a circulation, both points coincide.
Intuitively, we can also say that if the vector field does not change of direction, the circulation will also
be zero, since we will be adding up as much of positive components (one way trip) as negative components
(return trip)
Example 5.5.4. Consider the circular trajectory
! !
R cos t dr −R sin t
r= ⇒ =
R sin t dt R cos t
Compute the circulation of the following vector fields along the circular trajectory
F1 = K i
K
F2 = K êr = p (x i + y j)
x + y2
2
F3 = K(−y i + x j)
• First case
We can anticipate this circulation will be zero since the vector field is constant, graphically it is easy to see
from Fig. 5.21 it is very easy to compute the circulation
I I Z 2π
I= F1 · dr = F1 · v dt = −KR dt sin t = 0
C C 0
• Second case
We can anticipate this circulation will also be zero since the vector field is always perpendicular to the
integration path, graphically it is easy to see from Fig. 5.22 it is very easy realize that since F2 only has
radial component and the tangent to the trajectory always points in the direction of êθ , since er · eθ = 0, then
F2 · v = 0. it is also trivial to see if one doesn’t realize of this and does the brute force calculation. Therefore
I I
I= F2 · dr = F2 · v dt = 0
C C
• Third case
K
Figure 5.22: Vector field F2 = √ (x i + y j) and circular integration path r(t).
x2 +y 2
Figure 5.23: Vector field F3 = K(−y i + x j) and circular integration path r(t).
We can anticipate this circulation will not be zero since the vector field varies non equally along the trajectory,
as shown in Fig. 5.23 The vector field along the trajectory is
therefore I I Z 2π
I= F3 · dr = F3 · v dt = KR2 dt = 2πKR2
C C 0
A surface (or flux) integral of a vector field F across a surface S is the sum of all the infinitesimally components
perpendicular to the surface element dS of the vector field F, summed over the whole surface S.
In other words, the integral accounts for the flux of F that crosses the surface S. Obviously, if the vector
field is parallel to the surface, there is no flux going across it. The flux will be maximal when the surface is
perpendicular to the vector field.
We define the oriented area element as follows
dS = n̂ dS
where n̂ is a unit vector orthogonal to the surface. The differential flux of a vector field F which crosses the
differential surface element dS is the projection of F along the direction orthogonal to the surface, therefore
dΦ = F · dS = F · n̂ dS
The total flux will be the integral over the whole surface S of these differential flux elements
ZZ ZZ
Φ= F · dS = F · n̂ dS
S S
Similar to line integrals, if the surface of integration is closed, we notate the flux integral as
ZZ
Φ =
F · dS
S
If F represents, for instance, the velocity field of a fluid, the flux integral tells us how much fluid per unit
time goes through a given surface (membrane, pipe, etc...).
Notice that the surface element dS is oftentimes notated also as dA.
Figure 5.24: Element of surface on a sphere of radius r. Notice that r here is a constant, and not a variable
(we are moving on the sphere of constant radius)
dS = R2 sin θ dθ dφ
The surface integral is then written as
ZZ ZZ p ZZ Z 2π Z π
2 3
Φ =
F · dS =
2 2 2
x + y + z dS =
dθ dφ R R sin θ = R dφ dθ sin θ = 4πR3
Sphere Sphere Sphere 0 0
This theorem (formulated by Lord Kelvin) relates the surface integral of the curl of a vector field F over a
surface S to the line integral of the vector field along its boundary ∂S. Concretely
ZZ I
∇ × F · dS = F · dr
S ∂S
This result is most interesting, since this is telling us that if we have a rotational field A = ∇ × F, the flux
of A through surface only depends on the boundary of the surface. There is an infinite number of different
surfaces which have the same boundary, for example, check for example Figure 5.25
Figure 5.25: The flux of the field v in this figure is the same through the surface S1 and the surface S2 , which
share the same boundary.
F (x, y, z) = y i + z j + x k
along the quarter-of-a-circle trajectory depicted in Figure 5.26. We can indeed compute the line integral easily
enough, in this case, dividing the integration path in three intervals as shown in Figure 5.26
I Z Z Z
F · dr = F · dr + F · dr + F · dr
1
4
Circle C1 C2 C3
dr1
r1 (t) = t k, 0≤t≤1 ⇒ v1 (t) = =k
dt
therefore
F[r1 (t)] · v1 = 0
we now that the first line integral is zero
Z
F[r1 (t)] · dr = 0
C1
dr1
r3 = t j, 0≤t≤1 ⇒ v3 (t) = =j
dt
F along this curve gives
F[r3 (t)] = F(0, t, 0) = t i
therefore
F[r3 (t)] · v3 = 0
we now that the third line integral is zero
Z
F[r3 (t)] · dr = 0
C3
Finally, the line integral along C2 will not be zero. We can parametrize the curve
dr1
r2 = sin t j + cos t k, 0 ≤ t ≤ π/2 ⇒ v2 (t) = = cos t j − sin t k
dt
F along this curve gives
F[r2 (t)] = F(0, sin t, cos t) = sin t i + cos t j
therefore
F[r2 (t)] · v2 = cos2 t
and the line integral through the surface defined by the quarter of circle z 2 + y 2 ≤ 1 with y ≥ 0 and z ≥ 0.
Z Z Z π Z π
2
2 1 2 π
F · dr = F · v2 dt = dt cos t = dt (1 + cos 2t) =
C2 C2 0 2 0 4
We can now compute the same thing using Stokes theorem, we can compute this line integral as a surface
integral whose boundaries are defined by the quarter of a circle line
I ZZ
F · dr = ∇ × F · dS
1
4
Circle
A · dS = A · n̂ dS = dS
which we can express in polar coordinates for y and z: y = r cos θ, z = r sin θ, therefore
π 1
1
π r2
ZZ Z Z
2 π
Φ= r dr dθ = dr r dθ = =
1
Circle 0 0 2 2 0 4
4
Gauss theorem, also known as divergence theorem was first formulated by Lagrange and rediscovered by Gauss
50 years after. It relates the flux of a vector field through a surface with the behaviour of the vector field
inside the space bounded by the surface:
ZZZ ZZ
(∇ · F) dV =
F · dS (5.7.1)
V ∂V
Example 5.7.2. Suppose that we wish to evaluate the flux of a vector field F = x i + y j + z k through the
unit sphere. We can indeed do the surface integral
ZZ ZZ
Φ =
F · dS =
F · n̂ dS
S S
we know that the normal vector to the sphere is a vector point in in the radial direction
1
n̂ = p (x i + y j + z k)
x2 + y 2 + z 2
The product of the vector field and the normal function to the sphere gives
x2 + y 2 + z 2 p
F · n̂ = p = x2 + y 2 + z 2
x2 + y 2 + z 2
We want to evaluate this on the surface of the unit sphere, but this quantity is constant on that sphere whose
equation is x2 + y 2 + z 2 = 1, so, on the sphere
F · n̂ =
˙ 1
And we remember that the surface element of a sphere of radius R was dS = R2 sin θ dθ dφ therefore, for the
sphere of radius 1,
dS = sin θ dθ dφ
We could have computed this flux using Gauss theorem in a simpler way. We know from gauss theorem
that ZZZ
Φ= (∇ · F) dV
V
4
But we already know that the volume of the sphere is V = πR3 , for the sphere of radius 1 this means that
3
4
Φ = 3 π = 4π
3
Obviously the same result as before.
and that we know that the gradient of ψ2 (x, y, z) is a complicated function but the gradient of ψ( x, y, z) is a
simple function. Can we just write the following?
ZZZ ZZZ
dV ψ1 (x)∇ψ2 (x) = − dV [∇ψ1 (x)]ψ2 (x)
R3 R3
So the two integrals only differ in a surface term. The surface is, in this case, the sphere (or cube) of infinite
radius (or side), if my functions decay rapidly enough when x, y, z → ∞, the function will have a value of zero
at this infinite boundary, so the surface term is zero and we obtain
ZZZ ZZZ
· dV ψ1 (x)∇ψ2 (x) = −· dV [∇ψ1 (x)]ψ2 (x)
R3 R3