# Lecture 013

## Double Integral

Double Integral = $\int \int_R f(x, y) d d = \lim_{m, n \rightarrow \infty} \sum_{i = 1}^m \sum_{j = 1}^n f(x_i, y_j) \Delta Area_{ij}$

For Rectangle: \begin{align*} \int \int_R f(x, y) dA &= \int_c^d (\int_a^b f(x, y) dx) dy\\ &= \int_a^b (\int_c^d f(x, y) dy) dx \end{align*}

Average Value:

• In 2D:

• If $y = f(x)$ continuous on $[a, b]$
• then $f_{avg} = \frac{1}{b-a} \int_a^b f(x) dx$
• In 3D:

• If $z = f(x, y)$ on closed bounded domain $R$
• then $f_{avg} = \frac{1}{Area(R)}\int \int_R f(x, y) dA$
• 2D equivalent: $\int \int_R 1 dA = Area(R)$

2D Example: area between $y = x^2$ and $y = \sqrt{x}$ \begin{align*} R &= \{(x, y) | 0 \leq x \leq 1, x^2 \leq y \leq \sqrt{x}\}\\ &= \{(x, y) | 0 \leq y \leq 1, x^2 \leq y^3 \leq \sqrt{y}\}\\ \end{align*}

\begin{align*} \int \int_R 1 dA &= \int_0^1 \int_{x^2}^{\sqrt{x}} 1 dy dx\\ &= \int_0^1 (y |_{x^2}^{\sqrt{x}}) dx\\ &= \int_0^1 \sqrt(x) - x^2 dx\\ &= \frac{5}{12}\\ \end{align*}

3D Switch Order Example: signed volume of $3xy$ under region between $y = x^3, y = x^2+1, x = 0, x = 1$ \begin{align*} D &= \{(x, y) | 0 \leq x \leq 1, x^3 \leq y \leq x^3 + 1\}\\ &= D_1 \cup D_2\\ &= \{(x, y) | 0 \leq y \leq 1, 0 \leq x \leq \sqrt{y}\}\\ \cup &\{(x, y) | 1 \leq y \leq 2, \sqrt{y-1} \leq x \leq 1\}\\ V &= \int_0^1 \int_{x^3}^{x^3 + 1} 3xy dy dx\\ &= \int_0^1 \int_0^{\sqrt{y}} 3xy dx dy + \int_1^2 \int_{\sqrt{y-1}}^1 3xy dx dy\\ \end{align*}

## Double Integral in Polar Coordinates

Polar Rectangle: $R = \{(r, \theta) | a \leq r \leq b, \alpha \leq \theta \leq \beta\}$ (a sector)

• If $z = f(r, \theta)$ continuous on $R$, then $\int \int_R f(r, \theta) dA = \lim_{m, n \rightarrow \infty} \sum_{i = 1}^m \sum_{j = 1}^n f(r_{ij} \theta_{ij}) \Delta A_{ij}$ where $\Delta A_{ij} = r_{ij} \Delta r_i \Delta \theta_j$

• Note $R_{ij} = \{(r, \theta) | r_i \leq r \leq r_{i+1}, \theta_j \leq \theta \leq \theta_{j+1}\}$

• Therefore \begin{align*} \Delta A_{ij} &= \frac{\Delta \theta_i}{2 \pi} \times \pi r_{i+1}^2 - \frac{\Delta \theta_i}{2 \pi} \times \pi r_i^2\\ &= \frac{r_i + r_{i+1}}{2} \times \Delta r_i \Delta \theta_i\\ \end{align*} where we define $r_{ij} = \frac{r_i + r_{i+1}}{2}$

## Application of Probability

Probability Density Function (pdf):

• greater to 0 at each point: $(\forall t \in \mathbb{R})(f(t) \geq 0)$

• sum to 1: $\int_R f(t) dt = 1$

• $P(a \leq x \leq b) = \int_a^b f(t) dt$

Joint Density Function: for continuous random variable $x$ and $y$

