Analytical mechanics with SR Is there an analytical mechanics with SR? Of course you can write down the Lagrangian and Hamiltonian of a free particle. What about non-free? Are there any problems? To be specific: what would the Lagrangian and Hamiltonian look like for a spherical pendulum considering SR?
 A: A Lagrangian can easily be written down for a relativistic particle in a curved spacetime (i.e., under the influence of gravity.)  Specifically, the "action" is the proper time between two events along a particle's world-line, and the particle's trajectory will extremize the proper time between these events: 
$$
S = \tau = \int \sqrt{ - g_{\mu \nu} dx^\mu dx^\nu } 
$$
Here, $s$ is a parameter along the particle's worldline, and $x^\mu$ are a set of spacetime coordinates.
In particular, if we want to look at a test particle moving in a weak gravitational field, then the metric is such that
$$
S = \int \sqrt{ \left( 1 + \frac{2 \Phi}{c^2} \right) dt^2 - \left( 1 - \frac{2 \Phi}{c^2} \right) d\vec{r}^2 } = \int \sqrt{ \left( 1 + \frac{2 \Phi}{c^2} \right) - \left( 1 - \frac{2 \Phi}{c^2} \right) \vec{v}^2 } dt
$$
where $\Phi (\vec{r})$ is the Newtonian gravitational potential and $\vec{v} = d\vec{r}/dt$ is the coordinate velocity of the particle.  Extremizing this integral over all paths $\vec{r}(t)$ will yield the equations of motion for the particle.1  You can also define a Hamiltonian from this "Lagrangian" (i.e., the integrand above) by taking a Legendre transform in the usual way.
Free bonus Lagrangian:  If you want to add a charge to your relativistic particle, you can do that too;  the Lagrangian becomes
$$
S = \int \sqrt{ - g_{\mu \nu} dx^\mu dx^\nu } + q \int A_\mu dx^\mu
$$
where $A_\mu$ is the relativistic four-vector potential.

1  This assumes that $t$ is a valid parameter for the particle's trajectory, which is true in the case of weak gravitational fields but may not be so in stronger gravitational fields (e.g., black holes.)
