## 4.3 Change of Coordinates In single variable calculus, we have discussed the idea of change of variables (also called substitution) to simplify integrals. :::info Suppose $g:[a,b]\to \mathbb R$ is an increasing and continuously differentiable function. Then $$\int_{a}^b f(g(x))\, g'(x)\,dx = \int_{g(a)}^{g(b)}f(u) \, du\,.$$ ::: The key goal of substitution in this case is to simplify the integrand. **Example 1** Compute $$\int_{1}^2 x\sqrt{x-1}\,dx\,.$$ :::spoiler Answer Write $u=g(x)=x-1$. Then, $g'(x)=1$. So, $$\int_{1}^2 x\sqrt{x-1}\,dx=\int_{0}^1 (u+1)u^{1/2} \,dx\,=\int_0^1 u^{3/2}+u^{1/2}\,du=16/15.$$ ::: <br> There is an analogous procedure in higher dimensions. But it is a bit more involved. ![image](https://hackmd.io/_uploads/SkWUI2b4kx.png) :::success **Theorem** (Change of Variables) Suppose $\Omega \subseteq \mathbb R^n$ is a closed and bounded region and $T:\Omega \to \mathbb R^n$ given by $$T(x_1,\dots,x_n) = (T_1(x_1,\dots,x_n),\dots, T_n(x_1,\dots,x_n))$$ such that $T_1,\dots,T_n$ have continuous partial derivatives and $T$ is one to one except perhaps on the boundary of $\Omega$. Define the Jacobian matrix of $T$ by $$J = \begin{pmatrix} (T_1)_{x_1} & (T_1)_{x_2}& \cdots & (T_1)_{x_n} \\ (T_2)_{x_1} & (T_2)_{x_2} & \cdots & (T_2)_{x_n} \\ \vdots & \vdots & \ddots &\vdots \\ (T_n)_{x_1}& (T_n)_{x_2}& \cdots &(T_n)_{x_n}\end{pmatrix}$$and suppose that $\det J\, (x_1,\dots\,x_n) \neq 0$ for all $(x_1,\dots\,x_n) \in \Omega$. Then $$\int\cdots\int_{\Omega} f \big( T (x_1,\dots,x_n) \big)\,|\det J|\, dx_1\cdots dx_n = \int\cdots\int_{T(\Omega)} f (y_1,\dots,y_n)\, dy_1\cdots dy_n\,.$$ ::: <br> Let's look at some examples in which we can substitute to simplify the computation of the integral. Note that in higher dimensions, we can use substitutions to - simplify the integrand, or - simplify the region of integration. <br> **Example 2** (simplifying the integrand) Let $R$ be the trapezoidal region with vertices $(1,0), (2,0), (0,-2),$ and $(0,-1)$. Compute $$\iint_{R} e^{(x+y)/(x-y)} \, dxdy\,.$$ ![image](https://hackmd.io/_uploads/rkq5b6WEJx.png) :::spoiler Answer We consider the change of coordinates $u=x+y$ and $v=x-y$. Then, $x=(u+v)/2$ and $y=(u-v)/2$, i.e., in the notation of the theorem $T(u,v)=((u+v)/2, (u-v)/2)$. Note that $T$ maps the following region $S$ to $R$. ![image](https://hackmd.io/_uploads/HJ9Tr6WNke.png) Also, since $$J = \begin{pmatrix} 1/2 & 1/2\\ 1/2 & -1/2\end{pmatrix}\,,$$we have $|\det J|=1/2$. Therefore,\begin{align}\iint_{R} e^{(x+y)/(x-y)} \, dxdy &=\int_{1}^2\int_{-v}^v e^{u/v}\frac{1}{2}\,du\,dv \\&= \frac{1}{2}\int_1^2 v\,e^{u/v}\Big|_{u=-v}^{u=v}\,dv=\frac{1}{2}\int_{1}^2(e-e^{-1}) v\,dv =\frac{3}{4}(e-e^{-1})\,.\,\end{align} ::: <br> **Example 3** (simplifying the region of integration) Calculate the volume of the ellisoid $R$ given by $$\frac{(x-x_0)^2}{a^2}+ \frac{(y-y_0)^2}{b^2}+\frac{(z-z_0)^2}{c^2} \leq 1\,.$$ :::spoiler Answer Consider the change of coordinates $u=(x-x_0)/a$, $v=(y-y_0)/b$, and $w=(z-z_0)/c$. Then, $x=au+x_0$, $y=bv+y_0$ and $z=cw+z_0$, i.e., $$T(u, v , w)=(au+x_0, bv+y_0, cw+z_0)$$ and $T$ maps the sphere of radius $1$ centred at the origin, $u^2+v^2+w^2 \leq 1$ (call it $S$) to the ellipsoid $R$. Also, since $$J = \begin{pmatrix}a & 0 & 0 \\ 0 & b & 0 \\ 0 & 0 & c\end{pmatrix}\,,$$we have $|\det J|=abc$. Therefore,\begin{align}\text{Volume}(R)=\iiint_{R} 1 \, dxdydz &=\iiint_S abc\,dudvdw = abc \cdot \text{Volume}(S) = \frac{4\pi}{3}abc\,.\end{align} ::: <br> **Example 4** (simplifying the integrand) Evaluate $$\int_0^1\int_0^{1-x} \sqrt{x+y}\, (y-2x)^2 \,dy\,dx\,.$$ :::spoiler Answer The region of integration, $R$, is the triangle bounded by $x=0$, $y=0$ and $x+y=1$. We substitute $u=x+y$ and $v=(y-2x)$. Then $T(u,v)=((u-v)/3,(2u+v)/3)$ and $T$ maps the triangle $S$ bounded by $u=v$, $2u+v=0$ and $u=1$ to $R$. Since $$J=\begin{pmatrix} 1/3 & -1/3\\ 2/3& 1/3\end{pmatrix}\,,$$we have $|\det J|=1/3$. So, $$\int_0^1\int_0^{1-x} \sqrt{x+y}\, (y-2x)^2 \,dy\,dx\, = \int_{0}^{1}\int_{-2u}^{u} \sqrt{u}v^2 \frac{1}{3} \,dv\,du = \frac{2}{9}.$$ ::: <br> In the next section, we apply our theorem to introduce new coordinate systems. --- **Reference** 1. *Chapter 15.9* : Stewart, J. (2012). Calculus (8th ed.). Boston: Cengage Learning. 2. *Chapter 14.2* : Strang G., Calculus (3rd ed.). [https://ocw.mit.edu/](https://ocw.mit.edu/courses/res-18-001-calculus-fall-2023/pages/textbook/) 3. *Chapter 3.5* : Corral, M. (2021). Vector Calculus. [https://www.mecmath.net/](https://www.mecmath.net/) --- <br> ## 4.3 Special Coordinates: Polar, Cylidrical and Spherical. In this section, we discuss three useful coordinate systems. The change of variables formula for multiple integration allows us to trasform integrals in Cartisean coordinates to these new coordinate systems and vice versa. ### 4.3.1 Polar Coordinates We can represent points $(x,y)\in \mathbb R^2 \setminus \{(0,0)\}$ in a unique way as $(r,\theta)$ where we write $r=\sqrt{x^2+y^2} \in [0,\infty)$ and $\theta \in [0,2\pi)$ is the unique angle such that $\cos \theta = x/r$ and $\sin \theta = y/r$. In fact, one can take fix $\theta$ range $[\alpha,2\pi+\alpha)$, e.g., $[-\pi,\pi)$ or $[\pi,3\pi)$, etc. ![image](https://hackmd.io/_uploads/rJQgK0WVJe.png) In these coordinates, it is easy to represent regions bounded by circles. ![image](https://hackmd.io/_uploads/H1q2YCW4kl.png) <br> Suppose we want to change coordinates from $(x,y)$ to $(r,\theta)$. Then we write $x=r\cos \theta$ and $y = r \sin \theta$, and then, $T(r,\theta)=(r\cos \theta, r \sin \theta)$ is invertible and has continuous partial derivatives on $\mathbb P=\mathbb R^2\setminus \{(0,\theta)|\theta\in[0,2\pi)\}$ with $$\det J(r,\theta)=\begin{vmatrix} \cos \theta & -r\sin\theta\\ \sin\theta& r\cos\theta \end{vmatrix} = r\cos^2\theta + r \sin^2\theta = r>0,\,\,\,\text{for all}\,\,\,(r,\theta)\in P\,.$$ This gives us, for all $R \subseteq \mathbb P$, :::info $$\iint_{T(R)} f(x,y)\,dx\,dy = \iint_{R}f(r\cos\theta,r\sin\theta)\, r\,dr\,d\theta $$ ::: <br> In particular, consider the region $D$ bounded by $\theta=\beta$, $r=h_1(\theta)$, $\theta=\alpha$, and $r=h_{2}(\theta)$ where $h_1$ and $h_2$ are continuous. ![image](https://hackmd.io/_uploads/SkXPN6MNJl.png) Then for any continuous function $f$ on $D$, $$\iint_{D} f(x,y)\,dx\,dy = \int_{\alpha}^\beta\int_{h_{1}(\theta)}^{h_{2}(\theta)} f(r\cos\theta,r\sin\theta)\, r\,dr\,d\theta$$ <br> **Example 1** Let $R$ be the region bounded by the semicircle $y = -\sqrt{1-x^2}$ and the $x-$axis. Evaluate $$\iint_R 2\sin(x^2+y^2)\,dx\,dy$$ :::spoiler Answer ![image](https://hackmd.io/_uploads/HkG0rpz4Jg.png) The region $R$ is bounded by $\theta=\pi$, $\theta=2\pi$ (or equivalently, $\theta=0$, $\theta=-\pi$), $r=0$ and $r=1$. So, $$\iint_D \sin(x^2+y^2)\,dx\,dy = \int_{\pi}^{2\pi}\int_{0}^1 2 \sin(r^2)\, r \,dr\,d\theta = \int_{\pi}^{2\pi} -\cos (r^2)\Big|_{r=0}^{r=1} \, d\theta= \pi(1-\cos(1))\,.$$ ::: <br> **Example 2** Calculate the volume under the paraboloid $z=x^2+y^2$, inside the cylinder $x^2+y^2 = 2x$, and above the $xy-$plane. ![image](https://hackmd.io/_uploads/ryJTyEMN1e.png)![image](https://hackmd.io/_uploads/rJaZxNMEke.png) :::spoiler Answer The volume is $$\iint_D (x^2+y^2) \,dxdy = \int_{-\pi/2}^{\pi/2}\int_{0}^{2\cos\theta} r^2 r\,dr\,d\theta = \int_{-\pi/2}^{\pi/2}\frac{r^4}{4}\Big|_{r=0}^{2\cos \theta} \, d\theta = 4\int_{-\pi/2}^{\pi/2} \cos^4\theta\,d\theta = \frac{3\pi}{2}\,.$$ ::: <br> ### 4.3.2 Cylindrical Coordinates We represent a point $(x,y,z)\in \mathbb R^3\setminus \{(0,0,z)|z\in \mathbb R\}$ uniquely by $(r,\theta,z)$ where $(r,\theta)$ is the polar coordinate representation of $(x,y)$. ![image](https://hackmd.io/_uploads/ByGCF6fV1g.png) <br> Cylindrical coordinates are typically used in problems that involve symmetry about an axis. For example, the circular cylinder with $z-$axis as its axis can be represented in cylindrical coordinates simply by $r=c$. ![image](https://hackmd.io/_uploads/ryxkppGVkl.png) <br> **Example 3** What is the surface that has the equation $z=r$ in cylindircal coordinates. :::spoiler Answer Since $r\geq 0$, this surface lies about the $xy-$plane. Writing $r=\sqrt{x^2+y^2}$, we see that $z=\sqrt{x^2+y^2}$ which represents the upper half of a circular cone with $z-$axis as its axis. ::: <br> Suppose we want to change coordinates from $(x,y,z)$ to $(r,\theta,z)$. Then, as before, we write $x=r\cos \theta$ and $y = r \sin \theta$, and then, $T(r,\theta, z)=(r\cos \theta, r \sin \theta, z)$ is invertible and has continuous partial derivatives on $\mathbb P=\mathbb R^3\setminus \{(0,\theta,z)|\theta\in[0,2\pi)\}$ with $$\det J(r,\theta,z)=\begin{vmatrix} \cos \theta & -r\sin\theta & 0\\ \sin\theta& r\cos\theta &0 \\ 0 & 0 & 1\end{vmatrix} = r>0,\,\,\,\text{for all}\,\,\,(r,\theta,z)\in \mathbb P\,.$$ This gives us, for all $R \subseteq \mathbb P$, :::info $$\iiint_{T(R)} f(x,y,z)\,dx\,dy\,dz = \iiint_{R}f(r\cos\theta,r\sin\theta,z)\, r\,dr\,d\theta\,dz $$ ::: <br> **Example 4** Suppose the solid $E$ lies within the cylinder $x^2+y^2=1$, below the plane $z=4$, and above the paraboloid $z=1-x^2-y^2$. Evaluate the following integral.$$\iiint_{E} \sqrt{x^2+y^2}\,dx\,dy\,dz\,.$$ :::spoiler Answer We note that, in cylindrical coordinates, boundaries of $E$ are easier to represent. ![image](https://hackmd.io/_uploads/BkN970MNJx.png) So, \begin{align} \iiint_{E} \sqrt{x^2+y^2}\,dx\,dy\,dz\, &= \int_{0}^{2\pi}\int_{0}^1\int_{1-r^2}^4 r \,r \,dz\,dr\,d\theta \\&= \int_{0}^{2\pi}1\,d\theta\int_{0}^1 r^2 z\Big|_{z=1-r^2}^{z=4} \,dr \\&=2\pi\int_0^1r^2(3+r^2)\,dr=\frac{12}{5}\pi\,. \end{align} ::: <br> **Example 5** Evaluate $$\int_{-2}^2 \int_{-\sqrt{4-x^2}}^{\sqrt{4-x^2}}\int_{\sqrt{x^2+y^2}}^2 1 \,dz\,dy\,dx\,.$$ What is the physical interpretation of this integral? :::spoiler Answer Note that the solid region of integration is bounded between $z=r$ (upper half of a circular cone) and $z=2$ (see below). ![image](https://hackmd.io/_uploads/BkKRz0zN1l.png) So, we are computing the volume of this inverted solid cone, and we should get $\frac{8}{3}\pi$. \begin{align}\int_{-2}^2 \int_{-\sqrt{4-x^2}}^{\sqrt{4-x^2}}\int_{\sqrt{x^2+y^2}}^2 1 \,dz\,dy\,dx &= \int_0^{2\pi}\int_0^2\int_r^2 1\, r\,dz\,dr\,d\theta \\ &= 2\pi \int_{0}^2r(2-r)\,dr =2\pi\left(r^2-\frac{r^3}{3}\right)\Big|_{0}^2=\frac{8}{3}\pi.\end{align} ::: <br> ### 4.3.3 Spherical Coordinates The spherical coordinates of a point $P\equiv (x,y,z)\in \mathbb R^3 \setminus \{(0,0,0)\}$ is uniquely given as $(\rho, \theta, \phi)$ where - $\rho\geq 0$ is the distance from the origin, $O\equiv (0,0,0)$, to $P$, - $\theta \in [0,2\pi)$ is the same as in cylindrical coordinates, and - $\phi\in [0,\pi]$, is the angle between the positive $z-$axis and $OP$. ![image](https://hackmd.io/_uploads/HkKIiRGE1g.png) Therefore, $x = r\cos\theta = (\rho\sin\phi)\cos\theta\,$, $y=r\sin\theta = (\rho\sin\phi)\sin\theta\,$, and $z=\rho\cos\phi$. <br> **Example 6** What surfaces are represented by $\rho = c$, $\theta =c$ and $\phi=c$ in spherical coordinates. :::spoiler Answer $rho=c$ gives the sphere $x^2+y^2+z^2=c$ with $c \geq 0$. $\theta=c$ is the halfplane perpedicular to $xy-$plane that makes angle $c$ with $x-$axis. $\phi=c$ is a halfcone with $z-$axis as its axis. ![image](https://hackmd.io/_uploads/BJFG20z41x.png) ::: <br> The change $(x,y,z) \mapsto (\rho,\theta,\phi)$ is via $T(\rho,\theta,\phi)=(\rho\sin\phi\cos\theta, \rho\sin\phi\sin\theta, \rho\cos\phi)$. It is invertible and has continuous partial derivatives with $$\det J(\rho,\theta,\phi)=\begin{vmatrix} \sin\phi\cos\theta & - \rho\sin\phi\sin\theta & \rho\cos\phi\cos\theta \\\sin\phi\sin\theta & \rho\sin\phi\cos\theta & \rho\cos\phi\sin\theta \\ \cos\phi & 0 & -\rho\sin\phi\end{vmatrix} = \rho^2 \sin\phi >0 $$on $\mathbb P=\mathbb R^3\setminus\big\{(0,\theta,\phi)|\theta\in[0,2\pi), \phi \in\{0,\pi\}\big\}$. This gives us, for all $R \subseteq \mathbb P$, :::info $$\iiint_{T(R)} f(x,y,z)\,dxdydz = \iiint_{R}f(\rho\sin\phi\cos\theta,\rho\sin\phi\sin\theta,\rho\cos\phi)\, \rho^2\sin\phi\, d\rho d\theta d\phi$$ ::: <br> **Example 7** Compute the volume of the following solid. ![image](https://hackmd.io/_uploads/ByjLWyXEyl.png) :::spoiler Answer The equation of the spherical surface is $\rho^2=\rho\cos\phi$, i.e., $\rho=\cos\phi$. Also, the cone is $\rho\cos\phi =\sqrt{\rho^2\sin^2\phi\cos^2\theta+\rho^2\sin^2\phi\sin^2\theta} =\rho\sin\phi$. Which gives us $\sin\phi=\cos\phi$. That is $\phi=\pi/4$. So, the volume is \begin{align}\int_{0}^{2\pi}\int_{0}^{\pi/4}\int_{0}^{\cos \phi} 1\,\rho^2\sin\phi\,d\rho\,d\phi\,d\theta &= 2\pi \int_0^{\pi/4} \sin\phi\rho^3/3\Big|_{\rho=0}^{\rho=\cos\phi}\,d\phi \\ &= \frac{2\pi}{3}\int_0^{\pi/4} \sin\phi\cos^3\phi\,d\phi =\frac{2\pi}{3} \left[-\frac{\cos^4\phi}{4}\right]_{0}^{\pi/4}=\frac{\pi}{8}\,.\end{align} ![image](https://hackmd.io/_uploads/ByfRryXVyl.png) ::: <br> --- **Reference** 1. *Chapter 15.3, 15.7 & 15.8* : Stewart, J. (2012). Calculus (8th ed.). Boston: Cengage Learning. 2. *Chapter 14.2 & 14.4* : Strang G., Calculus (3rd ed.). [https://ocw.mit.edu/](https://ocw.mit.edu/courses/res-18-001-calculus-fall-2023/pages/textbook/) 3. *Chapter 3.5* : Corral, M. (2021). Vector Calculus. [https://www.mecmath.net/](https://www.mecmath.net/) --- <br> :::danger **Summary**: Now, we can - Change variables in multiple integrals using appropirate Jacobians. - Use polar coordinates to describe 2D regions. - Use cylindrical and spherical coordinates to describe 3D regions. - Set up and evaluate integrals in polar, cylindrical, and spherical coordinates. :::