In introductory general relativity courses, free particle trajectories, such as astronomical orbits, are generally developed via a Lagrangian and variational calculus, so that physical examples can precede the mathematics of tensor calculus. The use of a Hamiltonian is viewed as more advanced and typically comes later if at all. We suggest here that this might not be the optimal order in a first course in general relativity, especially if orbits are to be solved with numerical methods. We discuss some of the issues that arise in both the Lagrangian and Hamiltonian approaches.

1.
O.
James
,
E.
von Tunzelmann
,
P.
Franklin
, and
K. S.
Thorne
, “
Visualizing interstellar's wormhole
,”
Am. J. Phys.
83
(
6
),
486
499
(
2015
).
2.
C. W.
Misner
,
K. S.
Thorne
, and
J. A.
Wheeler
,
Gravitation
(
W. H. Freeman
,
San Francisco
,
1973
); reprinted by Princeton University Press, 2017.
3.

The factor of 1/2 is included so that the quantities $∂L/∂ẋμ$ agree with the usual meaning of the component Pμ of the 4-momentum.

4.

It can be argued (quite correctly) that the right form of the Lagrangian should be the square root of the negative of the expression in Eq. (1). In the interest of simplicity we are cutting a corner here. It can be shown without too much difficulty that either form of the Lagrangian gives the same equations of motion if the Lagrangian itself has a constant value for the solution. In the case of an affine parameter, which is the case that we consider, the Lagrangian is a constant for the solution curve.

5.

For the wormhole of Ref. 1 the radial coordinate is , not r.

6.

When we add the information that the Lagrangian is constant, we are actually modifying the problem. Without this the curve parameter λ is unconstrained; when we specify that the Lagrangian we are constraining λ to be an affine parameter.

7.

The integral can be evaluated with good accuracy through the use of Gauss-Chebyshev integration, but this is not familiar to most undergraduates and has no real advantage over the substitution presented here.

8.
The “constant of motion” L2 is a true integral of motion, so relativistic orbits in a spherical spacetime have a full complement—four—of first integrals. Interestingly, L2 can be generalized to “the Carter constant,” for the Kerr geometry, which is not spherically symmetric. See
B.
Carter
, “
Global structure of the Kerr family of gravitational fields
,”
Phys. Rev.
174
(
5
),
1559
1571
(
1968
); Ref. 2, Sec. 33.5.
9.

With modern symbolic manipulation packages this effort is much easier than it had formerly been, adding another consideration in favor of the Hamiltonian approach.