Laplacian in Polar Coordinates¶
The Euclidean Laplacian has a coordinate-independent meaning, but its formula changes with the coordinates. We derive the polar-coordinate expression from the metric and then verify it by the multivariable chain rule.
Coordinate metric¶
The line element is
$$ds^2=dr^2+r^2d\theta^2$$
The coordinate map is differentiated to obtain tangent vectors. Their dot products give the metric, and its inverse is then computed from that induced matrix.
declare symbol r, θ : MathValue
def x : Vector MathValue := [| r, θ |]
def position : Vector MathValue := [| r * cos θ, r * sin θ |]
def e_i_j : Matrix MathValue := ∂/∂ position_j x~i
def g_i_j : Matrix MathValue :=
generateTensor (\[a, b] -> V.* e_a_# e_b_#) [2, 2]
def g~i~j : Matrix MathValue := M.inverse g_#_#
def f : MathValue := function (r, θ)
g_#_#
Covariant derivation¶
For a scalar field, the Laplace--Beltrami operator can be written
$$ \Delta f=g^{ij}\partial_i\partial_jf -g^{ij}\Gamma^k{}_{ij}\partial_kf. $$
Egison contracts the repeated tensor indices in precisely this formula.
def Γ_i_j_k : Tensor MathValue :=
(1 / 2) *
(∂/∂ g_i_k x~j + ∂/∂ g_i_j x~k - ∂/∂ g_j_k x~i)
def Γ~i_j_k : Tensor MathValue := withSymbols [m]
g~i~m . Γ_m_j_k
def laplacian : MathValue := withSymbols [i, j, k]
g~i~j . ∂/∂ (∂/∂ f x~j) x~i
- g~i~j . Γ~k_i_j . ∂/∂ f x~k
Result¶
$$ \Delta f=\frac{\partial^2f}{\partial r^2} +\frac1r\frac{\partial f}{\partial r} +\frac1{r^2}\frac{\partial^2f}{\partial\theta^2}. $$
laplacian
Chain-rule verification¶
Finally we regard a Cartesian function of two variables as a function of the new coordinates. Expanding the displayed coordinate formula should cancel every mixed derivative and leave the Cartesian Laplacian.
def X : MathValue := r * cos θ
def Y : MathValue := r * sin θ
def u : MathValue := function (X, Y)
def uR : MathValue := ∂/∂ u r
def uRR : MathValue := ∂/∂ (∂/∂ u r) r
def uΘΘ : MathValue := ∂/∂ (∂/∂ u θ) θ
uRR + uR / r + uΘΘ / r^2
The expanded result is $u_{XX}+u_{YY}$, confirming that the $r^{-1}u_r$ term compensates for the changing angular scale.