2  Integrating scalar fields

A scalar field in \(\Real^3\) can be integrated over a 1-d curve, a 2-d surface, or a 3-d volume.

2.1 Curves

Before we integrate along a curve, we need to know how to describe a curve mathematically.

A curve \(C\) is a 1-d subset of \(\Real^3\).

In practice, we describe \(C\) by a parametrisation, \(\xb(t)\), which maps a real interval \([a,b]\) into \(\Real^3\). Different parametrisations of the same curve trace it out at different rates - or even in opposite directions - as the parameter \(t\) is varied.

For two (fixed) vectors \(\ab, \bb\in\Real^3\), the parametrisation \(\xb(t)=\ab + t(\bb-\ab)\) for \(t\in[0,1]\) represents the straight line \(C\) between positions \(\xb=\ab\) and \(\xb=\bb\).

Another possible parametrisation for the same straight line \(C\) would be \(\xb(\tau)=\ab + \sin\tau(\bb-\ab)\) with \(\tau\in[0,\frac{\pi}{2}]\).

Straight line segment.

We know that the circle can be described by a single parameter if we change to polar coordinates \((r, \theta)\), where \(x=r\cos\theta\) and \(y=r\sin\theta\).

Circle.

Then \[ x^2 + y^2 = 1 \quad \implies r^2(\sin^2\theta + \cos^2\theta)=1 \quad \implies r=1. \] But then \(x=\cos\theta\) and \(y=\sin\theta\), so we can set \(t=\theta\) and we have the parametrisation \(\xb(t)=\cos t\,\eb_1 + \sin t\eb_2\) with \(t\in[0,2\pi]\).

If we didn’t know the polar coordinate trick, we could have tried writing \(y(x)\) and using \(x\) as the parameter. Then re-writing the equation would give \(y = \pm\sqrt{1 - x^2}\). To obtain the circle, we need to trace two separate segments, so one suitable parametrisation would be \[ \xb(t) = \begin{cases} (-1-t)\eb_1 + \sqrt{1-(-1-t)^2}\eb_2 & \textrm{for $t\in[-2,0]$},\\ (t-1)\eb_1 - \sqrt{1-(t-1)^2}\eb_2 & \textrm{for $t\in[0,2]$}. \end{cases} \]

If the curve does not cross itself it is called simple.

If \(\xb(a)=\xb(b)\) it is called closed.

Helix.

This curve is not closed, because \(\xb(6\pi)\neq\xb(0)\). It is simple because it doesn’t cross itself.

Clover.

This curve is closed, because \(\xb(\pi)=(-1)^2\eb_1 = \eb_1 = \xb(0)\).

The curve is not simple, because it intersects at the origin – in fact it is a triple intersection, and you can check that \(\xb(\pi/6)=\xb(\pi/2)=\xb(5\pi/6)=\bfzero\).

If the path is sufficiently smooth, we can define the derivative \[ \ddt{\xb} = \lim_{\delta t\to 0}\frac{\xb(t + \delta t) - \xb(t)}{\delta t}. \tag{2.1}\] This is called the tangent vector, because it points along the curve.

Tangent vector.

A parametrised curve \(\xb(t)\) is called regular if \(\displaystyle\ddt{\xb}\) is everywhere non-zero.

The first parametrisation \(\xb(t)=\ab + t(\bb-\ab)\) gives \(\displaystyle\ddt{\xb}=\bb-\ab\).

The alternative parametrisation \(\xb(\tau)=\ab + \sin\tau(\bb-\ab)\) gives \(\displaystyle\frac{d\xb}{d\tau} = \cos\tau(\bb-\ab)\). Notice that the tangent vector has the same direction but different magnitude, because this parametrisation traces out the curve at a different rate.

The unit circle parametrisation \(\xb(t)=\cos{t}\eb_1 + \sin{t}\eb_2\) gives \(\displaystyle\ddt{\xb}=\sin{t}\eb_1 + \cos{t}\eb_2\). (The basis vectors \(\eb_1\), \(\eb_2\) are constant vectors, so are not touched by the derivative.)

We can relate the tangent vectors obtained by different parametrisations of the same curve using the chain rule. For two such paths \(\xb(t)\) and \(\xb(\tau)\), we have \[ \ddt{\xb} = \frac{d\xb}{d\tau}\ddt{\tau}. \tag{2.2}\]

For the two straight line parametrisations, we have \[ \xb(t) = \xb(\tau) \quad \implies t=\sin{\tau} \quad \implies \frac{dt}{d\tau} = \cos{\tau}. \] The chain rule then gives \(\displaystyle\ddt{\xb} = \frac{d\xb}{d\tau} \frac{1}{\cos{\tau}}\), in agreement with what we just found.

