English (unofficial) translations of posts at kexue.fm
Source

Transforming Coordinates via the Calculus of Variations

Translated by DeepSeek V4 Pro. Translations can be inaccurate, please refer to the original post for important stuff.

Coordinate Transformation of ODEs

Readers familiar with theoretical mechanics should be able to appreciate the role of the calculus of variations 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, substituting the variables directly would result in a very tedious calculation. However, we know that the above equations are simply the 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} Therefore, we can directly perform the coordinate transformation on the action itself. Since the action generally only involves first-order derivatives, its transformation is usually relatively simple. For instance, it is easy to write the form of (2) in polar coordinates as: S = \int \left[\frac{1}{2}\left(\dot{r}^2+r^2\dot{\theta}^2\right)+\frac{\mu}{r}\right]dt \tag{3} Taking the variation of (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} In this way, the transformation of the coordinate system is completed. If you wish to calculate it by brute force substitution into (1), please refer to "Equations and the Universe: The Ins and Outs of the Two-Body Problem (I)".

Coordinate Transformation of PDEs

Having discussed coordinate transformations in ODEs, let us now turn to PDEs. In courses on partial differential equations and vector analysis, the most common exercise is to transform the Laplacian operator into polar, spherical, or other orthogonal coordinate systems to accommodate different boundary conditions. In these cases, variation can also play a role. Taking the two-dimensional Laplacian 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 leave this for the reader to consider). To consider the form of (5) in polar coordinates, 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 directly transform the coordinates 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 (don’t forget the r in front of d\theta dr) gives: \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 Comparing this 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 effort is slightly lower than calculating it by direct substitution of the coordinate transformation formulas.

Readers might point out: You cheated! You calculated it quickly because you pre-calculated the Jacobian determinant for polar coordinates (transformation of multiple integrals), and the transformation of the kinetic energy term was not that obvious either! If those calculations are included, the time might far exceed direct substitution.

Readers who think this way are indeed correct. If one first calculates the Jacobian determinant and then simplifies and varies, the workload is also quite large. However, what I want to emphasize here is: simple answers may have simple processes (if the answer itself is complex, no technique will make it simple), and unfamiliar problems can perhaps be converted into familiar ones. In the transformation of the Laplacian, at least for me, the transformation process itself is unfamiliar, whereas the Jacobian determinant for polar (including spherical) coordinates is familiar, and the calculus of variations is also quite familiar. Therefore, I would rather use this variational technique—which seems roundabout—to derive the transformation of the Laplacian.

Secondly, 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, one only needs to notice that r d\theta and dr are orthogonal differential elements 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 the 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 am indeed "cheating"—this is expanded from x+yi=(u+vi)^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 differential elements 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)

Example of Spherical Coordinates

Now we come to the three-dimensional case. Here we 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} The first step is simply applying the polar coordinate transformation formula once to the first two coordinates (treating the radius as r\sin\theta); overall, it just uses the polar transformation formula twice. Thus, we obtain the orthogonal differential elements for the sphere: dr, r d\theta, r\sin\theta d\phi. Therefore: \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: 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)+\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 leave that to the reader to decide. ^_^

When reprinting, please include the original address of this article: https://kexue.fm/archives/3181

For more detailed reprinting matters, please refer to: "Scientific Space FAQ"