Transforming Coordinates Using Variational Methods

By 苏剑林 | January 6, 2015

Coordinate Transformation for ODEs

Readers familiar with theoretical mechanics should be able to appreciate the role of variational methods in transforming coordinate systems. For example, if we want to transform the following equations for the planar two-body problem:

\[\left\{\begin{aligned}\frac{d^2 x}{dt^2}&=\frac{-\mu x}{(x^2+y^2)^{3/2}}\\ \frac{d^2 y}{dt^2}&=\frac{-\mu y}{(x^2+y^2)^{3/2}}\end{aligned}\right.\tag{1}\]

into polar coordinates, directly substituting the variables would be a very tedious calculation. However, we know that the equations above are simply the Euler-Lagrange equations resulting from the variation of the action:

\[S=\int \left[\frac{1}{2}\left(\dot{x}^2+\dot{y}^2\right)+\frac{\mu}{\sqrt{x^2+y^2}}\right]dt\tag{2}\]

Thus, we can directly perform the coordinate transformation on the action itself. Since the action generally only involves first-order derivatives, transforming the action is usually quite simple. For instance, it is easy to write the polar form of $(2)$ as:

\[S=\int \left[\frac{1}{2}\left(\dot{r}^2+r^2\dot{\theta}^2\right)+\frac{\mu}{r}\right]dt\tag{3}\]

By varying $(3)$, the resulting Lagrange equations are:

\[\left\{\begin{aligned}&\ddot{r}=r\dot{\theta}^2-\frac{\mu}{r^2}\\ &\frac{d}{dt}\left(r^2\dot{\theta}\right)=0\end{aligned}\right.\tag{4}\]

And just like that, the coordinate transformation is completed. If you want to try direct substitution into $(1)$ for a "brute force" calculation, please refer to "Equations and the Universe": The Ins and Outs of the Two-Body Problem (I).

Coordinate Transformation for PDEs

The above addressed coordinate transformations in ODEs; now let's discuss PDEs. In courses on partial differential equations and vector analysis, a common exercise is transforming the Laplace operator into polar, spherical, or other orthogonal coordinate systems to accommodate different boundary conditions. In such cases, variation can also play a role. Taking the two-dimensional Laplace operator as an example, we consider the equation:

\[\Delta^2 u=\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=F\tag{5}\]

where $F$ is a constant (What is the purpose of introducing $F$? I invite the reader to think about this). To consider the polar form of $(5)$, we only need to note that it is the result of the variation of the action:

\[S=\int \left[\frac{1}{2}\left(\left(\frac{\partial u}{\partial x}\right)^2+\left(\frac{\partial u}{\partial y}\right)^2\right)+F u\right] dxdy\tag{6}\]

We can transform the coordinates directly in $(6)$ and then take the variation. We can quickly write:

\[S=\int \left[\frac{1}{2}\left(\left(\frac{\partial u}{\partial r}\right)^2+\left(\frac{1}{r}\frac{\partial u}{\partial \theta}\right)^2\right)+F u\right] rd\theta dr\tag{7}\]

The result of the variation gives (don't miss the $r$ in front of $d\theta dr$):

\[\frac{\partial}{\partial r}\left(r\frac{\partial u}{\partial r}\right)+\frac{1}{r}\frac{\partial^2 u}{\partial \theta^2}=F r\tag{8}\]

Which is:

\[\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u}{\partial r}\right)+\frac{1}{r^2}\frac{\partial^2 u}{\partial \theta^2}=F\]

By comparing it with equation $(5)$, we obtain:

\[\frac{\partial^2 }{\partial x^2}+\frac{\partial^2 }{\partial y^2}=\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial }{\partial r}\right)+\frac{1}{r^2}\frac{\partial^2 }{\partial \theta^2}\]

The computational cost should be slightly lower than directly substituting the coordinate transformation formulas for a "hard calculation."

The reader might point out: You cheated! The reason you calculated it so quickly is that you pre-calculated the Jacobian determinant for polar coordinates (multiple integral transformation), and the transformation of the "kinetic energy" terms wasn't that obvious either! If you included those calculations, the time might far exceed direct substitution.

Readers thinking this are indeed correct; if you first go calculate a Jacobian determinant, then simplify, then vary, the computational load is also quite large. However, what I am emphasizing here is: simple answers might have simple processes (if the answer itself is complex, no amount of skill will make it simple), and unfamiliar problems might be convertible into familiar ones. In the transformation of the Laplace operator, at least for me, the process of direct transformation is unfamiliar, whereas the Jacobian determinant for polar (including spherical) coordinates is familiar, and variational methods are also quite familiar. Therefore, I would rather use this variational trick—which seems roundabout—to derive the transformation of the Laplace operator.

Furthermore, polar and spherical coordinates are orthogonal coordinate systems. For orthogonal coordinate systems, writing out the Jacobian determinant is not particularly difficult. For example, in polar coordinates, we only need to note that $r d\theta$ and $dr$ are the orthogonal differentials in the polar coordinate system to immediately write $dxdy = r d\theta dr$ and $\left(\frac{\partial u}{\partial x}\right)^2+\left(\frac{\partial u}{\partial y}\right)^2=\left(\frac{\partial u}{\partial r}\right)^2+\left(\frac{1}{r}\frac{\partial u}{\partial \theta}\right)^2$.

