# Page 2 of :All the Steps in Transforming the Laplace Equation ($\displaystyle\Delta f=0$)from Rectangular to Cylindrical and to Spherical Coordinates

$\leftarrow$ Previous Page

## Transforming from Cartesian to Cylindrical - Approach 2

$\newcommand{\pdif}[2]{\frac{\partial #1}{\partial #2}}$

Again, we assume $f$ is a function of the three rectangular coordinates ($x, y, z$), which is continuous and has continuous partial derivatives of the first and second orders. $\nabla^2$ is defined by: $\nabla^2 f = \large{\pdif{^2 f}{x^2} \ +\ \pdif{^2 f}{y^2} \ +\ \pdif{^2 f}{z^2}}$ and it will be transformed into then cylindrical coordintates ($\rho, \phi, z$), which are related to the cartesian as follows: $x = \rho \cos \phi ,\quad y = \rho \sin \phi ,\quad z=z\quad$ and $\quad\phi =\arctan\frac{y}{x} ,\quad\rho =\sqrt{x^2 + y^2}\ .$

Once again, the chain rule is applied, but in this approach, to the parametric equations: $\rho =\rho(x, y)$ and $\phi =\phi(x, y)$, resulting in the following:

$$\pdif{f}{\rho} =\pdif{f}{x}\ \pdif{x}{\rho} +\pdif{f}{y}\ \pdif{y}{\rho}\ \ \textbf{(II.1.a)}\quad \text{and}\quad \pdif{f}{\phi} = \pdif{f}{x}\ \pdif{x}{\phi} +\pdif{f}{y}\ \pdif{y}{\phi}\ \ \textbf{(II.1.b)}$$

Using the coordinate relations for transforming cartesian to cylindrical, the derivatives of $x$ and $y$ with respect to $\rho$ and $\phi$ require far less work than what was necessary under Approach 1, resulting in:

$$\pdif{x}{\rho} =\pdif{\ (\rho\ \cos\phi)}{\rho} =\cos \phi\ ,\quad \pdif{y}{\rho} =\pdif{\ (\rho\ \sin\phi)}{\rho} =\sin\phi\ \ \textbf{(II.2.a1, II.2.a2)} \quad \text{and}$$ $$\pdif{x}{\phi} =\pdif{\ (\rho\ \cos\phi)}{\phi} = -\rho \sin\phi\ ,\quad\pdif{y}{\phi} =\pdif{\ (\rho\ \sin\phi)}{\phi} =\rho \cos\phi\ \ \textbf{(II.2.b1, II.2.b2)}$$

Substituting these derivatives into equations (II.1.a) and (II.1.b) above, we obatin:

$$\pdif{f}{\rho} =\cos\phi\ \pdif{f}{x} +\sin\phi\ \pdif{f}{y}\ \ \textbf{(II.3.a)}\quad \text{and}\quad \pdif{f}{\phi} = -\rho \sin\phi\ \pdif{f}{x} +\rho \cos\phi\ \pdif{f}{y}\ \ \textbf{(II.3.b)}$$

Solving for $\partial f / \partial x$ and $\partial f / \partial y$ in both equations above,[1] produces two different sets of equations; each set having either $\partial f / \partial x$ or $\partial f / \partial y$ on their left sides, and after equating those and reducing terms, we obtain:

$$\pdif{f}{x} =\cos\ \phi\ \pdif{f}{\rho} -\frac{\sin \phi}{\rho}\ \pdif{f}{\phi}\ \quad \text{and}\quad \pdif{f}{y} =\sin\ \phi\ \pdif{f}{\rho} +\frac{\cos \phi}{\rho}\ \pdif{f}{\phi}$$

which are identical to equations (3.a) and (3.b) under Approach 1.

One can of course follow the same steps presented on the previous page in order to arrive at Equation (C) from here. However, a slighly different approach will be presented on this page, by substituting the equations above into:

\begin{align*} \pdif{^2 f}{x^2} =\pdif{}{x} \left(\pdif{f}{x}\right) &\quad\text{and}\quad\pdif{^2 f}{y^2} =\pdif{}{y} \left(\pdif{f}{y}\right)\quad \text{resulting in:}\\ \\ \pdif{^2 f}{x^2} =\pdif{}{x} \left(\cos\ \phi\ \pdif{f}{\rho} -\frac{\sin \phi}{\rho}\ \pdif{f}{\phi}\right) &\quad\text{and}\quad\pdif{^2 f}{y^2} =\pdif{}{y} \left(\pdif{f}{y} =\sin\ \phi\ \pdif{f}{\rho} +\frac{\cos \phi}{\rho}\ \pdif{f}{\phi}\right)\end{align*}

And then rearranging the right sides of both:

\begin{align*} &\pdif{^2 f}{x^2} =\cos\phi \left[\pdif{}{\rho} \left(\pdif{f}{x}\right)\right] -\frac{\sin\phi}{\rho} \left[\pdif{}{\phi} \left(\pdif{f}{x}\right)\right]\quad\text{and}\\ \\ &\pdif{^2 f}{y^2} =\sin\phi \left[\pdif{}{\rho} \left(\pdif{f}{y}\right)\right] +\frac{\cos\phi}{\rho} \left[\pdif{}{\phi} \left(\pdif{f}{y}\right)\right]\end{align*}

Which are identical to equations (5.a) and (5.b) on the previous page, and all the intermediary steps on that page from this point will result in the Equation 7 and then the Laplace Equation in cylindrical coordinates; Equation (C).

## All the Intermediate and Detailed Steps for the Equations Above:

As mentioned in the footnotes, here are the detailed steps for the arriving at equations (3.a) and (3.b) using equations (II.3.a) and (II.3.b) under Approach 2. By first solvinig for $\partial f / \partial y$ in both, equating them and then solving for $\partial f / \partial x$, that will lead to equation (3.a):

 \begin{align*} \pdif{f}{\rho} & =\cos\phi\ \pdif{f}{x} +\sin\phi\ \colorbox{yellow}{$\pdif{f}{y}$}\ \ \textbf{(II.3.a)}\quad \\ \quad \sin\phi\ \pdif{f}{y} & =\pdif{f}{\rho} -\cos\phi\ \pdif{f}{x}\\ \colorbox{yellow}{$\pdif{f}{y}$} & =\left(\frac{\partial f / \partial\rho}{\sin \phi}\right) -\frac{\cos \phi}{\sin \phi}\ \pdif{f}{x} \end{align*} \begin{align*} \pdif{f}{\phi} & = -\rho \sin\phi\ \pdif{f}{x} +\rho \cos\phi\ \colorbox{yellow}{$\pdif{f}{y}$}\ \ \textbf{(II.3.b)}\quad \\ \quad \rho \cos\phi\ \pdif{f}{y} & =\pdif{f}{\phi} +\rho \sin\phi\ \pdif{f}{x}\\ \colorbox{yellow}{$\pdif{f}{y}$} & =\left(\frac{\partial f / \partial\phi}{\rho \cos \phi}\right) +\frac{\colorbox{pink}{$\rho$} \sin\phi}{\colorbox{pink}{$\rho$} \cos\phi}\ \pdif{f}{x} \end{align*} \begin{align*} \left(\frac{\partial f / \partial\rho}{\sin \phi}\right) -\frac{\cos \phi}{\sin \phi}\ \pdif{f}{x} & \colorbox{yellow}{$=$}\left(\frac{\partial f / \partial\phi}{\rho \cos \phi}\right) +\frac{\sin\phi}{\cos\phi}\ \pdif{f}{x}\quad \text{(multiply by: $\rho\ \sin\phi\ \cos\phi$)}\\ \rho\ \cos\phi\ \pdif{f}{\rho} -\rho \cos^2\phi\ \pdif{f}{x} & =\sin\phi\ \pdif{f}{\phi} +\rho \sin^2\phi\ \pdif{f}{x}\quad \text{(flip and combine $\colorbox{yellow}{$\partial f / \partial x$}$ terms)}\\ \rho \left(\sin^2\phi\ +\cos^2\phi\right)\ \pdif{f}{x} & =\rho\ \cos\phi\ \pdif{f}{\rho} -\sin\phi\ \pdif{f}{\phi}\quad \text{(divide by $\rho$)}\\ \left(\sin^2\phi\ +\cos^2\phi\right)\ \pdif{f}{x} & =\cos\phi\ \pdif{f}{\rho} -\frac{\sin\phi}{\rho}\ \pdif{f}{\phi}\quad \text{(but $\colorbox{lightgreen}{$\sin^2\phi +\cos^2\phi = 1$}$, so:)}\\ \colorbox{yellow}{$\pdif{f}{x}$} & =\cos\phi\ \pdif{f}{\rho} -\frac{\sin\phi}{\rho}\ \pdif{f}{\phi}\quad \textbf{(3.a)} \end{align*}

Likewise, first solving for $\partial f / \partial x$ and equating them leads to equation (3.b):

 \begin{align*} \pdif{f}{\rho} & =\cos\phi\ \colorbox{yellow}{$\pdif{f}{x}$} +\sin\phi\ \pdif{f}{y}\ \ \textbf{(II.3.a)}\quad \\ \quad \cos\phi\ \pdif{f}{x} & =\pdif{f}{\rho} - \sin\phi\ \pdif{f}{y}\\ \colorbox{yellow}{$\pdif{f}{x}$} & =\left(\frac{\partial f / \partial\rho}{\cos \phi}\right) - \frac{\sin \phi}{\cos \phi}\ \pdif{f}{y} \end{align*} \begin{align*} \pdif{f}{\phi} & = -\rho \sin\phi\ \colorbox{yellow}{$\pdif{f}{x}$} +\rho \cos\phi\ \pdif{f}{y}\ \ \textbf{(II.3.b)}\quad \\ \quad \colorbox{lightgreen}{$-\rho$} \sin\phi\ \pdif{f}{x} & =\pdif{f}{\phi} \colorbox{lightgreen}{$-\rho$} \cos\phi\ \pdif{f}{y}\\ \colorbox{yellow}{$\pdif{f}{x}$} & =\left(\frac{\partial f / \partial\phi}{- \rho\ \sin\phi}\right) \colorbox{lightgreen}{+} \frac{\cos \phi}{\sin \phi}\ \pdif{f}{y} \end{align*} \begin{align*} \left(\frac{\partial f / \partial\rho}{\cos \phi}\right) - \frac{\sin \phi}{\cos \phi}\ \pdif{f}{y} & \colorbox{yellow}{$=$}\left(\frac{\partial f / \partial\phi} {\colorbox{lightgreen}{$-$} \rho\ \sin\phi}\right) + \frac{\cos \phi}{\sin \phi}\ \pdif{f}{y}\\ \left(\frac{\partial f / \partial\rho}{\cos \phi}\right) - \frac{\sin \phi}{\cos \phi}\ \pdif{f}{y} & =\frac{\cos \phi}{\sin \phi}\ \pdif{f}{y} \colorbox{lightgreen}{$-$} \left(\frac{\partial f / \partial\phi}{\rho\ \sin\phi}\right)\quad \text{(multiply by: $\rho\ \sin\phi\ \cos\phi$)}\\ \rho\ \sin\phi\ \pdif{f}{\rho} - \rho\ \sin^2\phi\ \pdif{f}{y} & =\rho\ \cos^2\phi\ \pdif{f}{y} -\cos\phi\ \pdif{f}{\phi}\quad \text{(flip and combine $\colorbox{yellow}{$\partial f / \partial y$}$ terms)}\\ \left(\rho\ \cos^2\phi + \rho\ \sin^2\phi\right)\ \pdif{f}{y} & =\rho\ \sin\phi\ \pdif{f}{\rho} + \cos\phi\ \pdif{f}{\phi}\quad \text{(divide by $\rho$)}\\ \left(\cos^2\phi + \sin^2\phi\right)\ \pdif{f}{y} & =\sin\phi\ \pdif{f}{\rho} +\frac{\cos\phi}{\rho}\ \pdif{f}{\phi}\quad \text{(but $\colorbox{lightgreen}{$\sin^2\phi +\cos^2\phi = 1$}$, so:)}\\ \colorbox{yellow}{$\pdif{f}{y}$} & =\sin\phi\ \pdif{f}{\rho} +\frac{\cos\phi}{\rho}\ \pdif{f}{\phi}\quad \textbf{(3.b)} \end{align*}

## Transforming the Laplace Operator from Cylindrical to Spherical Coordinates

Although it is possible to convert the Laplace Equation directly from cartesian to spherical coordinates (as mentioned in the introduction to this work, and my purpose for posting these pages), it’s much simpler to use Equation 7 and the following relations between cylindrical ($\rho, \phi, z$) and spherical ($r, \theta, \phi$) coordinates for the conversion: $z = r \cos\theta ,\quad\rho = r \sin\theta ,\quad\phi =\phi .$

Perhaps some of you can already see that these relations (except for the names of the variables involved) are identical to the ones used in converting from cartesian to cylindrical coordinates ($x = \rho \cos\phi ,\quad y = \rho \sin\phi ,\quad z=z$). This is not only a curiosity, but precisely why the conversion can be completed in a short time without any further calculations! All the equations used in this transformation would be exactly the same as those used previously after simply replacing the variable names. Thus, the Fundamental Identity (for converting from cartesian to cylindrical):

$$\pdif{^2 f}{x^2} +\pdif{^2 f}{y^2} \colorbox{lightgreen}{=} \pdif{^2 f}{\rho^2} +\frac{1}{\rho}\ \pdif{f}{\rho} +\frac{1}{\rho^2}\ \pdif{^2 f}{\phi^2}\quad \textbf{(7)}$$

can by simple analogy, be rewritten (for converting from cylindrical to spherical) as:

$$\pdif{^2 f}{z^2} +\pdif{^2 f}{\rho^2} \colorbox{lightgreen}{=} \pdif{^2 f}{\ r^2} +\frac{1}{r}\ \pdif{f}{\ r} +\frac{1}{r^2}\ \pdif{^2 f}{\ \theta^2}\quad \textbf{(8)}$$

where on the left side, $x\rightarrow z$  and  $y\rightarrow\rho$, and on the right side, $\rho\rightarrow r$  and  $\phi\rightarrow\theta$ .

This provides us with the sum of only two of the four terms on the right side of Equation C, so we do need to do a bit more work to convert the remaining cylindrical terms from C to spherical. Starting with equation (3.b),

 $$\quad\pdif{f}{y} =\sin\phi\ \pdif{f}{\rho} +\frac{\cos\phi}{\rho}\ \pdif{f}{\phi}\quad \textbf{(3.b)}\quad$$

once again, by analogy, where $y\rightarrow\rho$ on the left side, $\rho\rightarrow r$ and $\phi\rightarrow\theta$ on the right side, we then have:

 \begin{align*} \pdif{f}{\rho} & =\sin\theta\ \pdif{f}{\ r} +\frac{\cos\theta}{r}\ \pdif{f}{\ \theta}\quad\text{(and}\\ \quad\text{since }\rho & = r \sin\theta\text{ ), then:}\\ \frac{1}{\rho}\ \pdif{f}{\rho} & \colorbox{lightgreen}{$=$}\frac{1 \colorbox{pink}{$\sin\theta$}}{r \colorbox{pink}{$\sin\theta$}}\ \pdif{f}{\ r} +\frac{\cos\theta}{r^2 \sin\theta}\ \pdif{f}{\ \theta}\ \textbf{(9)}\quad \end{align*}

And for the remaining term of Equation C, since $\phi =\phi$, the conversion becomes:

 $$\quad\frac{1}{\rho^2}\ \pdif{^2 f}{\phi^2} \colorbox{lightgreen}{=}\frac{1}{r^2\ \sin^2\theta}\ \pdif{^2 f}{\phi^2}\quad\textbf{(10)}\quad$$

Combining all the terms on the right sides of equations (8), (9) and (10), gives us:

$$\pdif{^2 f}{\ r^2} +\colorbox{lightgreen}{\frac{1}{r}\ \pdif{f}{\ r}} +\frac{1}{r^2}\ \pdif{^2 f}{\ \theta^2} +\colorbox{lightgreen}{\frac{1}{r}\ \pdif{f}{\ r}} +\frac{\cos\theta}{r^2 \sin\theta}\ \pdif{f}{\ \theta} +\frac{1}{r^2\ \sin^2\theta}\ \pdif{^2 f}{\phi^2}\quad\textbf{(11)}$$

So, for $r > 0$  and  $0 < \theta < \pi$, we now have the Laplace Equation in spherical coordinates:

$$\colorbox{lightblue}{\large{\nabla^2 f =\pdif{^2 f}{\ r^2}\ +\ \frac{2}{r}\ \pdif{f}{\ r}\ +\frac{1}{r^2}\ \pdif{^2 f}{\ \theta^2}\ +\frac{cos\thinspace\theta}{r^2\thinspace\sin\theta }\ \pdif{f}{\ \theta}\ +\ \frac{1}{r^2\thinspace\sin^2\thinspace\theta}\ \pdif{^2 f}{\phi^2} = 0}}\quad\textbf{(Equation S)}$$

## $\leftarrow$ Previous Page Next Page: Direct Transformation from Cartesian to Spherical Coordinates

The Math symbols and equations displayed here use LaTeX under MathJaX.

Footnotes

1[Return to Text] See the detailed work at the end of this section!

First Posted on: 11 November 2023 (2023.11.11).
Updated on:
12 NOV 2023 (2023.11.12); added a number of clarifications, including use of the $\rightarrow$ symbol.

You can write to me here: contact page.

Math Index Index Page

The Starman’s Realm Index Page