APMA2000 Multivariable Calculus
Multivariable Calculus Notes
Double Integral
In short, double integrals are trying to find the area of the domain on a 2D plane while also multiplying each area with a height. The result is commonly understood as finding the volume under a certain 3D surface.

First consider the surface $S$ with a rectangular domain:

Now, if we partition the rectangular domain into regular sized small areas $\Delta A$, we have the volume underneath the surface:
\[V \approx \sum_{i=1}^{m} \sum_{j}^{n}f(x^*_{i,j},y^*_{i,j})\Delta A\] 
Lastly, we just take the limit where $m \rightarrow \infty$ and $n \rightarrow \infty$:
\[V = \lim_{m,n\rightarrow \infty}\sum_{i=1}^{m} \sum_{j}^{n}f(x^*_{i,j},y^*_{i,j})\Delta A = \iint_{Domain}f(x,y)\,dA\]
In general, for nonrectangular domains, the idea is similar:

First, find curtains of the volumes:
With this, we can write:
\[V = \int_a^b A(x)\,dx\] 
Now, we just need to find the area of the curtain, which obviously would be a single integral iterating over $\Delta y$:
\[A(x) = \int_{c}^d f(x,y)\, dy\] 
Lastly, we just need to combine both integrals:
\[V = \int_a^b \int_{c}^d f(x,y)\, dy\,dx\]
For instance, if we have:
Then we can find the curtains and the volume with:
\[A(x) = \int_{g_1(x)}^{g_2(x)}f(x,y)\,dy\\ V = \int_{a}^{b}\int_{g_1(x)}^{g_2(x)}f(x,y)\,dy\,dx\]And notice that if we take $f(x,y)=1$:
Then we recover the familiar 1D integral:
\[\int_{a}^{b}\int_{g_1(x)}^{g_2(x)}1\,dy\,dx = \int_{a}^{b}(g_2(x)g_1(x))\,dx\]Double Integral in Polar Coordinates
Similarly, in polar coordinates, you just need to imagine curtains and volumes:
Consider the following domain:
Then, if we are integrating over the function $f(x,y) = f(rcos(\theta), rsin(\theta))$, we get:
\[V = \iint_D f(x,y)\,dA = \int_{\alpha}^{\beta}\int_{r=h_1(\theta)}^{r=h_2(\theta)}f(rcos(\theta), rsin(\theta))\,rdrd\theta\]Triple Integral
Similar to double integral, we first imagine a regular cuboid:

Consider a cuboid with its domain:
\[B = \{(x,y,z) \,\, a\le x\le b,\, c\le y\le d,\, e\le z\le f\}\] 
Partition the large volume into smaller volumes:

Now, write the Riemann Sum using the figure above:
\[V = \sum_{i=1}^{l}\sum_{j=1}^{m}\sum_{k=1}^{n}f(x^*_{ijk},y^*_{ijk},z^*_{ijk})\,\Delta V\] 
Lastly, taking the limit to infinity:
\[V = \lim_{l,m,n\rightarrow \infty}\sum_{i=1}^{l}\sum_{j=1}^{m}\sum_{k=1}^{n}f(x^*_{ijk},y^*_{ijk},z^*_{ijk})\,\Delta V = \iiint_B f(x,y,z)\,dV\]
For example, a simple cuboid would take the form:
\[V = \int_a^b\int_c^d\int_e^f g(x,y,z)\,dxdydz\]In general, for a random 3 dimensional shape, you can imagine cutting the 3D cake three times:
 The first cut would be finding its top and bottom surface:

The second cut would be finding one of its sides:
 The silhouette of the second cut is easier to find out if you imagine the projection of the cake onto a 2D plane, such as the region $D$ shown above.

The third/last cut would be two straight chopping:
Obviously, if we take $f(x,y,z)=1$, we can get the volume encapsulated in the 3D surface:
\[\iiint_E dV = \int_a^b\int_{g_1(y)}^{g_2(y)} \int_{u_1(x,y)}^{u_2(x,y)}dzdxdy\]Triple Integral in Cylindrical Coordinates
In this note, we take the following convention for cylindrical coordinates:
So we have:
\[x = rcos(\theta)\\ y = rsin(\theta)\\ z = z\]The only difference from the above integrals is that the cuts now include cylindrical coordinates. The general formula looks like:
\[\iiint_E f(x,y,z)\,dV = \int_\alpha^\beta\int_{h_1(\theta)}^{h_2(\theta)} \int_{u_1(rcos(\theta),rsin(\theta))}^{u_2(rcos(\theta),rsin(\theta))}f(rcos(\theta),rsin(\theta),z)\,rdzdrd\theta\]For example:

