Finding the geodesic on a cylinder

This video was produced by The Kaizen Effect\(^{[1]}\).


We’ll start off with a very basic problem; the goal of this problem is just to get a feel for how minimization problems are solved using the Euler-Lagrange equation. As we go through multiple problems, hopefully we’ll start to notice patterns and general procedures which were taken in each problem to get the result. The problem we’re going to look at here can be stated as follows: for any two coordinate points \((x_1,y_1)\) and \((x_2,y_2)\) on the surface of a cylinder, we need to find the curve on the cylinder connecting those two points which has the smallest possible arc length \(S\). The shortest path between any two points on a curved surface is called a geodesic, to clarify the title of this article and the video above. You could imagine expressing the generalized coordinates \(q_j\) in Cartesian coordinates as \((x,y,z)\) which will represent any curve on the cylinder between the coordinate points \((x_1,y_1,z_1)\) and \((x_2,y_2,z_1)\). The arc length \(S\) can be expressed as a functional of these coordinates as




(As a side not, \(P_1\) and \(P_2\) refer to the starting and ending point of the curve as shown in the video above.) In order to solve the Euler-Lagrange equation for the coordinates \((x,y,z)\) which minimize the functional \(S\), we need to solve them—and to do that, we must take derivatives of \(L\) with respect to our choice of generalized coordinates. The general character of many problems is to choose generalized coordinates which make evaluating these derivatives the easiest. For this reason, we’ll choose our generalized coordinates to be polar coordinates. The algebraic and trigonometric manipulations used to express our Cartesian coordinates and arc length in terms of polar coordinates are shown in the video and, for convenience, I’ll also list them below\(^1\):

$$x=Rcosθ ⇒ dx=-Rsinθdθ$$

$$y=Rsinθ ⇒ dy=-Rcosθdθ$$

$$z=z ⇒ dz=dz$$



The whole point of all that was just to express \(S\) as functional of the form \(S(z(\theta), z’(\theta), \theta)\) in terms of polar coordinates because, according to our derivation, only then can we solve for the curve \(z(\theta)\) (using the Euler-Lagrange equation) which minimizes \(S\). (It is very important to always know what we’re actually trying to do in these kinds of problems; it is all too easy to get lost in the math and lose track of what we’re actually trying to accomplish.) To actually solve the Euler-Lagrange equation to find the curve \(z(\theta)\) whose arc length is minimized, we’ll need to solve that differential equation. To do this, we’ll evaluate each of the derivatives as shown in the video and below:




Something very nice happened to the equation on the bottom which, in general, does not happen; we see that the derivative \((\frac{z’}{R^2+(\frac{dz}{dθ})^2})\) is equal to zero; if the rate-of-change of that single variable function is zero, then it must be a constant:


(\(C\) represents any arbitrary constant.) To make sure we’re not getting lost in the math, I’ll repeat and continue to repeat, our goal is to find \(q_j(\theta)=(z(\theta),R(\theta)=constant)\) which is the curve that minimizes \(S\). So what we’re going to do is some algebraic manipulations on the equation above to try to isolate \(z(\theta)\). The first thing that immediately comes to my mind is to integrate both sides to get rid of that derivative on the left-hand side of the equation above. You might try integrating both sides of the equation as it currently is, but let’s do some algebra first (written below) to simplify the thing that we’re taking a derivative of:


Notice that the expression on the right-hand side of the bottom equation is a constant. Let’s represent the right-hand side by \(m\) as in the video. Since \(m\) is just a constant when we integrate both sides with respect to the independent variable \(θ\), we get:


This equation gives us the shortest path between two points \(P_1\) and \(P_2\) if we unraveled the cylinder and flattened it out into a flat plane. If you imagine rolling this plane back up again, the shape that \(z(θ)\) will trace out along the surface of the cylinder will be a helix. The Euler-Lagrange equation can be used to find the geodesic on any curved surface. A similar procedure to what we did in this section involving finding the geodesic of a cylinder can be generalized to find the geodesic along any surface.

This article is licensed under a CC BY-NC-SA 4.0 license.


1. The Kaizen Effect. "Lagrangian Mechanics - Lesson 2: Finding Geodesics on Any Surface". Online video clip. YouTube. YouTube, 21 May 2016. Web. 18 May 2017.


1. If you are rusty on trigonometry or the chain rule, I suggest getting freshened up using the Khan Academy’s videos on these topics.