You are on page 1of 5

Shortest path between two points

Polar coordinates

Before we start, lets rst derive the formula for the path length of an arbitrary path in polar coordinates. Consider two nearby points on a path at coordinates (r, ) and (r +dr, +d). The distance between these two points is dr2 + r2 d2 . If we parametrize the path by specifying as a function of r, the path length S , can then be written as:
2

S=
1

r2 +

dr d

(1)

Note that when we ask for the minimum path length we need to specify r at 1 and 2 and ask which path which has these xed end points is the shortest. If we instead parametrize the path by specifying r as a function of , then we can write: 2 r2 d S= 1 + r2 dr (2) dr r1 And when we minimize this, we need to specify at the two end points at r1 and r2 . Since we already know that the solution is a straight line, lets nd out how a straight line looks like in polar coordinates. For a given line, there will be a point on that line that is closest to the origin. Lets call this point P . So, at the point P , r is minimal, say r = r0 and will have some value 0 . Because r is minimal on the line at P , the line must be at right angles to the line connecting P to the Origin at r = 0. For some arbitrary point Q on the line, consider the right triangle formed by the Origin, the point P and the point Q. If the point has coordinates (r, ), then: cos( 0 ) = r0 r (3)

From the equations (1) and (2), you see that we are dealing with a problem of the type in which we have to extremize S where:
t2

S=
t1

L(x(t) , x (t) , t) dt

(4)

over all possible paths x(t) for which the end points are kept xed (t is theta and x is r or vice versa). We have used the notation x = dx dt . In the next section we will derive the dierential equation that such a path has to satisfy. It turns out that classical mechanics can also be formulated in this way, by 1

taking L, the so-called Lagrangian, to be the dierence of the kinetic and the potential energy and t the time. For complicated problems in classical physics this is a convenient formalism. Since simple problems with only one variable (note that of the two variables, one is the integration variable and plays the role of time in classical mechanics, so you have only one dynamical variable) can also be solved using conservation of energy, you can imagine that it might be possible to translate simple variational problems like this into an almost trivial conservation of energy equation, with an appropriate denition of energy. Ill show how that can be done for this problem in section 3

Derivation using the Lagrangian


t2

Consider the quantity S : S=


t1

L(x(t) , x (t) , t) dt

(5)

which in our problem is the path length and in classical mechanics is called the action. We now want to reason as follows. If S is minimal for some path then it shouldnt change to rst order if we perturb that path. So, lets look at how the value of S changes if we perturb the path by a small amount: x(t) x(t) + (t) This perturbation also induces a perturbation in x : x(t) x(t) + (t) Inserting (6) and (7) in (5) and expanding to rst order in gives:
t2 t2

(6)

(7)

S=
t1

dtL(x, x, t) +
t1

dt

L L + x x

(8)

Here we have suppressed the arguments of the functions x, and there derivatives w.r.t. t. We can rewrite the last term involving using partial integration as follows: t2 t2 L d L dt = dt (9) x dt x t1 t1 Here we have used that the perturbation must be such that (t1 ) = (t2 ) = 0, because we are considering paths with xed end points. The change in S to rst order in is thus given by:
t1

S =
t0

dt

L d L (t) x dt x

(10)

Since (t) can be an arbitrary function except at the end points where it has to be zero, we can take it to be almost zero everywhere except at some arbitrary point. So, if we demand that S be zero under all such possible perturbations to rst order, then the integrand itself must be zero. This means that we must demand that: d L L =0 (11) dt x x 2

Lets apply this equation to the Lagrangian in the integrand of Eq. (2): L= 1 + r2 d dr
2

(12)

where r is to be interpreted as our t variable and is the x variable. Since L = d and on r, Eq. (11) yields: does not explicitly depend on , but only on dr d L =0 dr This means that L =c (13)

(14)

you for some constant c. If you work out the partial derivative and solve for nd that: d c (15) = 2 dr r r c2 This implies: =c Finally substitute r = = c
c u

dr 1 r r2 c2

(16)

in here to obtain: 1
c2 u2

du u

c2

du = arccos(u) + k 1 u2
c r

(17)

where k is an integration constant. Since u = cos((r) k ) =

this implies: (18)

c r

which is exactly the general equation of a straight line in polar coordinates, see Eq. (3).

Derivation using the Hamiltonian

In classical mechanics the Hamiltonian is the total energy function. It can be derived in a general setting where problems are formulated in general coordinates from the Lagrangian. An important property of the Hamiltonian is that it is conserved as a function of t if the Lagrangian L does not depend on t. All this can be derived from the Euler-Lagrange equation (11), so for variational problems one can also write down a Hamiltonian. The Hamiltonian is dened as: H = px L where (19)

L (20) x is called the conjugate momentum of the variable x. If L does not explicitly depend on x then the Euler-Lagrange equations (11) imply that it is conserved p= 3

as a function of t, as happened in our case for the Lagrangian (12). Lets work out the dierential dH : dH = d(px L) = xdp + pdx L L L dx dx dt x x t
L x ).

(21)

The second term cancels against the third term (using p = dH = xdp L L dx dt x t

So, we have: (22)

From the Euler-Lagrange equations (11) it follows that L , so we can write x = p this as: L dt (23) dH = xdp pdx t Considering H as a function of x, p and t, we can also write down the formal relation: H H H dH = dp + dx + dt (24) p x t where the derivative w.r.t. x is at constant p and vice versa. Comparing (23) with (24) yields: dx H = dt p H dp = dt x L H = t t

(25)

These are the Hamilton equations. It follows form this that the total time derivative of the Hamiltonian is: dH H dx H dp H L = + + = dt x dt p dt t t (26)

So, we nd the important result that the Hamiltonian is conserved as a function of t if the Lagrangian does not depend on t. We can apply this result to our problem by taking the Lagrangian to be the integrand of (1): L= The conjugate momentum is: p= and the Hamiltonian is thus: H = pr L= r 2 r2 + r 2 r2 + r 2 = r2 r2 + r 2 (29) r L = r r2 + r 2 (28) r2 + dr d
2

(27)

H is conserved because L does not depend on which plays the role of the t variable. If you equate the expression for H to a constant and solve the 4

dierential equation you can easily derive the same result as in the previous section. If you try to solve the Euler-Lagrange equation (11) for this Lagrangian, then thats much more tedious. So, weve basically saved a lot of work in the previous section by using conservation of momentum and for this Lagrangian you can also arrive quickly at the solution by using conservation of energy. For this Lagrangian, momentum is not conserved, while in the Lagrangian we used in the previous section, energy is not conserved.

You might also like