There is a special parametrisation \(\xb(s)\), called arclength where the corresponding tangent vector is a unit vector, \[ \left|\dds{\xb}\right|=1 \tag{2.3}\] everywhere along the curve. To explain the name, note that when \(t=s\), Equation 2.1 shows that \(\delta s\approx |\xb(s+\delta s) - \xb(s)|\). It follows that the length of the curve C between \(s=0\) and \(s=\ell\) is \[ \lim_{n\to\infty}\sum_{i=1}^n|\xb(s_i + \delta s) - \xb(s_i)| = \lim_{n\to\infty}\sum_{i=1}^n\delta s = \int_{0}^{\ell}\,ds = \ell. \]

Breaking a curve into segments.

This is an example of a “line integral”…

A curve which has finite length is called rectifiable. This is a weaker condition than “regular” (for example, if \(\xb(t)\) is Lipschitz continuous then it is rectifiable).

One example of a non-rectifiable curve is the Hilbert curve, which is space filling (so cannot have a finite length):

Constructing the Hilbert curve.

Arclength may be thought of as the only “natural” parametrisation of a curve, because it is intrinsically defined by the curve itself.

2.2 Line integrals

If \(f(\xb)=f(x,y,z)\) is a scalar field and \(C\) is a regular arc of a simple curve with arclength parametrisation \(\xb=\xb(s)\) for \(s\in[0,\ell]\), we define the line integral of \(f\) along \(C\) as \[ \int_Cf(\xb)\,ds = \int_0^\ell f(x(s),y(s),z(s))\,ds. \]

A regular arc means a section of curve along which the tangent vector is well-defined.

Integrating this along any curve \(C\) gives the length of the curve \(\int_C\,ds=\int_0^\ell\,ds=\ell\), as we have seen.

To actually calculate a line integral, we usually choose a more convenient parametrisation \(\xb(t)\). Then changing variables gives \[ \int_C f\,ds = \int_a^b f\big(\xb(t)\big)\ddt{s}\,dt = \int_a^b f\big(\xb(t)\big)\left|\ddt{\xb}\right|\,dt, \] where the last step used Equation 2.2 and Equation 2.3.

The result doesn’t depend on the particular parametrisation \(\xb(t)\) chosen, although to get the correct sign we must write the limits so that \(b>a\).

The tangent vector to the given path is \[ \ddt{\xb} = -\sin{t}\eb_1 + \cos{t}\eb_2 + \eb_3 \quad \implies \left|\ddt{\xb}\right|=\sqrt{\sin^2{t} + \cos^2{t} + 1} = \sqrt{2}. \] So \[ \int_C\,ds = \int_0^{2\pi}\left|\ddt{\xb}\right|\,dt = \sqrt{2}\int_0^{2\pi}\,dt = 2\sqrt{2}\pi. \]

The tangent vector is the same, but now we calculate \[\begin{align*} \int_Cf\,ds &= \int_0^{2\pi}(xy+z)\left|\ddt{\xb}\right|\,dt = \int_0^{2\pi}(\cos{t}\sin{t} + t)\sqrt{2}\,dt\\ &= \sqrt{2}\int_0^{2\pi}\left(\frac12\sin{2t} + t\right)\,dt=2\sqrt{2}\pi^2. \end{align*}\]

If the curve \(C\) is composed of a number of regular arcs, then an integral must be calculated for each arc.

If \(\xb(0)=\xb(\ell)\) then the curve is closed and the integral is written \[ \oint_C f(\xb)\,ds. \]

Since the tangent vector is not well defined at the vertices, we must split the curve into four arcs, \(C_1\), \(C_2\), \(C_3\), \(C_4\) as in the diagram:

Definition of four arcs.

Parametrisations for each arc are: \[\begin{align*} &\textrm{For $C_1$:} \quad \xb_1(t)=(t-1)\eb_1 - \eb_2, \quad t\in[0,2],\\ &\textrm{For $C_2$:} \quad \xb_2(t)=\eb_1 + (t-1)\eb_2, \quad t\in[0,2],\\ &\textrm{For $C_3$:} \quad \xb_3(t)=(1-t)\eb_1 + \eb_2, \quad t\in[0,2],\\ &\textrm{For $C_4$:} \quad \xb_4(t)=-\eb_1 + (1-t)\eb_2, \quad t\in[0,2]. \end{align*}\] In fact, notice that this is just the arclength parametrisation, \(t=s\), since \(|d\xb_i/dt| = 1\) in each case.