Question:
Find out the mass of the volume below, where its density is defined by $K\sqrt{x^2+y^2}$:

Solution
\[\begin{align*} m &= \iiint_EK\sqrt{x^2+y^2}\,dV \\ &= \int_{0}^{2\pi}\int_{0}^1\int_{1r^2}^{4}(Kr)\,rdzdrd\theta \\ &=\,\,... \\ &=\frac{12\pi K}{5} \end{align*}\]
Triple Integral in Spherical Coordinates
This note uses the following spherical coordinates convention:
where:
\[x = \rho sin(\phi)cos(\theta) \\ y = \rho sin(\phi)sin(\theta) \\ z = \rho cos(\phi)\]and obviously:
\[\rho^2 = x^2 + y^2 + z^2\]Therefore, the general formula for integrating in a spherical coordinate looks like:
\[\iiint_E f(x,y,z)\,dV = \int_\alpha^\beta\int_{c}^{d} \int_{g_1(\theta,\phi)}^{g_2(\theta,\phi)}f(\rho sin(\phi)cos(\theta),\rho sin(\phi)sin(\theta),\rho cos(\phi))\,\rho^2sin(\phi)d\rho d\phi d\theta\]Different from the previous two coordinates, it is easier to imagine making this cake than cutting the cake when you use spherical coordinates.
For example:

Question:
Found out the volume of the solid that lies within the below surface:

Solution:
\[\begin{align*} V &= \iiint_EdV \\ &= \int_0^{2\pi} \int_0^{\frac{\pi}{4}} \int_0^{cos(\phi)} \,\rho^2sin(\phi)d\rho d\phi d\theta \\ &= \,\, ... \\ &=\frac{\pi}{8} \end{align*}\]where you can imagine:
draws the line silhouette of the sphere above the origin
cuts the line above so that the bottom part looks like a straight line. At this point an area/curtain is made.
rotates the above line for one revolution to make a volume (and lastly add the geometric factor of $p^2sin(\phi)$)
Line Integral
A line integral usually takes the form:
\[\int_C f(x,y) \,ds\]and, as you can see, the key step lies in determining the expression for $ds$.

First, consider a curve $C$ in 2D:
where we get:
\[\begin{align*} L &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\left P_iP_{i+1} \right \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{(x_{i+1}x_i)^2 + (y_{i+1}y_i)^2} \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{\Delta x^2 + (\frac{dy}{dx}\Delta x)^2} \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{1 + \frac{dy}{dx}^2}\,\Delta x \\ &= \int_a^b\sqrt{1 + \frac{dy}{dx}^2}\,d x \\ \end{align*}\] 
More often, we encounter curves that are in 3D and are defined by parametric equations:
Consider a curve that is defined by $C = (f(t), g(t))$.
Then we have:
\[\begin{align*} L &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\left P_iP_{i+1} \right \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{(x_{i+1}x_i)^2 + (y_{i+1}y_i)^2} \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{\left(\frac{df}{dt}\Delta t\right)^2 + \left(\frac{dg}{dt}\Delta t\right)^2} \\ &= \lim_{i\rightarrow \infty} \sum_{i=0}^{n1}\sqrt{\frac{df}{dt}^2 + \frac{dg}{dt}^2}\,\Delta t\\ &= \int_{t=a}^{t=b}\sqrt{\frac{df}{dt}^2 + \frac{dg}{dt}^2}\,dt\\ \end{align*}\]However, this assumes the direction such that $a<b$. This is because the derivatives $\frac{df}{dt}$ and $\frac{dg}{dt}$ takes the positive direction.

