
258 CHAPTER 7. CALCULUS OF VARIATIONS
Consider a tiny bug (Betsy Bug) of mass m starting from rest and sliding
under the influence of gravity along a smooth greased wire from some fixed
point A to another fixed point B somewhere (but not directly) below A.What
should the shape y(x) of the wire be between A and B so that Betsy’s time of
descent is a minimum?
Let’s take the point A to be at the origin (i.e., x
0
=0, y
0
= 0) and measure
y downwards. Neglecting friction and air resistance, Betsy’s speed v when she
passes through an arbitrary lower point P (x, y) is obtained by equating her in-
crease in kinetic energy to the decrease in potential energy, i.e.,
1
2
mv
2
= mgy,
or v =
√
2gy,whereg is the acceleration due to gravity. But v = ds/dt where
ds=
(dx)
2
+(dy)
2
=
1+(y
)
2
dx is an element of arc length along the path
at P and dt is the time it takes for Betsy to traverse ds. Combining these
results, the time T of descent from A to B(where x = x
1
,y = y
1
)is
T =
x
1
0
1+(y
)
2
dx
√
2gy
.
The y(x) which minimizes T follows on solving (7.2) with F =
1+(y
)
2
/
√
2gy.
In this recipe, we will derive Betsy’s path in the parametric form
x =
a
2
(θ −sin θ),y=
a
2
(1 − cos θ),
with θ a parameter which is equal to 0 at A. Then, taking θ= θ1 at B, we will
show that the minimum time of descent is T =
a/2gθ1 . Finally, choosing
x
1
=5m,y
1
= 2 m, Betsy’s path will be plotted and T evaluated.
If the form of F is specified, the EulerLagrange command will calculate the
left-hand side of (7.2), and even produce the first integral if possible. To use
this command, the VariationalCalculus package must be first loaded.
>
restart: with(VariationalCalculus):
The relevant F for the brachistochrone problem is entered. The factor 1/
√
2g
is omitted since it will cancel out of the Euler–Lagrange equation, (7.2).
>
F:=sqrt(1+diff(y(x),x)ˆ2)/sqrt(y(x));
F :=
1+(
d
dx
y(x))
2
y(x)
The EulerLagrange command, with F , x,andy(x) given as arguments, is
applied to F and simplified, generating two results.
>
eq:=simplify(EulerLagrange(F,x,y(x)));
eq :=
⎧
⎪
⎨
⎪
⎩
1
1+(
d
dx
y(x))
2
y(x)
= K
1
, −
1
2
1+(
d
dx
y(x))
2
+2(
d
2
dx
2
y(x)) y(x)
y(x)
(3/2)
(1+(
d
dx
y(x))
2
)
(3/2)
⎫
⎪
⎬
⎪
⎭
Since F doesn’t explicitly depend on x here, the first integral is generated in
the first expression in the above output, the integration constant being K
1
.
The second expression is just the left-hand side of the resulting ODE generated