Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

As we will use it, the Calculus of Variations focuses on finding the conditions for extrema of quantities that can be expressed as an integral. This might be a very abstract concept, so we will start with a simple example.

This approach might seem a bit alien at first, but it turns out to be an interesting way to develop an equivalent formulation of mechanics. Moreover, the Calculus of Variations is a powerful tool in many fields, and forms the basis for Lagrangian mechanics.

To do this, we will derive (in 1D) the Euler-Lagrange equation. This equation gives us a way to find the function that makes the integral of a given functional stationary (i.e., a local maximum or minimum).

Canonical Conceptualization - Finding the Shortest Path in a Plane

Using the Calculus of Variations, we can show that the shortest path between two points in a plane is a straight line. This is a classic example, but it illustrates the concept well. Consider a general path in two-dimensional space that connects two points, say s1=⟨x1,y1⟩s_1 = \langle x_1, y_1 \rangle and s2=⟨x2,y2⟩s_2 = \langle x_2, y_2 \rangle. We can represent this path as a function y(x)y(x). The figure below illustrates the setup.

Source
<Figure size 640x480 with 1 Axes>

The blue solid line is the ‘generic path’ that connects the two points s1s_1 and s2s_2. The green dotted line is the solution that we expect to get when we ask, “what is the shortest path between these two points?”

Setup of the Problem

Let’s take a generic segment of the path dsds and express it in terms of its differential elements:

ds=dx2+dy2.ds = \sqrt{dx^2 + dy^2}.

The length of the path from s1s_1 to s2s_2 can be expressed as an integral:

l=∫s1s2dsl = \int_{s_1}^{s_2} ds

We want to minimize this length, ll, which is the total length of the path. To do this, we are attempting to minimize the integral of dsds over the path. This is where the Calculus of Variations comes in.

Let’s write the expression for dsds in a more convenient form. We can factor out the dxdx term:

ds=dx2+dy2=dx1+(dydx)2=dx1+y′(x)2ds = \sqrt{dx^2 + dy^2} = dx \sqrt{1 + \left(\frac{dy}{dx}\right)^2} = dx\sqrt{1+y'(x)^2}

where y′(x)=dydxy'(x) = \frac{dy}{dx} is the derivative of yy with respect to xx. So the integral for the length of the path becomes:

l=∫x1x2dx1+y′(x)2.l = \int_{x_1}^{x_2} dx \sqrt{1 + y'(x)^2}.

The function y(x)y(x) defines the path that minimizes the length ll. To find this path, we assume an incorrect function Y(x)Y(x) that is close to the true path y(x)y(x), and we can express the difference between them as αη(x)\alpha\eta(x):

Y(x)=y(x)⏟correct+αη(x)⏟minimizeY(x) = \underbrace{y(x)}_{\textrm{correct}}+ \underbrace{\alpha\eta(x)}_{\textrm{minimize}}

Note that Y(x1)=y(x1)Y(x_1) = y(x_1) and Y(x2)=y(x2)Y(x_2) = y(x_2), so the endpoints of the path are fixed. The function η(x)\eta(x) represents a small perturbation to the path, and α\alpha is a small parameter that we will use to control the size of the perturbation.

Deriving the Euler-Lagrange Equation

The mathematical derivation involves extremizing the integral using a perturbation approach. The generic integral we are trying to minimize is for a function of the form:

f(y(x),y′(x),x)),f(y(x),y'(x),x)),

where ff is a function of yy, its derivative y′y', and the independent variable xx. So that the integral we are minimizing can be expressed as:

S=∫x1x2f(y(x),y′(x),x)dx.S=\int_{x_1}^{x_2} f(y(x),y'(x),x) dx.

We assume y(x)y(x) minimizes the integral SS. So that any function Y(x)=y(x)+αη(x)Y(x) = y(x) + \alpha\eta(x) produces a larger value for SS,

∫s1s2f(Y(x),Y′(x),x)dx>∫s1s2f(y(x),y′(x),x)dx.\int_{s_1}^{s_2} f(Y(x),Y'(x),x) dx > \int_{s_1}^{s_2} f(y(x),y'(x),x) dx.

Because we are looking for a minimum, we notice that when α=0\alpha = 0, we have Y(x)=y(x)Y(x) = y(x), and the integral is at its minimum. To find the extremum, we can take the derivative of the integral with respect to α\alpha and set it to zero:

dSdα∣α=0=0.\dfrac{dS}{d\alpha}|_{\alpha=0} = 0.

We start that analysis by differentiating the integral with respect to α\alpha:

S=∫x1x2f(Y(x),Y′(x),x)dxS = \int_{x_1}^{x_2} f(Y(x),Y'(x),x) dx
S=∫x1x2f(y(x)+αη(x),y′(x)+αη′(x),x)dx.S = \int_{x_1}^{x_2} f(y(x) + \alpha\eta(x), y'(x) + \alpha\eta'(x), x) dx.

We can now differentiate.

dSdα=∫x1x2[∂f∂YdYdα+∂f∂Y′dY′dα+∂f∂xdxdα]dx.\dfrac{dS}{d\alpha} = \int_{x_1}^{x_2} \left[ \dfrac{\partial f}{\partial Y}\dfrac{dY}{d\alpha} + \dfrac{\partial f}{\partial Y'}\dfrac{dY'}{d\alpha} + \dfrac{\partial f}{\partial x}\dfrac{dx}{d\alpha} \right] dx.

Substituting dY/dα=ηdY/d\alpha=\eta and dY′/dα=η′dY'/d\alpha=\eta' gives:

Let’s take each term in turn. The first term is:

dfdYdYdα.\dfrac{df}{dY}\dfrac{dY}{d\alpha}.

Let’s focus on the second part of that term:

dYdα=ddα[y(x)+αη(x)]=η(x).\dfrac{dY}{d\alpha} = \dfrac{d}{d\alpha}\left[y(x) + \alpha\eta(x)\right] = \eta(x).

Let’s look at the second term:

dY′dα.\dfrac{dY'}{d\alpha}.

Again, let’s focus on the second part of that term:

dY′dα=ddα[y′(x)+αη′(x)]=η′(x).\dfrac{dY'}{d\alpha} = \dfrac{d}{d\alpha}\left[y'(x) + \alpha\eta'(x)\right] = \eta'(x).

Lastly, the third term:

∂f∂xdxdα=0.\dfrac{\partial f}{\partial x}\dfrac{dx}{d\alpha}=0.

This term is a bit different. The dxdx term is independent of α\alpha, so we can treat it as a constant with respect to α\alpha. Therefore, this term will not contribute to the derivative with respect to α\alpha, and we can ignore it in our analysis.

Putting it all together, we have:

dSdα=∫x1x2[∂f∂Yη(x)+∂f∂Y′η′(x)]dx.\dfrac{dS}{d\alpha} = \int_{x_1}^{x_2}\left[ \dfrac{\partial f}{\partial Y}\eta(x) + \dfrac{\partial f}{\partial Y'}\eta'(x) \right] dx.

Our expression is still in terms of Y(x)Y(x), the incorrect function. We want to express it in terms of y(x)y(x), the correct function. Let’s look at the derivatives ∂f∂Y\dfrac{\partial f}{\partial Y} and ∂f∂Y′\dfrac{\partial f}{\partial Y'}. We can use the chain rule to express these derivatives in terms of y(x)y(x):

∂f∂Y=∂f∂y∂y∂Y=∂f∂y,\dfrac{\partial f}{\partial Y} = \dfrac{\partial f}{\partial y}\dfrac{\partial y}{\partial Y} = \dfrac{\partial f}{\partial y},
∂f∂Y′=∂f∂y′∂y′∂Y′=∂f∂y′.\dfrac{\partial f}{\partial Y'} = \dfrac{\partial f}{\partial y'}\dfrac{\partial y'}{\partial Y'} = \dfrac{\partial f}{\partial y'}.

Why? Because ∂y∂Y=1\dfrac{\partial y}{\partial Y} = 1 and ∂y′∂Y′=1\dfrac{\partial y'}{\partial Y'} = 1 when we are differentiating with respect to the correct function y(x)y(x). This means that we can express the derivatives in terms of the correct function y(x)y(x).

dSdα=∫x1x2[∂f∂yη(x)+∂f∂y′η′(x)]dx.\dfrac{dS}{d\alpha} = \int_{x_1}^{x_2}\left[ \dfrac{\partial f}{\partial y}\eta(x) + \dfrac{\partial f}{\partial y'}\eta'(x) \right] dx.

We are seeking dSdα\dfrac{dS}{d\alpha} at α=0\alpha = 0, so we set the integral to zero:

∫x1x2[∂f∂yη(x)+∂f∂y′η′(x)]dx=0.\int_{x_1}^{x_2}\left[ \dfrac{\partial f}{\partial y}\eta(x) + \dfrac{\partial f}{\partial y'}\eta'(x) \right] dx = 0.

Integration by Parts

Now to deal with the integral here, we can use integration by parts:

∫u′vdx=[uv]−∫uv′dx\int u'v dx = [uv] - \int u v' dx

The first term [uv][uv] is called the “surface term” because it is the result of the integral and is evaluated at the boundaries of the integral, x1x_1 and x2x_2. We will apply integration by parts only to the second term in the integral.

Here, we note u=η(x)u = \eta(x) and v=∂f∂y′v = \dfrac{\partial f}{\partial y'}. Then, we can express the second term in the integral as follows:

∫x1x2η′(x)∂f∂y′dx=[η(x)∂f∂y′]x1x2⏟η(x1)=η(x2)=0−∫x1x2η(x)ddx(∂f∂y′)dx\int_{x_1}^{x_2} \eta'(x) \dfrac{\partial f}{\partial y'} dx = \underbrace{\left[ \eta(x) \dfrac{\partial f}{\partial y'} \right]_{x_1}^{x_2}}_{\eta(x_1)=\eta(x_2)=0} - \int_{x_1}^{x_2} \eta(x) \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right) dx
∫x1x2η′(x)∂f∂y′dx=−∫x1x2η(x)ddx(∂f∂y′)dx\int_{x_1}^{x_2} \eta'(x) \dfrac{\partial f}{\partial y'} dx = - \int_{x_1}^{x_2} \eta(x) \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right) dx

Notice that the surface term evaluates to zero because we have fixed the endpoints of the path, so η(x1)=η(x2)=0\eta(x_1) = \eta(x_2) = 0. We put this all together to get:

dSdα=∫x1x2[η(x)∂f∂y−η(x)ddx(∂f∂y′)]dx=0.\dfrac{dS}{d\alpha} = \int_{x_1}^{x_2}\left[ \eta(x)\dfrac{\partial f}{\partial y} - \eta(x) \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right) \right] dx = 0.
dSdα=∫x1x2η(x)[∂f∂y−ddx(∂f∂y′)]dx=0.\dfrac{dS}{d\alpha} = \int_{x_1}^{x_2} \eta(x) \left[ \dfrac{\partial f}{\partial y} - \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right) \right] dx = 0.

Back to the Shortest Path Example

Now let’s apply the Euler-Lagrange equation to our original problem of finding the shortest path between two points in a plane. We have:

l=∫x1x21+y′(x)2dx.l = \int_{x_1}^{x_2} \sqrt{1 + y'(x)^2} dx.

Here, we can identify our function ff as:

f(y(x),y′(x),x)=1+y′(x)2.f(y(x), y'(x), x) = \sqrt{1 + y'(x)^2}.

Let’s apply the Euler-Lagrange equation to this function.

∂f∂y−ddx(∂f∂y′)=0.\dfrac{\partial f}{\partial y} - \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right) = 0.

We take the derivatives:

∂f∂y=0\dfrac{\partial f}{\partial y} = 0

since ff does not depend on yy, only on y′y'. Now let’s compute the second term:

∂f∂y′=∂∂y′(1+y′(x)2)\dfrac{\partial f}{\partial y'} = \dfrac{\partial}{\partial y'}\left( \sqrt{1 + y'(x)^2} \right)
∂f∂y′=12(1+y′(x)2)−1/22y′(x)\dfrac{\partial f}{\partial y'} = \dfrac{1}{2} \left(1 + y'(x)^2\right)^{-1/2} 2y'(x)
∂f∂y′=y′(x)1+y′(x)2.\dfrac{\partial f}{\partial y'} = \frac{y'(x)}{\sqrt{1 + y'(x)^2}}.

Let’s put all this together:

0=∂f∂y−ddx(∂f∂y′)0 = \dfrac{\partial f}{\partial y} - \dfrac{d}{dx}\left( \dfrac{\partial f}{\partial y'} \right)
0=0−ddx(y′(x)1+y′(x)2).0 = 0 - \dfrac{d}{dx}\left(\frac{y'(x)}{\sqrt{1 + y'(x)^2}}\right).

This means that,

ddx(y′(x)1+y′(x)2)=0\dfrac{d}{dx}\left(\frac{y'(x)}{\sqrt{1 + y'(x)^2}}\right) = 0

This implies that:

y′(x)1+y′(x)2=C=a constant.\frac{y'(x)}{\sqrt{1 + y'(x)^2}} = C = \textrm{a constant}.

Or rearranging gives us:

y′(x)=C1+y′(x)2y'(x) = C\sqrt{1 + y'(x)^2}
y′(x)2=C2(1+y′(x)2)y'(x)^2 = C^2(1 + y'(x)^2)
(1−C2)y′(x)2=C2(1 - C^2)y'(x)^2 = C^2
y′(x)2=C21−C2y'(x)^2 = \frac{C^2}{1 - C^2}
y′(x)=±C21−C2y'(x) = \pm \sqrt{\frac{C^2}{1 - C^2}}

So that, y′(x)y'(x) is a constant, call it mm, which produces a linear solution.

dydx=C21−C2=m\dfrac{dy}{dx} = \sqrt{\frac{C^2}{1 - C^2}} = m

Integrating gives us:

y(x)=mx+by(x) = mx + b

where bb is a constant of integration. This is the equation of a straight line!

We can check this numerically: take the straight-line path y(x)y(x) and add a family of perturbations αη(x)\alpha\eta(x) that vanish at the endpoints, then compute the length of each candidate path. The plot below confirms that the length is smallest exactly when α=0\alpha=0, i.e., for the straight line itself.

Source
<Figure size 1100x450 with 2 Axes>

Example: Snell’s Law

Let’s assume you are walking on the beach and need to get to a location in the water quickly. Where do you enter the water to minimize the time it takes to reach the location in the water? This is a classic problem in physics and can be solved using the Calculus of Variations.

Consider the picture below where you can move at a speed v1v_1 on the shore and a speed v2v_2 in the water. We know that v1>v2v_1 > v_2, so you can move faster on the shore than in the water. We aim to minimize the time it takes to reach the point ⟨x2,y2⟩\langle x_2, y_2 \rangle in the water from point ⟨x1,y1⟩\langle x_1, y_1 \rangle on the shore. We take the shoreline to be a line at x=0x = 0. and the location we cross the shoreline is ⟨0,y⟩\langle 0, y \rangle.

Snell's Law Diagram

Notice the angle that we approach the shoreline at, θ1\theta_1, and the angle that we approach the target in the water, θ2\theta_2.

The total time to travel from ⟨x1,y1⟩\langle x_1, y_1 \rangle to ⟨0,y⟩\langle 0, y \rangle and then to ⟨x2,y2⟩\langle x_2, y_2 \rangle is:

T=t1+t2=d1v1+d2v2T = t_1 + t_2 = \dfrac{d_1}{v_1} + \dfrac{d_2}{v_2}

where d1d_1 is the distance from ⟨x1,y1⟩\langle x_1, y_1 \rangle to ⟨0,y⟩\langle 0, y \rangle, and d2d_2 is the distance from ⟨0,y⟩\langle 0, y \rangle to ⟨x2,y2⟩\langle x_2, y_2 \rangle. We can write those distances in terms of the coordinates:

d1=x12+(y−y1)2d_1 = \sqrt{x_1^2 + (y - y_1)^2}
d2=x22+(y2−y)2d_2 = \sqrt{x_2^2 + (y_2 - y)^2}

This gives us:

T=x12+(y−y1)2v1+x22+(y2−y)2v2.T = \dfrac{\sqrt{x_1^2 + (y - y_1)^2}}{v_1} + \dfrac{\sqrt{x_2^2 + (y_2 - y)^2}}{v_2}.

We want to minimize this time, TT, by choosing the optimal point yy where we cross the shoreline. We compute the derivative of TT with respect to yy and set it to zero:

dTdy=0\dfrac{dT}{dy} = 0
dTdy=121v1(x12+(y−y1)2)−1/2(2)(y−y1)+121v2(x22+(y2−y)2)−1/2(−2)(y2−y)=0\dfrac{dT}{dy} = \dfrac{1}{2}\dfrac{1}{v_1}\left(x_1^2 + (y-y_1)^2\right)^{-1/2}(2)(y-y_1) + \dfrac{1}{2}\dfrac{1}{v_2}\left(x_2^2 + (y_2-y)^2\right)^{-1/2}(-2)(y_2-y) = 0
dTdy=1v1(y−y1x12+(y−y1)2)−1v2(y2−yx22+(y2−y)2)=0\dfrac{dT}{dy} = \dfrac{1}{v_1}\left(\dfrac{y-y_1}{\sqrt{x_1^2 + (y-y_1)^2}}\right) - \dfrac{1}{v_2}\left(\dfrac{y_2-y}{\sqrt{x_2^2 + (y_2-y)^2}}\right) = 0
dTdy=1v1(y−y1d1)−1v2(y2−yd2)=0\dfrac{dT}{dy} = \dfrac{1}{v_1}\left(\dfrac{y-y_1}{d_1}\right) - \dfrac{1}{v_2}\left(\dfrac{y_2-y}{d_2}\right) = 0

where the last step is just substituting in the expressions for d1d_1 and d2d_2. Notice that those expressions are related to the angles we defined earlier. We can rewrite the expression in terms of the angles θ1\theta_1 and θ2\theta_2:

sin⁡(θ1)=y−y1d1\sin(\theta_1) = \frac{y - y_1}{d_1}
sin⁡(θ2)=y2−yd2\sin(\theta_2) = \frac{y_2 - y}{d_2}

This gives us:

sin⁡(θ1)v1−sin⁡(θ2)v2=0\dfrac{\sin(\theta_1)}{v_1} - \dfrac{\sin(\theta_2)}{v_2} = 0

We can verify this directly by computing the total travel time TT for every possible crossing point yy and checking that the minimum indeed lands where Snell’s Law is satisfied.

Source
<Figure size 700x450 with 1 Axes>

Example: Brachistochrone Problem

The Brachistochrone problem is a classic problem in the Calculus of Variations. It asks the question: “What is the shape of the curve that a bead will follow under the influence of gravity to reach the bottom in the shortest time?” Here’s a great video from Steven Strogatz that explains the problem and its solution.

Youtube Video on the Brachistochrone Problem

Source: https://www.youtube.com/watch?v=Cld0p3a43fU

The setup is below, there’s two points separated by a distance vertically and horizontally. What shape should we make a track so that a bead will slide down it in the shortest time?

The Brachistochrone Problem

The time it takes for the bead to slide down the curve is given by:

T=∫12dsvT = \int_{1}^{2} \dfrac{ds}{v}

where dsds is the differential arc length along the curve, and vv is the velocity of the bead at that point. The generic step is the same as before:

ds=dx2+dy2.ds = \sqrt{dx^2 + dy^2}.

Velocity of the Bead

What about vv? Because the bead is moving under the influence of gravity, we can use conservation of energy to find the velocity. Note that we don’t model the rolling of the bead, just the motion down the track. We also neglect all frictional forces. This is a major simplification, but it will give us an analytical solution.

ΔK+ΔU=0\Delta K + \Delta U = 0

If the bead starts from rest, then vi=0v_i = 0, and we can write:

12mv2−12m(0)2+mg(Δy)=0,\dfrac{1}{2}mv^2 - \dfrac{1}{2}m(0)^2 + mg(\Delta y) = 0,
v=2gΔyv = \sqrt{2g\Delta y}

where Δy=y1−y2>0\Delta y = y_1 - y_2 > 0. This is the change in height of the bead as it rolls down the track. We can express this in terms of the coordinates of the two points, y1y_1 and y2y_2.

Let’s move the origin to the top of the track and measure +y+y downwards. Thus, for any point on the track, we have:

v=2gy.v = \sqrt{2gy}.

We can now write the integral again,

T=∫12dsv=∫12dx2+dy22gy.T = \int_{1}^{2} \dfrac{ds}{v} = \int_{1}^{2} \dfrac{\sqrt{dx^2 + dy^2}}{\sqrt{2gy}}.

We notice that we can factor out a dydy term from the square root in the numerator:

dx2+dy2=dy(dxdy)2+1=dyx′2+1\sqrt{dx^2 + dy^2} = dy\sqrt{\left(\frac{dx}{dy}\right)^2 + 1} = dy \sqrt{x'^2 + 1}

where x′=dxdyx' = \frac{dx}{dy}. This gives us:

T=12g∫0y2dyx′2+1y.T = \dfrac{1}{\sqrt{2g}}\int_{0}^{y_2} dy \dfrac{\sqrt{x'^2 + 1}}{\sqrt{y}}.

We can identify our function ff as:

f(x,x′,y)=f(x′,y)=x′2+1y.f(x,x',y) = f(x',y) = \dfrac{\sqrt{x'^2 + 1}}{\sqrt{y}}.

Because ff does not depend on xx, ∂f/∂x=0\partial f/\partial x = 0. So that the Euler-Lagrange equation simplifies to:

ddy(∂f∂x′)=0.\dfrac{d}{dy}\left(\dfrac{\partial f}{\partial x'}\right) = 0.

Or that this partial derivative must be a constant:

∂f∂x′=a constant,\dfrac{\partial f}{\partial x'} = \textrm{a constant},
∂f∂x′=x′x′2+1y=C,\dfrac{\partial f}{\partial x'} = \dfrac{x'}{\sqrt{x'^2 + 1}\sqrt{y}} = \sqrt{C},

where CC is a constant. We square both sides to get:

x′2(x′2+1)y=C.\dfrac{x'^2}{(x'^2 + 1)y} = C.

Knowing the solution ahead of time, we choose the constant C=12aC = \frac{1}{2a}. This gives us:

x′2(x′2+1)y=12a.\dfrac{x'^2}{(x'^2 + 1)y} = \frac{1}{2a}.

Some more algebra gives us:

2ax′2=y(x′2+1),2ax'^2 = y(x'^2 + 1),
(2a−y)x′2=y,(2a - y)x'^2 = y,
x′2=y2a−y,x'^2 = \frac{y}{2a - y},

where x′=dxdyx' = \frac{dx}{dy}. We can now integrate this to find the shape of the curve:

x=∫y2a−ydy.x = \int \sqrt{\frac{y}{2a - y}} dy.

This integral will give us the shape of the curve x(y)x(y), but to solve it we need to use a substitution.

Let y=a(1−cos⁡(θ))y = a(1 - \cos(\theta)). Thus, dy=asin⁡(θ)dθdy = a\sin(\theta)d\theta. This gives us:

x(y(θ))=∫y(θ)2a−y(θ)dyx(y(\theta)) = \int \sqrt{\frac{y(\theta)}{2a - y(\theta)}} dy
x(y(θ))=∫a(1−cos⁡(θ))2a−a(1−cos⁡(θ))asin⁡(θ)dθx(y(\theta)) = \int \sqrt{\frac{a(1 - \cos(\theta))}{2a - a(1 - \cos(\theta))}} a\sin(\theta)d\theta
x(y(θ))=a∫(1−cos⁡θ)(1+cos⁡θ)sin⁡(θ)dθ.x(y(\theta)) = a \int \sqrt{\frac{(1-\cos\theta)}{(1+\cos\theta)}} \sin(\theta)d\theta.

Note that sin⁡θ=1−cos⁡2θ=(1−cos⁡θ)(1+cos⁡θ)\sin \theta = \sqrt{1 - \cos^2 \theta} = \sqrt{(1 - \cos\theta)(1 + \cos\theta)}. This allows us to simplify the integral:

x(y(θ))=a∫(1−cos⁡θ)2(1+cos⁡θ)(1+cos⁡θ)dθx(y(\theta)) = a \int \sqrt{\frac{(1-\cos\theta)^2(1+\cos\theta)}{(1+\cos\theta)}} d\theta
x(y(θ))=a∫(1−cos⁡θ)2dθx(y(\theta)) = a \int \sqrt{(1 - \cos\theta)^2} d\theta
x(y(θ))=a∫(1−cos⁡θ)dθx(y(\theta)) = a \int (1 - \cos\theta) d\theta
x(y(θ))=a(θ−sin⁡(θ))+Cx(y(\theta)) = a \left(\theta - \sin(\theta)\right) + C

where CC is a constant of integration.

With initial conditions x(0)=0x(0) = 0 when y(0)=0y(0) = 0 at t=0t=0 and θ=0\theta = 0, we find that C=0C = 0. So the solution is:

x(θ)=a(θ−sin⁡(θ))x(\theta) = a\left(\theta - \sin(\theta)\right)
y(θ)=a(1−cos⁡(θ)).y(\theta) = a(1 - \cos(\theta)).

This is the “cycloid” curve that the bead will follow to minimize the time it takes to slide down the track. We can plot this curve to visualize it.

What is so interesting about this curve is that it is isochronous, meaning that all beads released from rest at any point on the curve will reach the bottom at the same time, regardless of where they start.

Source
<Figure size 1000x400 with 1 Axes>