Lastly, since we know the equation for $L$ (or $s$), and we just needed an expression for $ds$, we can solve this easily using the Fundamental Theorem of Calculus:
\[\begin{align*} s &= \int_{t=a}^{t=b}\sqrt{\frac{df}{dt}^2 + \frac{dg}{dt}^2}\,dt\\ \frac{ds}{dt} &= \sqrt{\frac{df}{dt}^2 + \frac{dg}{dt}^2} \\ ds &= \sqrt{\frac{df}{dt}^2 + \frac{dg}{dt}^2}\, dt \end{align*}\]Therefore, we get:
\[\int_C f(x,y)\,ds = \int_{t=a}^{t=b} f(x_{(t)},y_{(t)}) \sqrt{\frac{dx_{(t)}}{dt}^2 + \frac{dy_{(t)}}{dt}^2}\, dt\]
In general, we have:
Line Integral Equations:
\[\int_C f(x,y)\,ds = \int_{t=a}^{t=b} f(x_{(t)},y_{(t)}) \sqrt{\frac{dx_{(t)}}{dt}^2 + \frac{dy_{(t)}}{dt}^2}\, dt\]
 In 2D
In 3D
\[\int_C f(x,y)\,ds = \int_{t=a}^{t=b} f(x_{(t)},y_{(t)},z_{(t)}) \sqrt{\frac{dx_{(t)}}{dt}^2 + \frac{dy_{(t)}}{dt}^2 + \frac{dz_{(t)}}{dt}^2}\, dt\]
Other similar integrals include:
\[\int_C f(x,y)\,dx = \int_{a}^{b}f(x_{(t)},y_{(t)})\left(\frac{dx_{(t)}}{dt}dt\right) = \int_{a}^{b}f(x_{(t)},y_{(t)})\frac{dx_{(t)}}{dt}\,dt\]and
\[\int_C f(x,y)\,dy = \int_{a}^{b}f(x_{(t)},y_{(t)})\left(\frac{dy_{(t)}}{dt}dt\right) = \int_{a}^{b}f(x_{(t)},y_{(t)})\frac{dy_{(t)}}{dt}\,dt\]Line Integral of Vector Fields
This is very useful in physics, especially when you are computing energy related quantities, such as work done.
Instead of the line integral equations indicated above, consider the following scenario where you need to compute $\vec{F} \cdot d\vec{s}$ along a curve:

First, write out the required integral:
\[\begin{align*} W &= \int_C \vec{F}_{(x,y,z)} \cdot \vec{T}_{(x,y,z)}\,ds \\ &= \int_{t=a}^{t=b} \left[\vec{F}_{(\vec{r}_{(t)})} \cdot \frac{\vec{r}^\prime_{(t)}}{\left\vec{r}^\prime_{(t)}\right}\right]\,\left\vec{r}^\prime_{(t)}\right dt \\ &= \int_{t=a}^{t=b} \vec{F}_{(\vec{r}_{(t)})}\cdot \vec{r}^\prime_{(t)}\, dt \end{align*}\]
So, in general:
Line Integral for Vector Fields Equation:
\[\int_C \vec{F} \cdot d\vec{r}= \int_{t=a}^{t=b} \vec{F}_{(\vec{r}_{(t)})}\cdot \vec{r}^\prime_{(t)}\, dt\]
If $\vec{F} = P\hat{i}+Q\hat{j}+R\hat{k}$
\[\int_C \vec{F} \cdot d\vec{r}= \int_C P\,dx + Q\,dy + R\,dz\]
The Fundamental Theorem of Line Integral
Theorem/Equation:
Let $C$ be a smooth curve given by the vector function $\vec{r}$, $a < t < b$. Let $f$ be a differentiable function of two or three variables whose gradient vector $\nabla f$ is continuous on $C$. Then
\[\int_C \nabla f \cdot d\vec{r} = f(r_{(b)})  f(r_{(a)})\]
Note:
 The theorem above says that we can evaluate the line integral of a conservative vector field (the gradient vector field of the potential function $f$) simply by knowing the value of $f$ at the endpoints of $C$. In fact, the above theorem says that the line integral of $\nabla f$ is the net change in $f$.
 Therefore, for nonconservative fields, you cannot find an $f$ that satisfies the above equation, so that there DNE a potential for a nonconservative field.