Another Example

Let's take another example, such as an orthogonal coordinate system $(\xi, \eta)$:

\[\left\{\begin{aligned}&x=\xi^2-\eta^2\\ &y=2\xi\eta\end{aligned}\right.\]

(Why are $(\xi, \eta)$ orthogonal? Here I have indeed cheated; this is expanded from $x+yi = (\xi+\eta i)^2$, and the real and imaginary parts of an analytic function are necessarily orthogonal.)
We can calculate:

\[ds^2=dx^2+dy^2=\left(\xi^2+\eta^2\right)\left(d\xi^2+d\eta^2\right)\]

Thus, the two orthogonal differentials are $\sqrt{\xi^2+\eta^2}d\xi$ and $\sqrt{\xi^2+\eta^2}d\eta$. Therefore, we can quickly write:

\[\begin{aligned}&dxdy=\sqrt{\xi^2+\eta^2}d\xi\cdot\sqrt{\xi^2+\eta^2}d\eta=\left(\xi^2+\eta^2\right)d\xi d\eta\\ &\left(\frac{\partial u}{\partial x}\right)^2+\left(\frac{\partial u}{\partial y}\right)^2=\left(\frac{1}{\sqrt{\xi^2+\eta^2}}\frac{\partial u}{\partial \xi}\right)^2+\left(\frac{1}{\sqrt{\xi^2+\eta^2}}\frac{\partial u}{\partial \eta}\right)^2\end{aligned}\]

Thus, the action transforms into:

\[S=\int \left[\frac{1}{2}\left(\left(\frac{\partial u}{\partial \xi}\right)^2+\left(\frac{\partial u}{\partial \eta}\right)^2\right)+F u \left(\xi^2+\eta^2\right) \right] d\xi d\eta\]

The result of the variation is:

\[\frac{\partial^2 u}{\partial \xi^2}+\frac{\partial^2 u}{\partial \eta^2}=F\cdot\left(\xi^2+\eta^2\right) \]

Consequently:

\[\frac{\partial^2 }{\partial x^2}+\frac{\partial^2 }{\partial y^2}=\frac{1}{\xi^2+\eta^2}\left(\frac{\partial^2 u}{\partial \xi^2}+\frac{\partial^2 u}{\partial \eta^2}\right)\]

Spherical Coordinates Example

Now we come to the three-dimensional case. Here I will only discuss spherical coordinates:

\[\left\{\begin{aligned}&x=r\sin\theta\cos\phi\\ &y=r\sin\theta\sin\phi\\ &z=r\cos\theta\end{aligned}\right.\]

We can calculate:

\[\begin{aligned}ds^2&=\left[d\left(r\sin\theta\right)\right]^2+\left(r\sin\theta\right)^2 d\phi^2+\left[d\left(r\cos\theta\right)\right]^2\\ &=dr^2+r^2 d\theta^2 +\left(r\sin\theta\right)^2 d\phi^2\end{aligned}\]

where the first step applies the polar coordinate transformation formula once to the first two coordinates (treating the radius as $(r\sin\theta)$); overall, it's just using the polar transformation formula twice. Thus, we obtain the orthogonal differentials for the sphere as $dr, r d\theta, r\sin\theta d\phi$, which gives:

\[\begin{aligned}&dxdydz=r^2\sin\theta dr d\theta d\phi\\ &\left(\frac{\partial u}{\partial x}\right)^2+\left(\frac{\partial u}{\partial y}\right)^2+\left(\frac{\partial u}{\partial z}\right)^2=\left(\frac{\partial u}{\partial r}\right)^2+\left(\frac{1}{r}\frac{\partial u}{\partial \theta}\right)^2+\left(\frac{1}{r\sin\theta}\frac{\partial u}{\partial \phi}\right)^2\end{aligned}\]

The action is then:

\[S=\int {\left[\frac{1}{2}\left(\left(\frac{\partial u}{\partial r}\right)^2+\left(\frac{1}{r}\frac{\partial u}{\partial \theta}\right)^2+\left(\frac{1}{r\sin\theta}\frac{\partial u}{\partial \phi}\right)^2\right)+F u\right] r^2\sin\theta dr d\theta d\phi}\]

The result of the variation is:

\[\frac{\partial}{\partial r}\left(r^2\sin\theta\frac{\partial u}{\partial r}\right)+\frac{\partial}{\partial \theta}\left(\sin\theta\frac{\partial u}{\partial \theta}\right)^2+\frac{1}{\sin\theta}\frac{\partial^2 u}{\partial \phi^2}=F r^2\sin\theta\]

Finally, simplifying gives:

\[\Delta u=\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial u}{\partial r}\right)+\frac{1}{r^2\sin\theta}\frac{\partial}{\partial \theta}\left(\sin\theta\frac{\partial u}{\partial \theta}\right)+\frac{1}{r^2\sin^2\theta}\frac{\partial^2 u}{\partial \phi^2}\]

Which method is actually simpler? I'll let the reader decide for themselves. ^_^