Solution (source code)

= Solution

<Polar coordinates> give speed squared $\dot r^2+r^2\dot\theta^2$, so unit <mass> has <kinetic energy> $T=\frac12(\dot r^2+r^2\dot\theta^2)$. The radial <force> is $-1/r^2=-V'(r)$, giving $V=-1/r$ after choosing the additive constant zero. Therefore $L=T-V$ is the stated expression.

The two <Euler-Lagrange equations> are
$$
\boxed{\ddot r-r\dot\theta^2=-\frac1{r^2},\qquad\frac d{dt}(r^2\dot\theta)=0.}
$$
The second gives <conservation of angular momentum> $\ell=r^2\dot\theta$. The <mechanical energy> is
$$
\boxed{E=\frac12(\dot r^2+r^2\dot\theta^2)-\frac1r.}
$$
Direct differentiation expresses its derivative as
$$
\dot E=\dot r\left(\ddot r-r\dot\theta^2+\frac1{r^2}\right)+\dot\theta\frac d{dt}(r^2\dot\theta)=0.
$$
Thus <energy> is conserved for the motion wherever $r>0$.