Proof of the above is also straight forward:
\[\begin{align*} \int_C \nabla f \cdot d\vec{r} &= \int_a^b \nabla f \cdot \frac{d\vec{r}_{(t)}}{dt} dt \\ &= \int_a^b \left( \frac{\partial f}{\partial x} \frac{dx}{dt} + \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial z} \frac{dz}{dt} \right) dt \\ &= \int_a^b \frac{d}{dt}f_{(\vec{r}_{(t)})} \,dt\\ &= f_{(\vec{r}_{(b)})}  f_{(\vec{r}_{(a)})} \end{align*}\]Closed Line Integral/ Green’s Theorem
Green’s Theorem Def:
Let $C$ be a positively oriented, piecewisesmooth, simple closed curve in the plane and let $D$ be the region bounded by $C$. If $P$ and $Q$ have continuous partial derivatives on an open region that contains $D$, then:
\[\oint_C P\,dx+ Q\,dy = \oiint_D \left(\frac{\partial Q}{dx} \frac{\partial P}{\partial y}\right) dA\]
Notice:
The above equation is essentially the 2D version of Stokes’ Theorem (Closed Surface Integral/ Stokes’ Theorem), where the expression $\frac{\partial Q}{dx} \frac{\partial P}{\partial y}$ is essentially the $\nabla \times \vec{F}$ on the 2D plane.
For a conservative force, we can conclude from the previous section that:
\[\oint_C P\,dx+ Q\,dy = 0 = \oiint_D \left(\frac{\partial Q}{dx} \frac{\partial P}{\partial y}\right) dA\]Therefore, for a conservative force $\vec{F}_c$ , it has to be that
\[\nabla \times \vec{F}_c = 0\]
A common usage of the Green’s Theorem include finding out the area enclosed by a closed loop.
Since we need to find:
\[A = \oiint_D 1\, dA = \oiint_D \left(\frac{\partial Q}{dx} \frac{\partial P}{\partial y}\right) dA = \oint_C P\,dx+ Q\,dy\]Therefore, we can constitute $Q$ and $P$ by ourselves to satisfy this equation:
\[\frac{\partial Q}{dx} \frac{\partial P}{\partial y} = 1\]so that some of the equations that satisfies the above constraint includes:
\[A = \frac{1}{2} \oint_C x \,dy  y\,dx \\ A = \oint_C x dy \\ A =  \oint_C y \,dx\]Surface Integral

First, we need to find a tangent plane of a parametric surface. This is achieved by:
The surface traced out by the vector equation:
Then two tangential vectors of the curves$C_1$ and $C_2$ can be obtained by using partial derivatives:
\[\vec{r}_u = \frac{\partial{x}}{\partial{u}}(u,v)\hat{i} + \frac{\partial{y}}{\partial{u}}(u,v)\hat{j} + \frac{\partial{z}}{\partial{u}}(u,v)\hat{k} \\ \vec{r}_v = \frac{\partial{x}}{\partial{v}}(u,v)\hat{i} + \frac{\partial{y}}{\partial{v}}(u,v)\hat{j} + \frac{\partial{z}}{\partial{v}}(u,v)\hat{k}\] Second, we need to figure out the size of a patch/small piece of surface at point $P_{i,j} = \vec{r}(u_i, v_j)$:
This is achieved by using the partial derivatives:
\[\Delta\vec{r}_{u,v_j} = \frac{\partial{\vec{r}}}{\partial{u}}\Delta{u} = \vec{r}_u\Delta u \\ \Delta\vec{r}_{u_i,v} = \frac{\partial{\vec{r}}}{\partial{v}}\Delta{v} = \vec{r}_v\Delta v\] So:
\[S_{i,j} = \left(\vec{r}_u\Delta u)\times (\vec{r}_v\Delta v \right) = \left\vec{r}_u\times \vec{r}_u\right\Delta u\Delta v\]
Lastly, making this a Riemann Sum and taking infinitesimal over $\Delta u$ and $\Delta v$ gives:
\[A_S = \iint_{Domain}\left\vec{r}_u\times \vec{r}_u\rightdu\,dv\]And in general, if you need to integrate it over a function $f(x,y,z) = f(\vec{r}(u,v))$:
\[\iint_S f(x,y,z)dS = \iint_D f(\vec{r}(u,v))\left\vec{r}_u\times \vec{r}_u\rightdu\,dv\]Notice that:
 By taking $f(\vec{r}(u,v)) = 1$, we get $\iint_D 1\, \left\vert \vec{r}_u\times \vec{r}_u\right\vert du\,dv = A_S$
