MechanicsLagrangian Mechanics1 of 6
Lagrangian Mechanics · 1

The Calculus of Variations

In ordinary calculus, we find a single number xx that minimizes or maximizes a function f(x)f(x); now we want to find an entire curve y(x)\Path{y(x)} between two fixed points A=(x1,y1)A = (x_1, \Path{y_1}) and B=(x2,y2)B = (x_2, \Path{y_2}) that optimizes a total score from start to finish.

1

Scoring a Path with a Functional

To score a path y(x)\Path{y(x)}, whether by its total length or the time a marble takes to slide down it, we chop the curve into tiny horizontal steps dx\Step{dx}, add up the cost of each slice, and write the total score as an integral.

xx
A=(x1,y1)A = (x_1, \htmlClass{lc-blue}{y_1})
B=(x2,y2)B = (x_2, \htmlClass{lc-blue}{y_2})
(x,y)(x, \htmlClass{lc-blue}{y})
dx\htmlClass{lc-pink}{dx}
dy=y′ dx\htmlClass{lc-pink}{dy} = \htmlClass{lc-pink}{y'}\,\htmlClass{lc-pink}{dx}
ds=1+(y′)2 dx\htmlClass{lc-pink}{ds} = \sqrt{1 + (\htmlClass{lc-pink}{y'})^2}\,\htmlClass{lc-pink}{dx}
Scoring a Path with a Functional
AA
BB
g\htmlClass{lc-orange}{g}

Across a single slice dx\Step{dx}, the step length along the curve is ds\Step{ds} == 1+(y′)2 dx\sqrt{1 + (\Slope{y'})^2}\,\Step{dx}, and a marble that slides without friction and has dropped a vertical distance y\Path{y} from rest has speed v=2gy\Speed{v} = \sqrt{2g\Path{y}} by conservation of energy (12mv2=mgy\Speed{\frac{1}{2}mv^2} = \Potential{mgy}). Integrating the slice cost from x1x_1 to x2x_2 gives the path length and the travel time as instances of a general score S\Score{S}:

Length=∫x1x21+(y′)2 dx,Time=∫x1x21+(y′)22gy dx\displaystyle \begin{aligned} \Score{\text{Length}} &= \int_{x_1}^{x_2} \sqrt{1 + (\Slope{y'})^2}\,dx, \\ \Score{\text{Time}} &= \int_{x_1}^{x_2} \frac{\sqrt{1 + (\Slope{y'})^2}}{\sqrt{2g\Path{y}}}\,dx \end{aligned}
S⏟functional\displaystyle \underbrace{\Score{S}}_{\text{functional}} =∫x1x2L(x,y,y′)⏟local cost function dx\displaystyle = \int_{x_1}^{x_2} \underbrace{\Score{L}(x, \Path{y}, \Slope{y'})}_{\text{local cost function}}\,dx

Making the ramp steeper near the start AA stretches the step length ds\Step{ds} == 1+(y′)2 dx\sqrt{1 + (\Slope{y'})^2}\,\Step{dx} there, but increases the drop y\Path{y} and boosts the speed v=2gy\Speed{v} = \sqrt{2g\Path{y}} along the rest of the ramp. That cuts the total travel time until dipping too deep adds more distance than the extra speed can make up for.

Dropping steeper near the start stretches the step length there, but boosts the speed across every slice below it, cutting the total travel time until the extra distance outweighs the speed gain.
2

The Euler-Lagrange Equation

We want a condition that identifies a stationary path y(x)\Path{y(x)}, which is a curve where any tiny nudge to the path produces zero first-order change in the total score S\Score{S}. To move a derivative ddx\frac{d}{dx} off the slope of a nudge and onto the slope sensitivity next to it, we use integration by parts:

∫x1x2u dv\displaystyle \int_{x_1}^{x_2} \SlopeSens{u}\,\Nudge{dv} =[uv]x1x2−∫x1x2v du\displaystyle = [\SlopeSens{u}\Nudge{v}]_{x_1}^{x_2} - \int_{x_1}^{x_2} \Nudge{v}\,\SlopeSens{du}
The Euler-Lagrange Equation
AA
BB
y(x)\htmlClass{lc-blue}{y(x)}
y(x)+εη(x)\htmlClass{lc-blue}{y(x)} + \htmlClass{lc-violet}{\varepsilon\eta(x)}
S=∫x1x2L(x,y,y′) dx\htmlClass{lc-green}{S} = \int_{x_1}^{x_2} \htmlClass{lc-green}{L}(x, \htmlClass{lc-blue}{y}, \htmlClass{lc-pink}{y'})\,dx

Nudging the curve to ynew(x)\Nudge{y_{\text{new}}(x)} == y(x)+εη(x)\Path{y(x)} + \Nudge{\varepsilon\eta(x)} with fixed endpoints η(x1)=η(x2)=0\Nudge{\eta(x_1)} = \Nudge{\eta(x_2)} = 0 and integrating the slope-nudge term by parts makes the boundary term vanish, leaving the balance condition that must hold at every point xx along a stationary path:

∫x1x2[∂L∂y−ddx(∂L∂y′)]η(x) dx=0  ⟹  ∂L∂y⏟heightsensitivity−ddx(∂L∂y′)⏟bendingresistance=0\displaystyle \begin{aligned} \int_{x_1}^{x_2} \left[\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right)\right]\Nudge{\eta(x)}\,dx &= 0 \\ \implies \underbrace{\HeightSens{\frac{\partial L}{\partial y}}}_{\begin{gathered}\text{height} \\ \text{sensitivity}\end{gathered}} - \underbrace{\frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right)}_{\begin{gathered}\text{bending} \\ \text{resistance}\end{gathered}} &= 0 \end{aligned}

Lifting a joint by δy\Nudge{\delta y} tilts the left stick up and the right stick down by equal amounts, so the opposite slope changes only produce a net cost when ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} differs between the two sticks. On the stationary curve, that difference across the joint balances ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} so the first-order change δS\Score{\delta S} is zero.

Nudge a joint up or down at different spots along a stationary curve to see how the two sticks' opposite tilts balance the height change so the total change stays zero.
3

Shortcut 1: When yy Is Missing

Because ddx(∂L∂y′)\frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) differentiates y′\Slope{y'} into y′′\Second{y''}, the Euler-Lagrange equation is generally a second-order differential equation, but when y\Path{y} is absent from L\Score{L}, it reduces right away to a first-order equation. We can use this to find the shortest path between A=(x1,y1)A = (x_1, \Path{y_1}) and B=(x2,y2)B = (x_2, \Path{y_2}) in a flat plane:

S\displaystyle \Score{S} =∫x1x21+(y′)2 dx\displaystyle = \int_{x_1}^{x_2} \sqrt{1 + (\Slope{y'})^2}\,dx
Shortcut 1: When y Is Missing
A=(x1,y1)A = (x_1, \htmlClass{lc-blue}{y_1})
B=(x2,y2)B = (x_2, \htmlClass{lc-blue}{y_2})

Whenever y\Path{y} does not appear explicitly in L\Score{L}, ∂L∂y=0\HeightSens{\frac{\partial L}{\partial y}} = 0, so the slope sensitivity stays constant along the entire path:

∂L∂y′\displaystyle \SlopeSens{\frac{\partial L}{\partial y'}} =C(when y is missing from L)\displaystyle = C \quad (\text{when } \Path{y} \text{ is missing from } \Score{L})
Text solution
Apply Shortcut 1 for missing y\Path{y}Because y\Path{y} does not appear in L=1+(y′)2\Score{L} = \sqrt{1 + (\Slope{y'})^2}, setting ∂L∂y′=C\SlopeSens{\frac{\partial L}{\partial y'}} = C gives an equation containing only y′\Slope{y'}.
y′1+(y′)2\displaystyle \frac{\Slope{y'}}{\sqrt{1 + (\Slope{y'})^2}} =C\displaystyle = C
Solve for the slope y′\Slope{y'} and integrateSquaring both sides and isolating y′\Slope{y'} shows that the slope is a constant mm, which integrates to a straight line.
y′(x)\displaystyle \Slope{y'(x)} =C1−C2\displaystyle = \frac{C}{\sqrt{1 - C^2}} =m  ⟹  y(x)\displaystyle = m \implies \Path{y(x)} =mx+b\displaystyle = mx + b
Match the endpoints A=(x1,y1)A = (x_1, \Path{y_1}) and B=(x2,y2)B = (x_2, \Path{y_2})Substituting the two boundary conditions pins down the slope mm and intercept bb of the line connecting AA and BB.
m\displaystyle m =y2−y1x2−x1,b\displaystyle = \frac{\Path{y_2} - \Path{y_1}}{x_2 - x_1}, \qquad b =y1−y2−y1x2−x1x1\displaystyle = \Path{y_1} - \frac{\Path{y_2} - \Path{y_1}}{x_2 - x_1}x_1
4

Shortcut 2 and the Brachistochrone Problem

Now we want to find the fastest ramp y(x)\Path{y(x)} for a marble sliding without friction from rest at A=(0,0)A = (0, 0) to B=(x2,y2)B = (x_2, \Path{y_2}) under gravity, which minimizes the travel-time functional (after dropping the constant positive factor 12g\tfrac{1}{\sqrt{2g}}):

S\displaystyle \Score{S} =∫0x21+(y′)2y dx\displaystyle = \int_0^{x_2} \frac{\sqrt{1 + (\Slope{y'})^2}}{\sqrt{\Path{y}}}\,dx

Here y\Path{y} is in the denominator, so Shortcut 1 does not apply, but the horizontal coordinate xx is missing from L(y,y′)\Score{L}(\Path{y}, \Slope{y'}).

Shortcut 2 and the Brachistochrone Problem
A=(0,0)A = (0, 0)
B=(x2,y2)B = (x_2, \htmlClass{lc-blue}{y_2})
xx
y\htmlClass{lc-blue}{y}
g\htmlClass{lc-orange}{g}

Whenever xx does not appear explicitly in L\Score{L}, ∂L∂x=0\frac{\partial L}{\partial x} = 0, and the chain rule along a stationary path simplifies to a first-order conservation law:

L−y′∂L∂y′=C⏟Beltrami identity(when x is missing from L)\displaystyle \begin{gathered} \underbrace{\Score{L} - \Slope{y'}\SlopeSens{\frac{\partial L}{\partial y'}} = C}_{\text{Beltrami identity}} \\ (\text{when } x \text{ is missing from } \Score{L}) \end{gathered}

To integrate the separated ramp equation, we use the half-angle identities 1−cos⁡θ=2sin⁡2(θ2)1 - \cos\theta = 2\sin^2(\tfrac{\theta}{2}) and 1+cos⁡θ=2cos⁡2(θ2)1 + \cos\theta = 2\cos^2(\tfrac{\theta}{2}).

Text solution
Apply Shortcut 2 for missing xxSubstituting L=1+(y′)2y\Score{L} = \frac{\sqrt{1 + (\Slope{y'})^2}}{\sqrt{\Path{y}}} and ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} == y′y1+(y′)2\frac{\Slope{y'}}{\sqrt{\Path{y}}\sqrt{1 + (\Slope{y'})^2}} into L−y′∂L∂y′\Score{L} - \Slope{y'}\SlopeSens{\frac{\partial L}{\partial y'}} == CC over a common denominator cancels (y′)2(\Slope{y'})^2 in the numerator.
1+(y′)2y−(y′)2y1+(y′)2\displaystyle \frac{\sqrt{1 + (\Slope{y'})^2}}{\sqrt{\Path{y}}} - \frac{(\Slope{y'})^2}{\sqrt{\Path{y}}\sqrt{1 + (\Slope{y'})^2}} =1y1+(y′)2\displaystyle = \frac{1}{\sqrt{\Path{y}}\sqrt{1 + (\Slope{y'})^2}} =C\displaystyle = C
Separate variablesSquaring and inverting with 1C2=2R\tfrac{1}{C^2} = 2R gives a first-order differential equation that separates y\Path{y} and xx.
y[1+(y′)2]\displaystyle \Path{y}\left[1 + (\Slope{y'})^2\right] =2R  ⟹  dx\displaystyle = 2R \implies \Step{dx} =y2R−y dy\displaystyle = \sqrt{\frac{\Path{y}}{2R - \Path{y}}}\,\Step{dy}
Substitute y=R(1−cos⁡θ)\Path{y} = R(1 - \cos\theta) and integrateRewriting y=2Rsin⁡2(θ2)\Path{y} = 2R\sin^2(\tfrac{\theta}{2}), 2R−y=2Rcos⁡2(θ2)2R - \Path{y} = 2R\cos^2(\tfrac{\theta}{2}), and dy=2Rsin⁡(θ2)cos⁡(θ2) dθ\Step{dy} = 2R\sin(\tfrac{\theta}{2})\cos(\tfrac{\theta}{2})\,\Step{d\theta} simplifies the integral to a cycloid traced by a wheel of radius RR, with x0=0x_0 = 0 fixed by A=(0,0)A = (0, 0).
dx=2Rsin⁡2 ⁣(θ2)dθ=R(1−cos⁡θ) dθ  ⟹  {x(θ)=R(θ−sin⁡θ)y(θ)=R(1−cos⁡θ)\displaystyle \begin{aligned} \Step{dx} &= 2R\sin^2\!\left(\frac{\theta}{2}\right)\Step{d\theta} \\ &= R(1 - \cos\theta)\,\Step{d\theta} \\ &\implies \begin{cases} x(\theta) = R(\theta - \sin\theta) \\ \Path{y(\theta)} = R(1 - \cos\theta) \end{cases} \end{aligned}
Fix θ2\theta_2 and RR at endpoint B=(x2,y2)B = (x_2, \Path{y_2})Dividing x2x_2 by y2\Path{y_2} eliminates RR to determine the final wheel angle θ2\theta_2, which then sets the wheel radius RR.
x2y2\displaystyle \frac{x_2}{\Path{y_2}} =θ2−sin⁡θ21−cos⁡θ2,R\displaystyle = \frac{\theta_2 - \sin\theta_2}{1 - \cos\theta_2}, \qquad R =y21−cos⁡θ2\displaystyle = \frac{\Path{y_2}}{1 - \cos\theta_2}

The cycloid always drops vertically out of A=(0,0)A = (0, 0) where y=0\Path{y} = 0 forces y′→∞\Slope{y'} \to \infty. Whenever BB is wide enough relative to its drop that x2y2>π2\tfrac{x_2}{\Path{y_2}} > \tfrac{\pi}{2}, the generating wheel rolls past θ=π\theta = \pi, so the fastest ramp dives deeper than BB before curving back uphill to reach it.

Each finish point sets one cycloid that starts straight down, and when the finish sits wide enough, this fastest path dips below it and rolls back uphill.
5

Solving the Full Euler-Lagrange Equation

When xx, y\Path{y}, and y′\Slope{y'} all appear explicitly in L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}), neither shortcut applies, and we solve the full second-order Euler-Lagrange equation directly. Let's find the stationary path y(x)\Path{y(x)} between A=(1,3)A = (1, 3) and B=(2,52)B = (2, \tfrac{5}{2}) for the functional

S\displaystyle \Score{S} =∫12[12x2(y′)2+y2]dx\displaystyle = \int_1^2 \left[\frac{1}{2}x^2(\Slope{y'})^2 + \Path{y}^2\right]dx
Solving the Full Euler-Lagrange Equation
L(x,y,y′)=12x2(y′)2+y2y(1)=3y(2)=52y(x)=  ?\displaystyle \begin{aligned} \Score{L}(x, \Path{y}, \Slope{y'}) &= \tfrac{1}{2}x^2(\Slope{y'})^2 + \Path{y}^2 \\[8pt] \Path{y}(1) &= 3 \\[2pt] \Path{y}(2) &= \tfrac{5}{2} \\[8pt] \Path{y}(x) &= \;? \end{aligned}
Text solution
Differentiate and apply the product ruleWith ∂L∂y=2y\HeightSens{\frac{\partial L}{\partial y}} = 2\Path{y} and ∂L∂y′=x2y′\SlopeSens{\frac{\partial L}{\partial y'}} = x^2 \Slope{y'}, taking ddx(x2y′)\frac{d}{dx}(x^2 \Slope{y'}) == 2xy′+x2y′′2x\Slope{y'} + x^2 \Second{y''} gives a second-order Euler-Cauchy differential equation.
2y\displaystyle 2\Path{y} =2xy′+x2y′′  ⟹  x2y′′+2xy′−2y\displaystyle = 2x\Slope{y'} + x^2 \Second{y''} \implies x^2 \Second{y''} + 2x\Slope{y'} - 2\Path{y} =0\displaystyle = 0
Try a power-law solution y(x)=xr\Path{y(x)} = x^rSubstituting y=xr\Path{y} = x^r, y′=rxr−1\Slope{y'} = rx^{r-1}, and y′′=r(r−1)xr−2\Second{y''} = r(r - 1)x^{r-2} makes every term share xrx^r and gives two roots for rr.
[r(r−1)+2r−2]xr\displaystyle \left[r(r - 1) + 2r - 2\right]x^r =(r−1)(r+2)xr\displaystyle = (r - 1)(r + 2)x^r =0  ⟹  y(x)\displaystyle = 0 \implies \Path{y(x)} =C1x+C2x2\displaystyle = C_1 x + \frac{C_2}{x^2}
Apply the endpoint conditions y(1)=3\Path{y(1)} = 3 and y(2)=52\Path{y(2)} = \tfrac{5}{2}Solving C1+C2=3C_1 + C_2 = 3 and 2C1+14C2=522C_1 + \frac{1}{4}C_2 = \frac{5}{2} gives C1=1C_1 = 1 and C2=2C_2 = 2.
y(x)\displaystyle \Path{y(x)} =x+2x2\displaystyle = x + \frac{2}{x^2}
6

Polar Coordinates and Geodesics on Curved Surfaces

Now we want to find the shortest path (a geodesic) when a curve is described in polar coordinates (r,θ)(r, \Path{\theta}) or constrained to lie on a curved surface like a cylinder or a sphere. The Euler-Lagrange equation works in any coordinates once we build the tiny step length ds\Step{ds} from perpendicular displacements on the surface.

θ\htmlClass{lc-blue}{\theta}
rr
r dθ\htmlClass{lc-pink}{r\,d\theta}
dr\htmlClass{lc-pink}{dr}
ds\htmlClass{lc-pink}{ds}
Polar Coordinates and Geodesics on Curved Surfaces

Factoring out the chosen independent variable turns ds\Step{ds} into the local cost function L\Score{L} for each geometry:

ds={dr2+r2dθ2=1+r2[θ′(r)]2 dr(plane in polar coordinates)R2dϕ2+dz2=R2+[z′(ϕ)]2 dϕ(cylinder of radius R)R2dθ2+R2sin⁡2θ dϕ2=R1+sin⁡2θ [ϕ′(θ)]2 dθ(sphere of radius R)\displaystyle \Step{ds} = \begin{cases} \sqrt{\Step{dr^2} + \Step{r^2 d\theta^2}} \\ \quad = \sqrt{1 + r^2[\Slope{\theta'(r)}]^2}\,\Step{dr} \\ \text{(plane in polar coordinates)} \\[6pt] \sqrt{\Step{R^2 d\phi^2} + \Step{dz^2}} \\ \quad = \sqrt{R^2 + [\Slope{z'(\phi)}]^2}\,\Step{d\phi} \\ \text{(cylinder of radius } R\text{)} \\[6pt] \sqrt{\Step{R^2 d\theta^2} + \Step{R^2\sin^2\theta\,d\phi^2}} \\ \quad = R\sqrt{1 + \sin^2\theta\,[\Slope{\phi'(\theta)}]^2}\,\Step{d\theta} \\ \text{(sphere of radius } R\text{)} \end{cases}
Text solution
Apply Shortcut 1 to the polar length functionalBecause θ\Path{\theta} is absent from L(r,θ,θ′)\Score{L}(r, \Path{\theta}, \Slope{\theta'}) == 1+r2(θ′)2\sqrt{1 + r^2(\Slope{\theta'})^2}, setting ∂L∂θ′=C\SlopeSens{\frac{\partial L}{\partial \theta'}} = C and solving for θ′=dθdr\Slope{\theta'} = \Slope{\frac{d\theta}{dr}} separates the variables.
r2θ′1+r2(θ′)2\displaystyle \frac{r^2\Slope{\theta'}}{\sqrt{1 + r^2(\Slope{\theta'})^2}} =C  ⟹  dθdr\displaystyle = C \implies \Slope{\frac{d\theta}{dr}} =Crr2−C2\displaystyle = \frac{C}{r\sqrt{r^2 - C^2}}
Integrate with the trig substitution r=Ccos⁡ur = \tfrac{C}{\cos u}Using dr=Csin⁡ucos⁡2u du\Step{dr} = \frac{C\sin u}{\cos^2 u}\,\Step{du} and r2−C2=Ctan⁡u\sqrt{r^2 - C^2} = C\tan u simplifies the integral to dθ=du\Step{d\theta} = \Step{du}, which converts back to a straight line in rectangular coordinates.
θ−θ0\displaystyle \Path{\theta} - \theta_0 =u  ⟹  rcos⁡(θ−θ0)\displaystyle = u \implies r\cos(\Path{\theta} - \theta_0) =C  ⟹  xcos⁡θ0+ysin⁡θ0\displaystyle = C \implies x\cos\theta_0 + \Path{y}\sin\theta_0 =C\displaystyle = C

On a cylinder, missing z\Path{z} gives z′(ϕ)=c1\Slope{z'(\phi)} = c_1, a helix z(ϕ)=c1ϕ+c2\Path{z(\phi)} = c_1\phi + c_2 that unrolls into a straight line; on a sphere, missing ϕ\Path{\phi} gives sin⁡2θ ϕ′1+sin⁡2θ (ϕ′)2\frac{\sin^2\theta\,\Slope{\phi'}}{\sqrt{1 + \sin^2\theta\,(\Slope{\phi'})^2}} == CC, which integrates to a great circle slicing through the center of the sphere.

Because east-west steps along a latitude circle of radius Rsin⁡θR\sin\theta have length Rsin⁡θ dϕ\Step{R\sin\theta\,d\phi} and shrink toward the pole, the path that stays on one latitude circle between two points at the same northern colatitude, which is a straight line on a flat (ϕ,θ)(\Path{\phi}, \theta) map, is longer on the globe than the great-circle arc that curves toward the pole.

On a sphere, the shortest path between two points lies in the plane through the center, curving toward the pole where latitude circles are smaller instead of following a straight line on a flat map.
7

Multiple Unknown Functions

When a path requires two or more unknown functions at the same time, such as y(x)\Path{y(x)} and z(x)\Path{z(x)} for a curve in 3D space between A=(x1,y1,z1)A = (x_1, \Path{y_1}, \Path{z_1}) and B=(x2,y2,z2)B = (x_2, \Path{y_2}, \Path{z_2}), we want to find the stationary pair that optimizes

S\displaystyle \Score{S} =∫x1x2L(x,y,z,y′,z′) dx\displaystyle = \int_{x_1}^{x_2} \Score{L}(x, \Path{y}, \Path{z}, \Slope{y'}, \Slope{z'})\,dx
Multiple Unknown Functions

Because we can nudge y(x)\Path{y(x)} while holding z(x)\Path{z(x)} fixed and nudge z(x)\Path{z(x)} while holding y(x)\Path{y(x)} fixed, each unknown function satisfies its own Euler-Lagrange equation:

∂L∂y−ddx(∂L∂y′)=0,∂L∂z−ddx(∂L∂z′)=0\displaystyle \begin{aligned} \HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) &= 0, \\ \HeightSens{\frac{\partial L}{\partial z}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial z'}}\right) &= 0 \end{aligned}

For the 3D arc-length cost L\Score{L} == 1+(y′)2+(z′)2\sqrt{1 + (\Slope{y'})^2 + (\Slope{z'})^2}, both y\Path{y} and z\Path{z} are missing, so Shortcut 1 gives constant slopes y(x)=m1x+b1\Path{y(x)} = m_1 x + b_1 and z(x)=m2x+b2\Path{z(x)} = m_2 x + b_2; when L\Score{L} == 12(y′)2+12(z′)2+yz\frac{1}{2}(\Slope{y'})^2 + \frac{1}{2}(\Slope{z'})^2 + \Path{y}\Path{z} couples the two functions together, we solve their two equations as a system.

Text solution
Write the Euler-Lagrange equation for y(x)\Path{y(x)}Differentiating L\Score{L} == 12(y′)2+12(z′)2+yz\frac{1}{2}(\Slope{y'})^2 + \frac{1}{2}(\Slope{z'})^2 + \Path{y}\Path{z} with respect to y\Path{y} and y′\Slope{y'} links y′′\Second{y''} to z\Path{z}.
∂L∂y\displaystyle \HeightSens{\frac{\partial L}{\partial y}} =z,∂L∂y′\displaystyle = \Path{z}, \quad \SlopeSens{\frac{\partial L}{\partial y'}} =y′  ⟹  y′′\displaystyle = \Slope{y'} \implies \Second{y''} =z\displaystyle = \Path{z}
Write the Euler-Lagrange equation for z(x)\Path{z(x)} and uncoupleDifferentiating with respect to z\Path{z} and z′\Slope{z'} gives the second equation, which substitutes into the first to produce a single equation for y(x)\Path{y(x)}.
∂L∂z\displaystyle \HeightSens{\frac{\partial L}{\partial z}} =y,∂L∂z′\displaystyle = \Path{y}, \quad \SlopeSens{\frac{\partial L}{\partial z'}} =z′  ⟹  z′′\displaystyle = \Slope{z'} \implies \Second{z''} =y  ⟹  y(4)\displaystyle = \Path{y} \implies \Second{y^{(4)}} =y\displaystyle = \Path{y}

Key concepts

Every variational problem starts by writing the score of one tiny slice so that S\Score{S} == ∫x1x2L(x,y,y′) dx\int_{x_1}^{x_2} \Score{L}(x, \Path{y}, \Slope{y'})\,dx, using perpendicular step legs ds\Step{ds} == dx2+dy2\sqrt{\Step{dx^2} + \Step{dy^2}} == 1+(y′)2 dx\sqrt{1 + (\Slope{y'})^2}\,\Step{dx} in rectangular coordinates, or multiplying angular steps by their local circle radius (r dθ\Step{r\,d\theta} in polar coordinates, R dϕ\Step{R\,d\phi} on a cylinder, Rsin⁡θ dϕ\Step{R\sin\theta\,d\phi} on a sphere). Drop any overall positive constant factor from L\Score{L} before differentiating.

Once you have L\Score{L}, check which variables appear explicitly before taking derivatives:

Dependent variable y\Path{y} is missing (∂L∂y=0\HeightSens{\frac{\partial L}{\partial y}} = 0)

Use Shortcut 1, ∂L∂y′=C\SlopeSens{\frac{\partial L}{\partial y'}} = C. In L(r,θ,θ′)\Score{L}(r, \Path{\theta}, \Slope{\theta'}) == 1+r2(θ′)2\sqrt{1 + r^2(\Slope{\theta'})^2}, the angle θ\Path{\theta} is absent, so ∂L∂θ′\SlopeSens{\frac{\partial L}{\partial \theta'}} == r2θ′1+r2(θ′)2\frac{r^2\Slope{\theta'}}{\sqrt{1 + r^2(\Slope{\theta'})^2}} == CC immediately gives a first-order equation.

Independent variable xx is missing (∂L∂x=0\frac{\partial L}{\partial x} = 0)

Use Shortcut 2 (the Beltrami identity), L−y′∂L∂y′\Score{L} - \Slope{y'}\SlopeSens{\frac{\partial L}{\partial y'}} == CC, as in the ramp cost L(y,y′)\Score{L}(\Path{y}, \Slope{y'}) == 1+(y′)2y\frac{\sqrt{1 + (\Slope{y'})^2}}{\sqrt{\Path{y}}}. If y\Path{y} is also missing (as in L=1+(y′)2\Score{L} = \sqrt{1 + (\Slope{y'})^2}), Shortcut 1 is simpler. Do not use Shortcut 2 if xx appears explicitly anywhere in L\Score{L} (as in 12x(y′)2+4y′\frac{1}{2x}(y')^2 + 4y').

All three variables x,y,y′x, \Path{y}, \Slope{y'} are present

Write the full Euler-Lagrange equation ∂L∂y−ddx(∂L∂y′)\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) == 00. Treat x,y,y′x, \Path{y}, \Slope{y'} as independent during the partial derivatives ∂∂y\HeightSens{\frac{\partial}{\partial y}} and ∂∂y′\SlopeSens{\frac{\partial}{\partial y'}}, then differentiate xx, y(x)\Path{y(x)}, and y′(x)\Slope{y'(x)} together using the product and chain rules when applying ddx\frac{d}{dx} (so ddx(x2y′+y)\frac{d}{dx}(x^2 \Slope{y'} + \Path{y}) == 2xy′+x2y′′+y′2x\Slope{y'} + x^2 \Second{y''} + \Slope{y'}).

Multiple unknown functions y(x)\Path{y(x)}, z(x)\Path{z(x)}

Write a separate Euler-Lagrange equation for each unknown function, checking each variable individually for Shortcut 1.

8

Practice

1

A small rover travels in the upper half of the xyxy-plane (y>0\Path{y} > 0) from A=(0,y0)A = (0, \Path{y_0}) to B=(x2,y0)B = (x_2, \Path{y_0}). Because the ground becomes firmer at larger y\Path{y}, the rover's speed increases in direct proportion to y\Path{y}: v(y)=ky\Speed{v}(\Path{y}) = k\Path{y}, where kk is a positive constant. (a) Using the arc-length step ds\Step{ds} == 1+(y′)2 dx\sqrt{1 + (\Slope{y'})^2}\,\Step{dx}, write the travel-time functional T\Score{T} == ∫0x2L(x,y,y′) dx\int_0^{x_2} \Score{L}(x, \Path{y}, \Slope{y'})\,dx and identify the local cost function L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}). (b) Suppose you start with the straight horizontal path y(x)=y0\Path{y(x)} = \Path{y_0} between AA and BB, grab one joint between two tiny straight segments of the path, and pull it upward by δy>0\Nudge{\delta y} > 0. Using the two-stick argument, explain how the height cost and the slope cost change, and predict whether the fastest path between AA and BB arches upward (y>y0\Path{y} > \Path{y_0}) or sags downward (y<y0\Path{y} < \Path{y_0}).

For (a), write the time across one step as dt\Score{dt} == dsv(y)\tfrac{\Step{ds}}{\Speed{v}(\Path{y})}. For (b), check the sign of ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} when y\Path{y} increases, and compare the slope sensitivity ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} on the two sticks when the curve bends into the faster region.

(a) Across one tiny step of length ds\Step{ds} == 1+(y′)2 dx\sqrt{1 + (\Slope{y'})^2}\,\Step{dx}, the travel time is dt\Score{dt} == dsv(y)\frac{\Step{ds}}{\Speed{v}(\Path{y})} == 1+(y′)2ky dx\frac{\sqrt{1 + (\Slope{y'})^2}}{k\Path{y}}\,\Step{dx}. (Be careful not to multiply by speed and write ky1+(y′)2 dxk\Path{y}\sqrt{1 + (\Slope{y'})^2}\,\Step{dx}, which has dimensions of length2/time\text{length}^2/\text{time} rather than time\text{time}.) Integrating from x=0x = 0 to x=x2x = x_2 gives
T\displaystyle \Score{T} =∫0x21+(y′)2ky dx\displaystyle = \int_0^{x_2} \frac{\sqrt{1 + (\Slope{y'})^2}}{k\Path{y}}\,dx
so the local cost function is L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}) == 1+(y′)2ky\frac{\sqrt{1 + (\Slope{y'})^2}}{k\Path{y}} (or L=1+(y′)2y\Score{L} = \frac{\sqrt{1 + (\Slope{y'})^2}}{\Path{y}} after dropping the constant positive factor 1k\tfrac{1}{k}).
(b) Taking the partial derivative with respect to height gives ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} == −1+(y′)2ky2<0-\frac{\sqrt{1 + (\Slope{y'})^2}}{k\Path{y}^2} < 0, which is negative because moving to larger y\Path{y} puts the rover on faster ground and reduces the time per unit xx. (Do not confuse increasing speed v=ky\Speed{v} = k\Path{y} with increasing cost L\Score{L}: ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} is negative, not positive, so sagging downward to y<y0\Path{y} < \Path{y_0} would slow the rover down and increase travel time.) Pulling a joint upward (δy>0\Nudge{\delta y} > 0) lowers the local height cost by ∂L∂yδy<0\HeightSens{\frac{\partial L}{\partial y}}\Nudge{\delta y} < 0. Along the straight horizontal path where y′=0\Slope{y'} = 0, the slope sensitivity ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} == y′ky1+(y′)2\frac{\Slope{y'}}{k\Path{y}\sqrt{1 + (\Slope{y'})^2}} is zero on both sticks; as the path bends upward, the difference in ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} from left to right creates a bending resistance ddx(∂L∂y′)\frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) due to the extra path length. To balance the negative height sensitivity ∂L∂y\HeightSens{\frac{\partial L}{\partial y}}, the fastest path arches upward into the faster region (y>y0\Path{y} > \Path{y_0}).
2

When deriving the Euler-Lagrange equation using a smooth wiggle ynew(x)\Nudge{y_{\text{new}}(x)} == y(x)+εη(x)\Path{y(x)} + \Nudge{\varepsilon\eta(x)}, we integrated the slope-nudge term by parts:

∫x1x2∂L∂y′η′(x) dx=[∂L∂y′η(x)]x1x2−∫x1x2[ddx(∂L∂y′)]η(x) dx\displaystyle \begin{aligned} &\int_{x_1}^{x_2} \SlopeSens{\tfrac{\partial L}{\partial y'}}\Nudge{\eta'(x)}\,dx \\ &= \Big[\SlopeSens{\tfrac{\partial L}{\partial y'}}\Nudge{\eta(x)}\Big]_{x_1}^{x_2} \\ &- \int_{x_1}^{x_2} \Big[\tfrac{d}{dx}\Big(\SlopeSens{\tfrac{\partial L}{\partial y'}}\Big)\Big]\Nudge{\eta(x)}\,dx \end{aligned}

which led to the condition

∫x1x2[∂L∂y−ddx(∂L∂y′)]η(x) dx=0\displaystyle \begin{aligned} \int_{x_1}^{x_2} \Big[&\HeightSens{\tfrac{\partial L}{\partial y}} \\ &- \tfrac{d}{dx}\Big(\SlopeSens{\tfrac{\partial L}{\partial y'}}\Big)\Big]\Nudge{\eta(x)}\,dx \\ &= 0 \end{aligned}

(a) Why does the boundary term [∂L∂y′η(x)]x1x2\left[\SlopeSens{\frac{\partial L}{\partial y'}}\Nudge{\eta(x)}\right]_{x_1}^{x_2} equal zero? (b) A student objects: "An integral can equal zero even when its integrand isn't zero everywhere, because positive and negative areas can cancel out. So the bracketed expression ∂L∂y−ddx(∂L∂y′)\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) doesn't have to be zero at every point xx." Explain how the freedom to choose the wiggle function η(x)\Nudge{\eta(x)} rules out this possibility.

For (a), ask what constraint every candidate path ynew(x)\Nudge{y_{\text{new}}(x)} must obey at x=x1x = x_1 and x=x2x = x_2. For (b), consider what happens if you pick a wiggle η(x)\Nudge{\eta(x)} that is non-zero only on a tiny interval where the bracketed expression has a single sign.

(a) Every candidate path ynew(x)\Nudge{y_{\text{new}}(x)} must pass through the fixed endpoints A=(x1,y1)A = (x_1, \Path{y_1}) and B=(x2,y2)B = (x_2, \Path{y_2}). Because y(x)\Path{y(x)} already passes through both endpoints, the height wiggle η(x)\Nudge{\eta(x)} must be zero at both ends: η(x1)=0\Nudge{\eta(x_1)} = 0 and η(x2)=0\Nudge{\eta(x_2)} = 0. (Note that the slope η′(x)\Nudge{\eta'(x)} and the slope sensitivity ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} do not have to be zero at the endpoints; it is η(x)\Nudge{\eta(x)} itself that is pinned to zero.) Multiplying ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} by zero at x1x_1 and x2x_2 makes the boundary term vanish.
(b) The integral must equal zero not just for one single wiggle across [x1,x2][x_1, x_2], but for every smooth wiggle η(x)\Nudge{\eta(x)} that is zero at the endpoints. Suppose the bracketed expression ∂L∂y−ddx(∂L∂y′)\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) were non-zero (say, positive) around some point x0x_0. Then we could choose a wiggle η(x)\Nudge{\eta(x)} that is zero everywhere except for a smooth positive bump right over that region around x0x_0. For that choice of η(x)\Nudge{\eta(x)}, the integrand would be positive around x0x_0 and zero everywhere else, leaving no negative area anywhere to cancel the positive area. The only way the integral can be zero for all possible wiggles is if ∂L∂y−ddx(∂L∂y′)\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) == 00 at every point along the path.
3

Find the stationary path y(x)\Path{y(x)} between A=(1,0)A = (1, 0) and B=(2,3)B = (2, 3) for the functional

S\displaystyle \Score{S} =∫12[12x(y′)2+4y′]dx\displaystyle = \int_1^2 \left[\frac{1}{2x}(y')^2 + 4y'\right]dx

Check which variable is missing from L(x,y,y′)=12x(y′)2+4y′L(x, y, y') = \frac{1}{2x}(y')^2 + 4y' before taking any derivatives.

Here L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}) == 12x(y′)2+4y′\frac{1}{2x}(\Slope{y'})^2 + 4\Slope{y'}. Because y\Path{y} does not appear explicitly in L\Score{L} (∂L∂y=0\HeightSens{\frac{\partial L}{\partial y}} = 0), Shortcut 1 gives
∂L∂y′\displaystyle \SlopeSens{\frac{\partial L}{\partial y'}} =y′x+4\displaystyle = \frac{\Slope{y'}}{x} + 4 =k\displaystyle = k
where kk is a constant. Defining C1=k−4C_1 = k - 4 gives
y′x\displaystyle \frac{\Slope{y'}}{x} =C1  ⟹  y′(x)\displaystyle = C_1 \implies \Slope{y'(x)} =C1x\displaystyle = C_1 x
(Be careful to multiply by xx rather than writing y′=C1x\Slope{y'} = \tfrac{C_1}{x}, which would integrate to a logarithm y=3ln⁡2ln⁡x\Path{y} = \frac{3}{\ln 2}\ln x instead of a parabola.) Integrating with respect to xx gives the general solution
y(x)\displaystyle \Path{y(x)} =12C1x2+C2\displaystyle = \frac{1}{2}C_1 x^2 + C_2
Apply the endpoint conditions y(1)=0\Path{y(1)} = 0 and y(2)=3\Path{y(2)} = 3:
At x=1:12C1+C2=0At x=2:2C1+C2=3\displaystyle \begin{aligned} \text{At } x = 1: && \frac{1}{2}C_1 + C_2 &= 0 \\ \text{At } x = 2: && 2C_1 + C_2 &= 3 \end{aligned}
Subtracting the first equation from the second gives 32C1=3\frac{3}{2}C_1 = 3, so C1=2C_1 = 2 and C2=−1C_2 = -1. The stationary path is
y(x)\displaystyle \Path{y(x)} =x2−1\displaystyle = x^2 - 1
4

For the rover in Problem 1 with local cost function L(x,y,y′)=1+(y′)2yL(x, y, y') = \frac{\sqrt{1 + (y')^2}}{y}, suppose the endpoints are A=(−3,4)A = (-3, 4) and B=(3,4)B = (3, 4). (a) Explain why Shortcut 2 (the Beltrami identity) applies to LL, and use it to show that any stationary path satisfies the first-order differential equation y2[1+(y′)2]=R2\Path{y}^2[1 + (\Slope{y'})^2] = R^2, where RR is a positive constant. (b) Separate variables and integrate this differential equation to find the equation of the stationary path between A=(−3,4)A = (-3, 4) and B=(3,4)B = (3, 4), and find the maximum value of y\Path{y} reached along the path.

For (a), put L\Score{L} and y′∂L∂y′\Slope{y'}\SlopeSens{\frac{\partial L}{\partial y'}} over the common denominator y1+(y′)2\Path{y}\sqrt{1 + (\Slope{y'})^2}. For (b), solve for dydx\Slope{\tfrac{dy}{dx}}, put all y\Path{y} factors with dy\Step{dy}, and integrate yR2−y2 dy\frac{\Path{y}}{\sqrt{R^2 - \Path{y}^2}}\,\Step{dy}.

(a) The horizontal coordinate xx does not appear explicitly in L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}) == 1+(y′)2y\frac{\sqrt{1 + (\Slope{y'})^2}}{\Path{y}}, so ∂L∂x=0\frac{\partial L}{\partial x} = 0 and Shortcut 2 applies:
L−y′∂L∂y′\displaystyle \Score{L} - \Slope{y'}\SlopeSens{\frac{\partial L}{\partial y'}} =C\displaystyle = C
Computing ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} == y′y1+(y′)2\frac{\Slope{y'}}{\Path{y}\sqrt{1 + (\Slope{y'})^2}} and substituting into Shortcut 2 (remembering to multiply ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} by y′\Slope{y'} so the numerator has (y′)2(\Slope{y'})^2, not y′\Slope{y'}) gives
1+(y′)2y−(y′)2y1+(y′)2\displaystyle \frac{\sqrt{1 + (\Slope{y'})^2}}{\Path{y}} - \frac{(\Slope{y'})^2}{\Path{y}\sqrt{1 + (\Slope{y'})^2}} =C\displaystyle = C
Putting both terms over the common denominator y1+(y′)2\Path{y}\sqrt{1 + (\Slope{y'})^2} cancels (y′)2(\Slope{y'})^2 in the numerator:
1y1+(y′)2\displaystyle \frac{1}{\Path{y}\sqrt{1 + (\Slope{y'})^2}} =C\displaystyle = C
Squaring and inverting both sides, and writing the positive constant 1C2\tfrac{1}{C^2} as R2R^2, gives
y2[1+(y′)2]\displaystyle \Path{y}^2\left[1 + (\Slope{y'})^2\right] =R2\displaystyle = R^2
(b) Solving for dydx=y′\Slope{\frac{dy}{dx}} = \Slope{y'} gives
(y′)2\displaystyle (\Slope{y'})^2 =R2−y2y2  ⟹  dydx\displaystyle = \frac{R^2 - \Path{y}^2}{\Path{y}^2} \implies \Slope{\frac{dy}{dx}} =±R2−y2y\displaystyle = \pm\frac{\sqrt{R^2 - \Path{y}^2}}{\Path{y}}
Separating variables puts all y\Path{y} terms on one side and dx\Step{dx} on the other:
yR2−y2 dy\displaystyle \frac{\Path{y}}{\sqrt{R^2 - \Path{y}^2}}\,\Step{dy} =±dx\displaystyle = \pm \Step{dx}
Integrating both sides (taking care with the chain-rule factor of −2y-2\Path{y} inside R2−y2\sqrt{R^2 - \Path{y}^2} so you do not get an extra factor of 22 that turns the circle into an ellipse 4y2+x2=734\Path{y}^2 + x^2 = 73) gives
−R2−y2\displaystyle -\sqrt{R^2 - \Path{y}^2} =±(x−x0)\displaystyle = \pm(x - x_0)
Squaring both sides gives a circle of radius RR centered at (x0,0)(x_0, 0) on the xx-axis:
(x−x0)2+y2\displaystyle (x - x_0)^2 + \Path{y}^2 =R2\displaystyle = R^2
Substituting the endpoints A=(−3,4)A = (-3, 4) and B=(3,4)B = (3, 4) gives (−3−x0)2+16=R2(-3 - x_0)^2 + 16 = R^2 and (3−x0)2+16=R2(3 - x_0)^2 + 16 = R^2. Subtracting these requires (−3−x0)2=(3−x0)2(-3 - x_0)^2 = (3 - x_0)^2, so x0=0x_0 = 0 and R2=32+42=25R^2 = 3^2 + 4^2 = 25 (R=5R = 5). The stationary path is the circular arc
x2+y2\displaystyle x^2 + \Path{y}^2 =25(−3≤x≤3,  y>0)\displaystyle = 25 \quad (-3 \le x \le 3,\; \Path{y} > 0)
and its maximum value of y\Path{y} (at the top of the arc x=0x = 0, where y′=0\Slope{y'} = 0, rather than the endpoint height y=4\Path{y} = 4) is ymax⁡=5\Path{y_{\max}} = 5.
5

A marble starts from rest at A=(0,0)A = (0, 0) and slides without friction under gravity down a cycloid ramp

x(θ)\displaystyle x(\theta) =R(θ−sin⁡θ),y(θ)\displaystyle = R(\theta - \sin\theta), \qquad \Path{y(\theta)} =R(1−cos⁡θ)\displaystyle = R(1 - \cos\theta)

with y\Path{y} measured downward, to reach point B=(x2,y2)B = (x_2, \Path{y_2}). (a) Suppose BB is at depth y2=2.0 m\Path{y_2} = 2.0\text{ m} and the marble reaches BB when the cycloid's generating wheel has rolled through angle θ2=π rad\theta_2 = \pi\text{ rad}. Find the wheel radius RR and the horizontal coordinate x2x_2 of point BB. (b) If BB is instead located at x2=4.0 mx_2 = 4.0\text{ m} and y2=2.0 m\Path{y_2} = 2.0\text{ m}, does the fastest ramp go steadily downward from AA to BB, or does it dive deeper than y2=2.0 m\Path{y_2} = 2.0\text{ m} and curve back upward to reach BB? Justify your answer using the ratio x2y2\tfrac{x_2}{\Path{y_2}}.

For (a), evaluate 1−cos⁡π1 - \cos\pi in y(θ)\Path{y(\theta)} first to find RR. For (b), compare x2y2\tfrac{x_2}{\Path{y_2}} with the ratio xy\tfrac{x}{\Path{y}} at the bottom of the cycloid (θ=π\theta = \pi).

(a) Evaluating y(θ)\Path{y(\theta)} at θ2=π\theta_2 = \pi gives
y2\displaystyle \Path{y_2} =R(1−cos⁡π)\displaystyle = R(1 - \cos\pi) =R(1−(−1))\displaystyle = R(1 - (-1)) =2R\displaystyle = 2R
(Watch the sign of cos⁡π=−1\cos\pi = -1: taking 1−cos⁡π=11 - \cos\pi = 1 would double both RR and x2x_2 to R=2.0 mR = 2.0\text{ m} and x2≈6.28 mx_2 \approx 6.28\text{ m}.) Since y2=2.0 m\Path{y_2} = 2.0\text{ m}, the wheel radius is R=2.0 m2=1.0 mR = \frac{2.0\text{ m}}{2} = 1.0\text{ m}. Substituting R=1.0 mR = 1.0\text{ m} and θ2=π\theta_2 = \pi into x(θ)x(\theta) gives
x2\displaystyle x_2 =(1.0 m)(π−sin⁡π)\displaystyle = (1.0\text{ m})(\pi - \sin\pi) =π m≈3.14 m\displaystyle = \pi\text{ m} \approx 3.14\text{ m}
(b) At θ=π\theta = \pi (the lowest point of the cycloid), the ratio of horizontal distance to vertical drop is
xy∣θ=π\displaystyle \left.\frac{x}{\Path{y}}\right|_{\theta=\pi} =π−sin⁡π1−cos⁡π\displaystyle = \frac{\pi - \sin\pi}{1 - \cos\pi} =π2≈1.57\displaystyle = \frac{\pi}{2} \approx 1.57
(Be sure to divide by 1−cos⁡π=21 - \cos\pi = 2 so you compare x2y2\tfrac{x_2}{\Path{y_2}} against π2≈1.57\tfrac{\pi}{2} \approx 1.57, not π≈3.14\pi \approx 3.14.) For B=(4.0 m,2.0 m)B = (4.0\text{ m}, 2.0\text{ m}), the ratio is x2y2=4.0 m2.0 m=2.0\frac{x_2}{\Path{y_2}} = \frac{4.0\text{ m}}{2.0\text{ m}} = 2.0. Because x2y2=2.0>π2\frac{x_2}{\Path{y_2}} = 2.0 > \frac{\pi}{2}, the wheel must roll past θ=π\theta = \pi (θ2>π\theta_2 > \pi) to reach BB, so the fastest ramp dives deeper than y2=2.0 m\Path{y_2} = 2.0\text{ m} and curves back upward at the end to reach BB.
6

Find the stationary path y(x)\Path{y(x)} between A=(1,9)A = (1, 9) and B=(2,5)B = (2, 5) for the functional

S=∫12[12x2(y′)2+yy′+3y2]dx\displaystyle \begin{aligned} \Score{S} &= \int_1^2 \Bigg[\frac{1}{2}x^2(y')^2 \\ &\quad + yy' + 3y^2\Bigg]dx \end{aligned}

Compute ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} and ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} first, and remember that y\Path{y} in ∂L∂y′\SlopeSens{\frac{\partial L}{\partial y'}} is a function of xx when you apply ddx\frac{d}{dx}.

Here L(x,y,y′)\Score{L}(x, \Path{y}, \Slope{y'}) == 12x2(y′)2+yy′+3y2\frac{1}{2}x^2(\Slope{y'})^2 + \Path{y}\Slope{y'} + 3\Path{y}^2 contains xx, y\Path{y}, and y′\Slope{y'} explicitly, so we apply the full Euler-Lagrange equation ∂L∂y−ddx(∂L∂y′)\HeightSens{\frac{\partial L}{\partial y}} - \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) == 00:
∂L∂y\displaystyle \HeightSens{\frac{\partial L}{\partial y}} =y′+6y,∂L∂y′\displaystyle = \Slope{y'} + 6\Path{y}, \qquad \SlopeSens{\frac{\partial L}{\partial y'}} =x2y′+y\displaystyle = x^2 \Slope{y'} + \Path{y}
Taking the total derivative ddx\frac{d}{dx} along the curve y(x)\Path{y(x)} requires the product rule on x2y′x^2 \Slope{y'} and differentiating y(x)\Path{y(x)} to y′(x)\Slope{y'(x)}:
ddx(∂L∂y′)\displaystyle \frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) =ddx(x2y′+y)\displaystyle = \frac{d}{dx}(x^2 \Slope{y'} + \Path{y}) =2xy′+x2y′′+y′\displaystyle = 2x\Slope{y'} + x^2 \Second{y''} + \Slope{y'}
(Do not drop the 2xy′2x\Slope{y'} product-rule term or treat y\Path{y} as a constant when applying ddx\frac{d}{dx}; missing 2xy′2x\Slope{y'} leads to the wrong roots r=3,−2r = 3, -2 and y(x)=1131x3+26831x2\Path{y(x)} = \frac{11}{31}x^3 + \frac{268}{31x^2}.) Setting ∂L∂y\HeightSens{\frac{\partial L}{\partial y}} == ddx(∂L∂y′)\frac{d}{dx}\left(\SlopeSens{\frac{\partial L}{\partial y'}}\right) cancels y′\Slope{y'} on both sides:
y′+6y\displaystyle \Slope{y'} + 6\Path{y} =2xy′+x2y′′+y′  ⟹  x2y′′+2xy′−6y\displaystyle = 2x\Slope{y'} + x^2 \Second{y''} + \Slope{y'} \implies x^2 \Second{y''} + 2x\Slope{y'} - 6\Path{y} =0\displaystyle = 0
Trying a power-law solution y(x)=xr\Path{y(x)} = x^r with y′=rxr−1\Slope{y'} = rx^{r-1} and y′′=r(r−1)xr−2\Second{y''} = r(r - 1)x^{r-2} gives
[r(r−1)+2r−6]xr\displaystyle \left[r(r - 1) + 2r - 6\right]x^r =(r2+r−6)xr\displaystyle = (r^2 + r - 6)x^r =(r−2)(r+3)xr\displaystyle = (r - 2)(r + 3)x^r =0\displaystyle = 0
The roots r=2r = 2 and r=−3r = -3 give the general solution
y(x)\displaystyle \Path{y(x)} =C1x2+C2x3\displaystyle = C_1 x^2 + \frac{C_2}{x^3}
Apply the endpoint conditions y(1)=9\Path{y(1)} = 9 and y(2)=5\Path{y(2)} = 5:
At x=1:C1+C2=9At x=2:4C1+18C2=5  ⟹  32C1+C2=40\displaystyle \begin{aligned} \text{At } x = 1: && C_1 + C_2 &= 9 \\ \text{At } x = 2: && 4C_1 + \frac{1}{8}C_2 &= 5 \\ && \implies 32C_1 + C_2 &= 40 \end{aligned}
Subtracting C1+C2=9C_1 + C_2 = 9 from 32C1+C2=4032C_1 + C_2 = 40 gives 31C1=3131C_1 = 31, so C1=1C_1 = 1 and C2=8C_2 = 8. The stationary path is
y(x)\displaystyle \Path{y(x)} =x2+8x3\displaystyle = x^2 + \frac{8}{x^3}
7

An ant walks on the surface of a cone given in cylindrical coordinates (r,ϕ,z)(r, \Path{\phi}, \Path{z}) by z=r\Path{z} = r. Any point on the cone can be specified by its radial distance rr from the axis and its angle ϕ\Path{\phi} around the axis. (a) In a tiny step on the cone where rr changes by dr\Step{dr} (so z\Path{z} also changes by dz=dr\Step{dz} = \Step{dr}) and ϕ\Path{\phi} changes by dϕ\Step{d\phi}, show by the Pythagorean theorem that the step length is ds\Step{ds} == 2 dr2+r2dϕ2\sqrt{2\,\Step{dr^2} + \Step{r^2 d\phi^2}}. (b) Treating ϕ(r)\Path{\phi(r)} as a function of rr, write the arc-length functional S\Score{S} == ∫r1r2L(r,ϕ,ϕ′) dr\int_{r_1}^{r_2} \Score{L}(r, \Path{\phi}, \Slope{\phi'})\,dr, use Shortcut 1 to obtain a first-order differential equation for ϕ′(r)=dϕdr\Slope{\phi'(r)} = \Slope{\tfrac{d\phi}{dr}}, and integrate it using the substitution r=Ccos⁡ur = \tfrac{C}{\cos u} to find the general equation relating rr and ϕ\Path{\phi} for a geodesic on the cone.

For (a), find the slant length of a step where dr\Step{dr} and dz=dr\Step{dz} = \Step{dr} happen together before combining it with the perpendicular circular arc r dϕ\Step{r\,d\phi}. For (b), factor dr\Step{dr} out of ds\Step{ds} and check which variable is absent from L(r,ϕ,ϕ′)\Score{L}(r, \Path{\phi}, \Slope{\phi'}).

(a) A step straight up the side of the cone changes rr by dr\Step{dr} and z\Path{z} by dz=dr\Step{dz} = \Step{dr}, so by the Pythagorean theorem its slant length is dr2+dz2\sqrt{\Step{dr^2} + \Step{dz^2}} == dr2+dr2\sqrt{\Step{dr^2} + \Step{dr^2}} == 2 dr\sqrt{2}\,\Step{dr}. (Do not forget the vertical rise dz=dr\Step{dz} = \Step{dr} and write the flat-plane formula dr2+r2dϕ2\sqrt{\Step{dr^2} + \Step{r^2 d\phi^2}}.) A purely angular step dϕ\Step{d\phi} around the horizontal circle of radius rr has arc length r dϕ\Step{r\,d\phi}. Because these two displacements are perpendicular on the surface of the cone, the total step length is
ds\displaystyle \Step{ds} =(2 dr)2+(r dϕ)2\displaystyle = \sqrt{(\sqrt{2}\,\Step{dr})^2 + (\Step{r\,d\phi})^2} =2 dr2+r2dϕ2\displaystyle = \sqrt{2\,\Step{dr^2} + \Step{r^2 d\phi^2}}
(b) Factoring dr\Step{dr} out of the square root with ϕ′=dϕdr\Slope{\phi'} = \Slope{\frac{d\phi}{dr}} gives ds\Step{ds} == 2+r2(ϕ′)2 dr\sqrt{2 + r^2(\Slope{\phi'})^2}\,\Step{dr}, so the arc-length functional is
S\displaystyle \Score{S} =∫r1r22+r2(ϕ′)2 dr,L(r,ϕ,ϕ′)\displaystyle = \int_{r_1}^{r_2} \sqrt{2 + r^2(\Slope{\phi'})^2}\,dr, \qquad \Score{L}(r, \Path{\phi}, \Slope{\phi'}) =2+r2(ϕ′)2\displaystyle = \sqrt{2 + r^2(\Slope{\phi'})^2}
Because ϕ\Path{\phi} does not appear explicitly in L\Score{L} (∂L∂ϕ=0\HeightSens{\frac{\partial L}{\partial \phi}} = 0), Shortcut 1 gives
∂L∂ϕ′\displaystyle \SlopeSens{\frac{\partial L}{\partial \phi'}} =r2ϕ′2+r2(ϕ′)2\displaystyle = \frac{r^2\Slope{\phi'}}{\sqrt{2 + r^2(\Slope{\phi'})^2}} =C\displaystyle = C
Squaring both sides and solving for ϕ′=dϕdr\Slope{\phi'} = \Slope{\frac{d\phi}{dr}} (keeping the factor of 22 inside 2+r2(ϕ′)22 + r^2(\Slope{\phi'})^2 so you do not lose the 2\sqrt{2} in the numerator) gives
r4(ϕ′)2=C2[2+r2(ϕ′)2]  ⟹  r2(r2−C2)(ϕ′)2=2C2  ⟹  dϕdr=2 Crr2−C2\displaystyle \begin{aligned} r^4(\Slope{\phi'})^2 &= C^2\left[2 + r^2(\Slope{\phi'})^2\right] \\ &\implies r^2(r^2 - C^2)(\Slope{\phi'})^2 = 2C^2 \\ &\implies \Slope{\frac{d\phi}{dr}} = \frac{\sqrt{2}\,C}{r\sqrt{r^2 - C^2}} \end{aligned}
Using the substitution r=Ccos⁡ur = \frac{C}{\cos u} (so cos⁡u=Cr\cos u = \frac{C}{r}, dr=Csin⁡ucos⁡2u du\Step{dr} = \frac{C\sin u}{\cos^2 u}\,\Step{du}, and r2−C2=Ctan⁡u\sqrt{r^2 - C^2} = C\tan u), we get
dϕ\displaystyle \Step{d\phi} =2 C(Ccos⁡u)(Ctan⁡u)Csin⁡ucos⁡2u du\displaystyle = \frac{\sqrt{2}\,C}{\left(\frac{C}{\cos u}\right)(C\tan u)}\frac{C\sin u}{\cos^2 u}\,\Step{du} =2 du\displaystyle = \sqrt{2}\,\Step{du}
Integrating gives ϕ−ϕ0=2 u\Path{\phi} - \phi_0 = \sqrt{2}\,u, or u=ϕ−ϕ02u = \frac{\Path{\phi} - \phi_0}{\sqrt{2}}. Substituting back into cos⁡u=Cr\cos u = \frac{C}{r} gives the geodesic equation on the cone:
rcos⁡ ⁣(ϕ−ϕ02)\displaystyle r\cos\!\left(\frac{\Path{\phi} - \phi_0}{\sqrt{2}}\right) =C\displaystyle = C
8

Find the stationary pair of functions y(x)\Path{y(x)} and z(x)\Path{z(x)} connecting the 3D endpoints A=(0,1,0)A = (0, 1, 0) and B=(1,3,2)B = (1, 3, 2), meaning y(0)=1\Path{y(0)} = 1, z(0)=0\Path{z(0)} = 0 and y(1)=3\Path{y(1)} = 3, z(1)=2\Path{z(1)} = 2, for the functional

S=∫01[12(y′)2+y′z′+6xy]dx\displaystyle \begin{aligned} \Score{S} &= \int_0^1 \Bigg[\frac{1}{2}(y')^2 \\ &\quad + y'z' + 6xy\Bigg]dx \end{aligned}

Write one Euler-Lagrange equation for y(x)\Path{y(x)} and one for z(x)\Path{z(x)}, and notice that z\Path{z} itself is missing from L\Score{L}.

Here L(x,y,z,y′,z′)\Score{L}(x, \Path{y}, \Path{z}, \Slope{y'}, \Slope{z'}) == 12(y′)2+y′z′+6xy\frac{1}{2}(\Slope{y'})^2 + \Slope{y'}\Slope{z'} + 6x\Path{y}, and each unknown function gets its own Euler-Lagrange equation.
For y(x)\Path{y(x)}, differentiating L\Score{L} with respect to y\Path{y} and y′\Slope{y'} (taking care to include the z′\Slope{z'} contribution from the cross term y′z′\Slope{y'}\Slope{z'}, rather than writing ∂L∂y′=y′\SlopeSens{\frac{\partial L}{\partial y'}} = \Slope{y'} and getting y(x)=x3+x+1\Path{y(x)} = x^3 + x + 1) gives
∂L∂y\displaystyle \HeightSens{\frac{\partial L}{\partial y}} =6x,∂L∂y′\displaystyle = 6x, \qquad \SlopeSens{\frac{\partial L}{\partial y'}} =y′+z′  ⟹  y′′+z′′\displaystyle = \Slope{y'} + \Slope{z'} \implies \Second{y''} + \Second{z''} =6x\displaystyle = 6x
For z(x)\Path{z(x)}, because z\Path{z} is missing from L\Score{L} (∂L∂z=0\HeightSens{\frac{\partial L}{\partial z}} = 0), Shortcut 1 gives
∂L∂z′\displaystyle \SlopeSens{\frac{\partial L}{\partial z'}} =y′\displaystyle = \Slope{y'} =C1  ⟹  y′′\displaystyle = C_1 \implies \Second{y''} =0\displaystyle = 0
Integrating y′=C1\Slope{y'} = C_1 gives
y(x)\displaystyle \Path{y(x)} =C1x+C2\displaystyle = C_1 x + C_2
Substituting y′′=0\Second{y''} = 0 into y′′+z′′=6x\Second{y''} + \Second{z''} = 6x uncouples the system to give
z′′\displaystyle \Second{z''} =6x\displaystyle = 6x
Integrating twice with respect to xx gives z′(x)=3x2+C3\Slope{z'(x)} = 3x^2 + C_3 and
z(x)\displaystyle \Path{z(x)} =x3+C3x+C4\displaystyle = x^3 + C_3 x + C_4
Applying the endpoint conditions at x=0x = 0 and x=1x = 1:
y(0)=1  ⟹  C2=1,y(1)=3  ⟹  C1+1=3  ⟹  C1=2z(0)=0  ⟹  C4=0,z(1)=2  ⟹  13+C3(1)=2  ⟹  C3=1\displaystyle \begin{aligned} \Path{y(0)} = 1 &\implies C_2 = 1, \\ \Path{y(1)} = 3 &\implies C_1 + 1 = 3 \\ &\implies C_1 = 2 \\ \Path{z(0)} = 0 &\implies C_4 = 0, \\ \Path{z(1)} = 2 &\implies 1^3 + C_3(1) = 2 \\ &\implies C_3 = 1 \end{aligned}
The stationary path is
y(x)\displaystyle \Path{y(x)} =2x+1,z(x)\displaystyle = 2x + 1, \qquad \Path{z(x)} =x3+x\displaystyle = x^3 + x