We then calculate the line integral \[\begin{align*} \oint_C f(\xb)\,ds &= \int_{C_1}x^2y\,dt + \int_{C_2}x^2y\,dt + \int_{C_3}x^2y\,dt + \int_{C_4}x^2y\,dt\\ &= \int_0^2(t-1)^2(-1)\,dt + \int_0^21^2(t-1)\,dt \\ &\qquad + \int_0^2(1-t)^2(1)\,dt + \int_0^2(-1)^2(1-t)\,dt\\ &= 0. \end{align*}\] (This makes sense by symmetry since \(f(\xb)=x^2y\) changes sign if \(y\to-y\).)

[Note: we could reverse the direction of any of the individual arc parametrisations, and we would still get the same contribution to the line integral. This will not be true for vector line integrals…]

You may be familiar with the integral formula for the arclength of a curve \(y=f(x)\) for \(x\in[a,b]\). We can derive this using a line integral by choosing the parametrisation \(\xb(t) = t\eb_1 + f(t)\eb_2\) for \(t\in[a,b]\). Then the tangent vector is \[ \ddt{\xb} = \eb_1 + f'(t)\eb_2 \quad \implies \left|\ddt{\xb}\right| = \sqrt{1 + \big(f'(t)\big)^2}, \] so the arclength is \(\displaystyle\int_a^b\left|\ddt{\xb}\right|\,dt = \displaystyle \int_a^b\sqrt{1 + \big(f'(x)\big)^2}\,dx.\)

2.3 Revision: Area integrals

In Calculus I you saw how to integrate a scalar field \(f(x,y)\) over a planar area \(A\subset\Real^2\).

In particular, we define the area integral of \(f\) over \(A\) to be the limiting sum \[ \int_Af(x,y)\,dA = \lim_{n\to\infty}\sum_{i=1}^{n}f(\xb_i)\delta A, \] where \(\xb_i\) is a point in the middle of each infinitesimal area element of area \(\delta A.\) As \(\delta A\to 0\), then \(n\to\infty\) and the limit should be independent of the exact shape of the elements (as long as they get smaller in both dimensions).

Area integral as a limiting sum.

This corresponds to the volume under the surface \(z=f(x,y)\), analogous to how a 1-d integral gives the area under a curve.

How we actually evaluate an area integral depends on the shape of \(A\).

If the region is x-simple (meaning every horizontal line intersecting \(A\) does so in only one line segment) then it can be evaluated as a double integral in Cartesian coordinates, integrating over \(x\) first: \[ \int_Af(x,y)\,dA = \int_{y_0}^{y_1}\left(\int_{x_0(y)}^{x_1(y)}f(x,y)\,dx\right)\,dy. \]

An x-simple region.

This means that we have split \(A\) up into horizontal strips at each height \(y\), integrated along each of these, and then summed over all of the strips. The information about the shape of \(A\) is contained in the limits \(x_0(y)\) and \(x_1(y)\).

Often we leave out the parentheses and it is understood that the inner integral is done first. Thus \[ \int_{y_0}^{y_1}\left(\int_{x_0(y)}^{x_1(y)}f(x,y)\,dx\right)\,dy \equiv \int_{y_0}^{y_1}\int_{x_0(y)}^{x_1(y)}f(x,y)\,dxdy. \]

The curves intersect at \((0,0)\) and \((1,1)\) so the required \(y\)-limits are \(y_0=0\) and \(y_1=1\).

The region A.

For the \(x\)-limits, note that the lengths of the strips depend on \(y\). For the strip at height \(y\), the left-hand end is at \(y=\sqrt{x}\), meaning \(x_0(y)=y^2\), while the right-hand end is at \(y=x^3\), meaning \(x_1(y)=y^{1/3}\). Therefore the area integral may be evaluated as \[\begin{align*} \int_A(4xy-y^3)\,dA &= \int_0^1\left(\int_{y^2}^{y^{1/3}}(4xy - y^3)\,dx\right)\,dy\\ &= \int_0^1\Big[2x^2y - y^3x\Big]_{y^2}^{y^{1/3}}\,dy\\ &= \int_0^1\left(2y^{5/3} - y^{10/3} - y^5 \right)\,dy\\ &= \left[\frac34y^{8/3} - \frac{3}{13}y^{13/3} - \frac16y^6\right]_0^1 = \frac{55}{156}. \end{align*}\]

There was no particular reason in this example to split \(A\) into horizontal strips rather than vertical strips, as the region is also y-simple.

The \(x\)-limits are now \(x_0=0\) and \(x_1=1\). For the \(y\)-limits, note that the lower limit comes from \(y_0(x)=x^3\) while the upper limit comes from \(y_1(x)=\sqrt{x}\). So \[\begin{align*} \int_A(4xy-y^3)\,dA &= \int_0^1\left(\int_{x^3}^{x^{1/2}}(4xy-y^3)\,dy\right)\,dx\\ &= \int_0^1\Big[2xy^2 - \frac14y^4\Big]_{x^3}^{x^{1/2}}\,dx\\ &= \int_0^1\left(\frac74 x^2 - 2x^7 + \frac14x^{12}\right)\,dx\\ &= \left[\frac{7}{12}x^3 - \frac14x^8 + \frac{1}{52}x^{13}\right]_0^1 = \frac{55}{156}. \end{align*}\] Again this gives the same answer as before.

In these examples, the chosen order of integration didn’t make much difference to the calculation, but sometimes it makes a difference to the difficulty.

The region A.

Using horizontal strips, we get \[ \int_Ae^{-x^2}\,dA = \int_0^1\left(\int_y^1e^{-x^2}\,dx\right)\,dy. \] But the inner integral here has no elementary solution and has to be given in terms of the error function.

If instead we use vertical strips, then \[\begin{align*} \int_D e^{-x^2}\,dA &= \int_0^1\left(\int_0^xe^{-x^2}\,dy\right)\,dx\\ &= \int_0^1xe^{-x^2}\,dx = \Big[-\frac12 e^{-x^2}\Big]_0^1 = \frac12(1 - e^{-1}). \end{align*}\]

The fact that the order of integration doesn’t matter for well-behaved functions is a well-known theorem in Analysis:

Theorem 2.1 (Fubini’s Theorem.) If \(f(x,y)\) is continuous on a closed and bounded (i.e. compact) region \(A\subset\Real^2\), then the area integral of \(f\) over \(A\) exists and \[ \int_Af(x,y)\,dA = \int_y\left(\int_xf(x,y)\,dx\right)\,dy =\int_x\left(\int_yf(x,y)\,dy\right)\,dx. \]

Proof. Requires analysis that is beyond the scope of this course.


If the region and/or the function is allowed to be unbounded, then Fubini’s Theorem still holds provided the double integral is absolutely convergent, meaning \(\int_A|f(x,y)|^2\,dA < \infty\).

2.4 Surfaces

Now suppose we want to integrate a scalar field \(f(x,y,z)\) over a curved surface embedded in \(\Real^3\). Before we can do this, we need to know how to describe such a surface.

There are three main ways to describe surfaces:

  1. Explicitly as a graph \(z=h(x,y)\).
  2. Implicitly as a level set of some scalar field, \(g(\xb)=g(x,y,z) = 0\).
  3. Parametrically as \(\xb(u,v)\), i.e. as a map \(\Real^2\to\Real^3\).

At any point where a surface is sufficiently smooth, we can define a unit normal vector \(\hat{\nb}\) in \(\Real^3\) that is orthogonal to the surface.

For an implicit surface, the normal vector is just given (up to sign) by the gradient of \(g\), so \[ \hat{\nb} = \pm \frac{\nabla g}{|\nabla g|}. \]

The sphere can be defined as the level set \(g(x,y,z)=x^2+y^2+z^2 - a^2=0\), so \[ \nabla g = 2x\eb_1 + 2y\eb_2 + 2z\eb_3 \quad \implies |\nabla g| = 2\sqrt{x^2 + y^2 + z^2}. \]

So the normal direction is given by \[ \hat{\nb} = \pm\frac{x\eb_1 + y\eb_2 + z\eb_3}{\sqrt{x^2 + y^2 + z^2}} = \pm\frac{1}{a}\xb. \] This points radially outward or inward.

Sphere with normal.

The explicit surface is really just a special case with \(g(x,y,z) = h(x,y)-z\).

For the parametric surface \(\xb(u,v)\), note first that if we fix the \(v\) coordinate to \(v=v_0\), then \(\xb(u, v_0)\) is a curve lying in the surface.

Coordinates on a parametric surface.

Its tangent vector has direction \(\displaystyle{\tb}_u = \ddy{\xb}{u}.\)

Similarly, \(\xb(u_0, v)\) is another curve lying in the surface with tangent vector \({\tb}_v = \displaystyle\ddy{\xb}{v}.\)

If \(u\) and \(v\) are well-defined coordinates then \(\tb_u\) and \(\tb_v\) cannot be collinear. So taking their cross product will give us the unit normal to the surface, \[ \hat{\nb} = \frac{\tb_u\times\tb_v}{|\tb_u\times\tb_v|} = \frac{\displaystyle\ddy{\xb}{u}\times\ddy{\xb}{v}}{\displaystyle\left|\ddy{\xb}{u}\times\ddy{\xb}{v}\right|}. \] Note that the sign of \(\hat\nb\) depends on the ordering of \(u\), \(v\).

The tangent vectors \(\tb_u\) and \(\tb_v\) span the tangent plane to the surface at each point.

This is a parametrisation of the form \(\xb(u,v)\), with \(u=\theta\) and \(v=\phi\).

Parametrised sphere.

The relevant partial derivatives are \[\begin{align*} \tb_\theta &= \ddy{\xb}{\theta} = a\cos{\theta}\cos{\phi}\eb_1 + a\cos{\theta}\sin{\phi}\eb_2 - a\sin{\theta}\eb_3,\\ \tb_\phi &= \ddy{\xb}{\phi} = -a\sin{\theta}\sin{\phi}\eb_1 + a\sin{\theta}\cos{\phi}\eb_2. \end{align*}\] This gives \[ \tb_\theta\times\tb_\phi = a^2\sin^2{\theta}\cos{\phi}\eb_1 + a^2\sin^2{\theta}\sin{\phi}\eb_2 + a^2\sin{\theta}\cos{\theta}\eb_3 = a\sin{\theta}\xb, \] so the unit normal vector is \[ \hat{\nb} = \pm\frac{a\sin{\theta}\xb}{a\sin{\theta}|\xb|} = \pm\frac{1}{a}\xb. \] This agrees with our previous answer.

The parametrisation \(\xb(\theta,\phi)\) for the surface of a sphere comes from spherical polar coordinates, a (standard) 3-d extension of 2-d polar coordinates. Here \(r\) is the distance of \(\xb\) from the origin (which is always \(a\) if we are on a sphere of radius \(a\)), while \(\theta\) is the polar angle and \(\phi\) is the azimuthal angle.

To derive the components of \(\xb(\theta,\phi)\), use trigonometry and notice that the horizontal distance of \(\xb(\theta,\phi)\) from the \(z\)-axis is \(r\sin\theta\).

A surface is called smooth if the unit normal varies continuously over the surface (e.g. a sphere). It is called piecewise smooth if it can be divided into finitely many portions each of which is smooth (e.g. a cube).

We have \(x = u\cos{v}\), \(y=u\sin{v}\), and \(z=u\), so \[ x^2 + y^2 = u^2 = z^2 \quad \implies z = \sqrt{x^2 + y^2}. \] This is a cone with its point at \((0,0,0)\).

Cone.

The surface is not smooth because \(\hat{\nb}\) is not defined at \((0,0,0)\). To show this algebraically, note that the tangent vectors are \[\begin{align*} \tb_u = \ddy{\xb}{u} = \cos{v}\eb_1 + \sin{v}\eb_2 + \eb_3, \quad \tb_v = \ddy{\xb}{v} = -u\sin{v}\eb_1 + u\cos{v}\eb_2, \end{align*}\] so \[ \tb_u\times\tb_v = -u\cos{v}\eb_1 - u\sin{v}\eb_2 + u\eb_3 = -x\eb_1 - y\eb_2 + z\eb_3. \] We see that \(\tb_u\times\tb_v=\bfzero\) when \(\xb=\bfzero\), so the surface is indeed not smooth at \((0,0,0)\).

We will consider only orientable surface where there is a consistent choice of unit normal that varies smoothly over the surface. An example of a non-orientable surface would be a Möbius strip.

A surface can be either open if it is bounded by a curve (e.g. a hemisphere), or closed if it has no boundary (e.g. a sphere). The boundary of a closed surface \(S\) is a curve (or union of curves) \(\partial S\).

Open and closed surfaces.

If you are interested to learn more about surfaces – for example, how to measure curvature, then I recommend Differential Geometry III.

2.5 Surface integrals

If \(f(\xb)=f(x,y,z)\) is a scalar field and \(S\) is a surface with parametrisation \(\xb(u,v)\), then we define the surface integral of \(f\) over \(S\) to be \[ \int_S f(x,y,z)\,dS = \int_Uf(\xb(u,v))\left|\ddy{\xb}{u}\times\ddy{\xb}{v}\right|\,du\,dv, \] where \(U\) is the appropriate region in \((u,v)\) space.

To justify this formula, notice that the vectors \(\displaystyle\ddy{\xb}{u}\,du\) and \(\displaystyle\ddy{\xb}{v}\,dv\) define an infinitesimal parallelogram tangent to the surface at \(\xb(u,v)\).

Parallelogram.

The area of this parallelogram is given by \[ dS = \left|\ddy{\xb}{u}\times\ddy{\xb}{v}\right|\,du\,dv. \]

Notice that the parametrisation reduces the surface integral to an area integral of the type that we already know how to do.

The surface area is given by the surface integral of the scalar field \(f(\xb)=1\).

Previously we found that \[ \ddy{\xb}{\theta}\times\ddy{\xb}{\phi} = a{\sin\theta}\xb \quad \implies \left|\ddy{\xb}{\theta}\times\ddy{\xb}{\phi}\right| = a^2{\sin\theta}, \] so \[\begin{align*} \int_S\,dS &= \int_0^\pi\left(\int_0^{2\pi}(1)\left|\ddy{\xb}{\theta}\times\ddy{\xb}{\phi}\right|\,d\phi\right)\,d\theta = \int_0^\pi\left(\int_0^{2\pi}a^2\sin{\theta}\,d\phi\right)\,d\theta\\ &= \int_0^\pi 2\pi a^2\sin{\theta}\,d\theta = -\Big[2\pi a^2 \cos{\theta}\Big]_0^\pi = 4\pi a^2. \end{align*}\]

If we apply this result to a change of coordinates on a flat surface, then the normal vector has only a \(z\)-component, and we get immediately a familiar result from Calculus I:

Corollary 2.1 (Change of variables for area integrals.) If we change variables from \((x,y)\) to \((u,v)\), then \[ \int_{y_0}^{y_1}\int_{x_0(y)}^{x_1(y)}f(x,y)\,dxdy = \int_{v_0}^{v_1}\int_{u_0(v)}^{u_1(v)}f\big(x(u,v),y(u,v)\big)|J|\,dudv, \]

where \(\displaystyle|J|=\left|\ddy{x}{u}\ddy{y}{v} - \ddy{x}{v}\ddy{y}{u}\right|\) is the Jacobian.

The circle.

Here the integration limits are nicer if we switch to polar coordinates, \[ \xb(r,\theta) = r\cos\theta\eb_1 + r\sin\theta\eb_2. \] This gives \[ \ddy{\xb}{r} = \cos\theta\eb_1 + \sin\theta\eb_2, \quad \ddy{\xb}{\theta} = -r\sin\theta\eb_1 + r\cos\theta\eb_2, \] so the Jacobian is \[ |J| = \ddy{x}{r}\ddy{y}{\theta} - \ddy{x}{\theta}\ddy{y}{r} = r\cos^2\theta + r\sin^2\theta = r. \] [This tells us that an infinitesimal area element in the \((r,\theta)\) coordinates increases in size with radius, as illustrated in the picture.]

The integral is then \[\begin{align*} \int_A(x^2+y^2)\dA &= \int_0^{2\pi}\int_0^1\Big[(r\cos\theta)^2 + (r\sin\theta)^2\Big]r\,drd\theta\\ &= \int_0^{2\pi}\int_0^1r^3\,drd\theta = \int_0^{2\pi}\frac{1}{4}\,d\theta = \frac{\pi}{2}. \end{align*}\]

If our surface has the explicit form \(z=h(x,y)\), then we can parametrise it by \[ x = u, \quad y=v, \quad z=h(u,v), \] for appropriate ranges of \(u\) and \(v\). In that case, \[ \ddy{\xb}{u} = \eb_1 + \ddy{h}{u}\eb_3 = \eb_1 + \ddy{h}{x}\eb_3, \qquad \ddy{\xb}{v} = \eb_2 + \ddy{h}{v}\eb_3= \eb_2 + \ddy{h}{y}\eb_3 \] so \[\begin{align*} \ddy{\xb}{u}\times\ddy{\xb}{v} &= -\ddy{h}{x}\eb_1 + \ddy{h}{y}\eb_2 + \eb_3 \quad\\ &\implies \left|\ddy{\xb}{u}\times\ddy{\xb}{v}\right| = \sqrt{1 + \left(\ddy{h}{x}\right)^2 + \left(\ddy{h}{y}\right)^2}. \end{align*}\]

The triangular surface.

The triangle is part of the plane with normal \[ \nb = (-\eb_1+\eb_2)\times(-\eb_1+\eb_3) = (\eb_1 + \eb_2 + \eb_3), \] giving equation \((\xb-\eb_1)\cdot\nb=0 \iff x+y+z=1\). Rearranging gives \(z=1-x-y\) so we take \[ h(x,y)=1-x-y. \] Thus using \((x,y)\) as the parametrisation we have \[ \left|\ddy{\xb}{x} \times \ddy{\xb}{y}\right| = \sqrt{1 + \left(\ddy{h}{x}\right)^2 + \left(\ddy{h}{y}\right)^2} = \sqrt{3}. \] [This says that the area of the infinitesimal blue-hatched parallelogram is \(\sqrt{3}dxdy\).]

To find the integration limits, we just need to consider the projection of the triangle in the \((x,y)\) plane. Thus \[\begin{align*} \int_S x\,dS = \int_0^1\left(\int_0^{1-x} x\sqrt{3}\,dy\right)\,dx = \int_0^1\sqrt{3}x(1-x)\,dx = \sqrt{3}\Big[\frac12x^2 -\frac13x^3\Big]_0^1 = \frac{\sqrt{3}}{6}. \end{align*}\]

2.6 Volume integrals

If \(f(\xb)=f(x,y,z)\) is a scalar field and \(V\subset\Real^3\) is a 3-d subvolume, then we define the volume integral of \(f\) over \(V\) to be the limiting sum \[ \int_V f(x,y,z)\,dV = \lim_{n\to\infty}\sum_{i=1}^nf(\xb_i)\delta V, \] where \(\xb_i\) is a point in the middle of each infinitesimal volume element of volume \(\delta V\). As for area integrals, as \(\delta V\to 0\), then \(n\to\infty\) and the limit should be independent of the exact shape of the elements.

Also analogously to area integrals, we can write a volume integral as a triple integral of the form \[ \int_V f(x,y,z)\dV = \int_x\left[\int_y\left(\int_z f(x,y,z)\,dz\right)\,dy\right]\,dx. \]

As for double integrals, we usually leave out the parentheses and just write \[ \int_V f(x,y,z)\dV = \int_x\int_y\int_z f(x,y,z)\,dz\,dy\,dx, \] with the bracketing understood implicitly.

As with area integrals, Fubini’s Theorem guarantees that the order of integration doesn’t matter when \(f\) is continuous and \(V\) is a closed region. The main difficulty is in determining the correct limits.

The cube.

Since the limits are aligned with the coordinate axes, it is easy to see that \[\begin{align*} \int_V x\,dV &= \int_0^4\left[\int_0^4\left(\int_0^4x\,dz\right)\,dy\right]\,dx\\ &= \int_0^4\left(\int_0^4 4x \,dy\right)\,dx = \int_0^4 16x\,dx = \Big[8x^2\Big]_0^4 = 128. \end{align*}\]

Note that here the limits would be the same if we change the order of integration and do \(x\) first: \[\begin{align*} \int_V x\,dV &= \int_0^4\left[\int_0^4\left(\int_0^4x\,dx\right)\,dy\right]\,dz\\ &= \int_0^4\left(\int_0^4\Big[\frac12x^2\Big]_0^4\,dy\right)\,dz\\ &= \int_0^4\left(\int_0^48\,dy\right)\,dz = \int_0^4 32\,dz = 128. \end{align*}\]

Analogously to surface area, the volume of the sphere \(V\) is given by integrating the scalar field \(f(\xb)=1\).

Due to the symmetry of the sphere, no particular order of integration will be better than any other. If we do the \(z\) integral outside then the limits are \(z=-a\) and \(z=a\), so \[ \int_V\,dV = \int_{-a}^a\left(\int_{D(z)}\,dA\right)\,dz, \] where \(D(z)\) the horizontal disc given by slicing through \(V\) at height \(z\).

The horizontal disc.

Such a disc has radius \(r_z = \sqrt{a^2-z^2}\), so we know that its area is \(\pi r_z^2=\pi(a^2-z^2)\). This avoids the need to calculate the area integral, giving \[ \int_V\,dV = \int_{-a}^a\pi(a^2-z^2)\,dz = \pi\Big[a^2z - \frac13z^3\Big]_{-a}^a = \frac43\pi a^3. \]

In more complicated cases it is essential to draw a diagram, and it usually helps to think about the limits of the innermost integral first.

First we make a sketch to identify the volume of integration (in blue).

The integration volume and limits.

What should be the order of integration? It is not obvious in advance except that \(y\) and \(z\) do not appear in the integrand, so it might help to do those first. So let’s choose the order \[ \int_Vx\,dV = \int_{x_0}^{x_1}\int_{y_0(x)}^{y_1(x)}\int_{z_0(x,y)}^{z_1(x,y)}x\,dz\,dy\,dx. \]

For fixed \(x\) and \(y\), the \(z\) integral runs from \(z_0(x,y)=x^2 + y^2\) to \(z_1(x,y)=2\).

We can now think of the outer \(x\) and \(y\) integrals as a double integral \(\int_D\,dx\,dy\). The region \(D\) should be the projection or “shadow” of the whole volume in the \((x,y)\)-plane. The curved boundary is given by substituting \(x^2 + y^2=2\), so treating this as an area integral gives the limits \[\begin{align*} \int_V\,dV &= \int_0^{\sqrt{2}}\int_0^{\sqrt{2-x^2}}\int_{x^2 + y^2}^2 x\,dz\,dy\,dx\\ &= \int_0^{\sqrt{2}}\int_0^{\sqrt{2-x^2}}x(2 - x^2 - y^2)\,dy\,dx = \int_0^{\sqrt{2}}\Big[x(2-x^2)y - \frac13xy^3\Big]_0^{\sqrt{2-x^2}}\,dx\\ &=\int_0^{\sqrt{2}}\frac23x(2-x^2)^{3/2}\,dx = \int_0^2\frac13t^{3/2}\,dt = \left[\frac{2}{15}u^{5/2}\right]_0^2 = \frac{8\sqrt{2}}{15}. \end{align*}\]

It is also possible to change variables in a volume integral. If we have some new parametrisation \(\xb(u,v,w)\) of the volume, then \[ \int_Vf(\xb)\,dV = \int_{u_0}^{u_1}\int_{v_0(u)}^{v_1(u)}\int_{w_0(u,v)}^{w_1(u,v)}f(\xb)\left|\ddy{\xb}{u}\cdot\left(\ddy{\xb}{v}\times\ddy{\xb}{w}\right)\right|\,dw\,dv\,du. \] This works because \(\displaystyle \left|\ddy{\xb}{u}\cdot\left(\ddy{\xb}{v}\times\ddy{\xb}{w}\right)\right|\,dw\,dv\,du\) is the volume of an infinitesimal parallelepiped forming the volume element \(\delta V\).

As we have seen, spherical polar coordinates are given by \[ \xb(r,\theta,\phi) = r\sin\theta\cos\phi\eb_1 + r\sin\theta\sin\phi\eb_2 + r\cos\theta\eb_3, \] where \(r\in[0,a]\), \(\theta\in[0,\pi]\), \(\phi\in[0,2\pi]\). (Now the radius varies as well as the two angles.)

We have \[\begin{align*} \ddy{\xb}{r} &= \sin\theta\cos\phi\eb_1 + \sin\theta\sin\phi\eb_2 + \cos\theta\eb_3,\\ \ddy{\xb}{\theta} &= r\cos\theta\cos\phi\eb_1 + r\cos\theta\sin\phi\eb_2 - r\sin\theta\eb_3,\\ \ddy{\xb}{\phi} &= -r\sin\theta\sin\phi\eb_1 + r\sin\theta\cos\phi\eb_2, \end{align*}\] so the scalar triple product is \[\begin{align*} &\ddy{\xb}{r}\cdot\left(\ddy{\xb}{\theta}\times\ddy{\xb}{\phi}\right) = \begin{vmatrix} \displaystyle\ddy{x}{r} & \displaystyle\ddy{y}{r} & \displaystyle\ddy{z}{r}\\ \displaystyle\ddy{x}{\theta} & \displaystyle\ddy{y}{\theta} & \displaystyle\ddy{z}{\theta}\\ \displaystyle\ddy{x}{\phi} & \displaystyle\ddy{y}{\phi} & \displaystyle\ddy{z}{\phi} \end{vmatrix}= \begin{vmatrix} \sin\theta\cos\phi & \sin\theta\sin\phi & \cos\theta\\ r\cos\theta\cos\phi & r\cos\theta\sin\phi & - r\sin\theta\\ -r\sin\theta\sin\phi & r\sin\theta\cos\phi & 0 \end{vmatrix}\\ &= \cos\theta\begin{vmatrix}r\cos\theta\cos\phi & r\cos\theta\sin\phi \\ -r\sin\theta\sin\phi & r\sin\theta\cos\phi \end{vmatrix} + r\sin\theta\begin{vmatrix}\sin\theta\cos\phi & \sin\theta\sin\phi\\ -r\sin\theta\sin\phi & r\sin\theta\cos\phi \end{vmatrix}= r^2\sin\theta. \end{align*}\]

So the volume integral is \[\begin{align*} \int_V\,dV &= \int_0^{a}\int_0^\pi\int_0^{2\pi}\left|\ddy{\xb}{r}\cdot\left(\ddy{\xb}{\theta}\times\ddy{\xb}{\phi}\right)\right|\,d\phi\,d\theta\,dr\\ &= \int_0^{a}\int_0^\pi\int_0^{2\pi}r^2\sin\theta\,d\phi\,d\theta\,dr\\ &= \int_0^{a}\int_0^\pi 2\pi r^2\sin\theta\,d\theta\,dr\\ &= \int_0^{a} \left[-2\pi r^2\cos\theta\right]_0^\pi\,dr= \int_0^a 4\pi r^2\,dr = \frac43\pi a^3. \end{align*}\]