For example:

Question:
Compute the surface integral $\iint_S x^2 dS$, where $S$ is the unit sphere given by $x^2 + y^2 +z^2 = 1$.

Solution:
First find the parametric equation of the surface:
\[x = rsin(\phi)cos(\theta)=sin(\phi)cos(\theta);\\ y=rsin(\phi)sin(\theta)=sin(\phi)sin(\theta); \\ z=rcos(\phi)=cos(\phi);\\ where:\, 0\le\phi\le\pi;\, 0\le\theta\le2\pi\] So the parametric equation becomes:
\[\vec{r}(\phi, \theta) = sin(\phi)cos(\theta)\hat{i}+ sin(\phi)sin(\theta)\hat{j}+cos(\phi)\hat{k}\] Now, skipping the details, we need to compute:
\[\left\vec{r}_u\times \vec{r}_u\right = sin(\phi)\] Finally, putting everything together:
\[\begin{align*} \iint_S x^2 dS &= \iint_D (sin(\phi)cos(\theta))^2 \left\vec{r}_u\times \vec{r}_u\rightdu\,dv \\ &=\int_{0}^{2\pi}\int_{0}^{\pi} (sin(\phi)cos(\theta))^2 sin(\phi)d\phi\,d\theta \\ &= ... \end{align*}\]
Closed Surface Integral/ Stokes’ Theorem
Stoke theorem says:
Stokes’ Theorem Definition:
Let $S$ be an oriented piecewisesmooth surface that is bounded by a simple, closed, piecewisesmooth boundary curve $C$ with positive orientation. Let $\vec{F}$ be a vector field whose components have continuous partial derivatives on an open region in $\mathbb{R}^3$ that contains $S$. Then:
\[\oiint_S \vec{\nabla} \times \vec{F} \cdot d\vec{S} = \oint_C\vec{F} \cdot d\vec{r}\]and, to make it into the form we can calculate:
\[\oint_C\vec{F} \cdot d\vec{r} = \oint_C \vec{F}\cdot\vec{T}\,ds\]and:
\[\oiint_S \vec{\nabla} \times \vec{F} \cdot d\vec{S} = \oiint_S \vec{\nabla}\times\vec{F}\cdot\hat{n}\,dS\]This means that the line integral around curve $C$ of the tangential component of $\vec{F}$ is equal to the surface integral over $S$ of the normal component of the curl of $\vec{F}$.
Volume Integral
Integrating a volume is the same as the triple integral, where you simply replace the $f(x,y,z)$ in:
\[\sum_{i=1}^{l}\sum_{j=1}^{m}\sum_{k=1}^{n}f(x^*_{ijk},y^*_{ijk},z^*_{ijk})\,\Delta V\]with $f(x,y,z)=1$:
\[V = \sum_{i=1}^{l}\sum_{j=1}^{m}\sum_{k=1}^{n}\Delta V\]Therefore you get:
\[V = \int_a^b\int_c^d\int_e^f dxdydz\]In general, you have:
\[V = \int_a^b\int_{g_1(y)}^{g_2(y)} \int_{u_1(x,y)}^{u_2(x,y)}dzdxdy\]where:
 $u_1(x,y)$ and $u_2(x,y)$ describes two planes in which the volume is enclosed
 $g_1(y)$, $g_2(y)$ and $a$, $b$ describes cutting the enclosed infinite shape between the two planes into a finite volume
Closed Volume Integral/ Divergence Theorem
Divergence Theorem Def:
The Divergence Theorem Let $E$ be a simple solid region and let $S$ be the boundary surface of $E$, given with positive (outward) orientation. Let $\vec{F}$ be a vector field whose component functions have continuous partial derivatives on an open region that contains $E$. Then:
\[\oiint_S \vec{F} \cdot dS = \iiint_E \vec{\nabla} \cdot \vec{F} \, dV\]
 Thus the Divergence Theorem states that, under the given conditions, the flux of $\vec{F}$ across the boundary surface of $E$ is equal to the triple integral of the divergence of $\vec{F}$ over $E$.