• $(\forall (x, y) \in \mathbb{R}^2)(f(x, y) \geq 0)$

• $\int \int_{\mathbb{R}^2} f(x, y) dA = 1$

• $(\forall D \subseteq \mathbb{R}^2)(P((x, y) \in D) = \int \int_D f(x, y) dA)$

X~Exp(n): $\frac{1}{n}e^{-X/n}$

Expected Value: $E(x) = \int_R x f(x) dx$ if $x$ is a continuous random variable with pdf $f(x)$

• If joined, $E(x) = \iint_{R^2} x f(x, y) dA, E(y) = \iint_{R^2} y f(x, y) dA$

## Triple Integrals

\iint_E f(x, y, z) dV = \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_{ijk}

The volume of standard n-complex is $\frac{1}{n!}$

u-substitution: $dx = \frac{dx^3}{2x^2}$ integrate by part: $\int f(x)g(x) dx = f(x) \int g(x) dx - \int (\int g(x) dx) \frac{d f(x)}{dx} dx$

// TODO: review integrate by part

## Change of Variable (coordinate system)

Planar Transformation: a function $T : \mathbb{R}^2 \rightarrow \mathbb{R}^2$ (from $(u, v)$ coordinates to $(x, y)$ coordinates)

• $T$ should be injective (also locally surjective, with inverse), because we don't want region to overlap and cancel each other out or counted twice

• $T$ should have continuous first order partial derivatives for its component functions

• then $T$ is a $C^1$ (continuous, first derivative continuous) transformation

Jacobion: if $T(u, v) = \langle{x(u, v), y(u, v)}\rangle$, then $\frac{\partial (x, y)}{\partial (u, v)} = \det \begin{vmatrix} \frac{\partial x}{\partial u} & \frac{\partial x}{\partial v}\\ \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v}\\ \end{vmatrix}$

$T(x, y, z) = \langle{x(u, v, w), y(u, v, w)}\rangle$, then $\frac{\partial (x, y, z)}{\partial (u, v, w)} = \det \begin{vmatrix} \frac{\partial x}{\partial u} & \frac{\partial y}{\partial u} & \frac{\partial z}{\partial u}\\ \frac{\partial x}{\partial v} & \frac{\partial y}{\partial v} & \frac{\partial z}{\partial v}\\ \frac{\partial x}{\partial w} & \frac{\partial y}{\partial w} & \frac{\partial z}{\partial w}\\ \end{vmatrix}$

Then \begin{align*} &\int \int_R f(x, y) dA\\ = &\int \int_S f(x, (u, v), y(u, v)) \left\|\frac{\partial (x, y)}{\partial (u, v)}\right\| du dv\\ \end{align*}

Special Case for Cylindrical Coordinates:

\|\frac{\partial (x, y, z)}{\partial (r, \theta, z)}\| = \det \begin{vmatrix} \cos \theta & -r\sin \theta & 0\\ \sin \theta & r\sin \theta & 0\\ 0 & 0 & 1\\ \end{vmatrix} = \|r\cos^2 \theta + r \sin^2 \theta + 0\| = r

Special Case for Spherical Coordinates:

\|\frac{\partial (x, y, z)}{\partial (\rho, \theta, \varphi)}\| = \det \begin{vmatrix} \cos\theta\sin\varphi & -\sin\theta\sin\varphi\rho & \rho\cos\theta\cos\varphi\\ \sin\theta\sin\varphi & \rho\cos\theta\sin\varphi & \rho\sin\theta\cos\varphi\\ \cos\varphi & 0 & -\rho\sin\varphi\\ \end{vmatrix} = \|-\rho^2\sin\varphi\| = \rho^2\sin\varphi = r\rho

Jacobian Matrix: Best linear map approximate $f$ at $(x_0, y_0)$. Even though the transformation is not linear in global sense, it can be linear in local sense. (See Video)

• We need the absolute value because we don't care about orientation of the region when integrate

• Multiplying the Jacobian has the effect to warp rectangular region into sector-like region

Table of Content