# Find Hamiltonian given Force

## Homework Statement

A particle with mass, m, is subject to an attractive force.
\begin{equation}
\vec{F}(r,t) = \hat{e}_r \frac{k}{r^2}e^{-\beta t}
\end{equation}

Find the Hamitonian of the particle

## Homework Equations

H = T + U
Where T is the kinetic energy and U is the potential
\begin{equation}
H = p_i \dot{q}_i - L
\end{equation}

## The Attempt at a Solution

\begin{equation}
\begin{split}
F - \nabla (U) \\
F_r = \frac{\partial U}{\partial r} \\
U (r) = \int F(r) dr \\
U(r) = ke^{-\beta t} \int \frac{1}{r^2} dr \\
U(r) = - \frac{ke^{-\beta t}}{r}
\end{split}
\end{equation}
\begin{equation}
L = \frac{d}{dt}(\frac{\partial L)}{\partial \dot{r}} - \frac{\partial L}{\partial r} = m \ddot{r} - 2r\dot{\phi}^2 + \frac{\partial U}{\partial r}
\end{equation}
\begin{equation}
T = \frac{1}{2}m(\dot{r}^2 + r^2\dot{\phi}^2)
\end{equation}
Given the following:
\begin{equation}
\begin{split}
p_r = \frac{\partial T}{\partial \dot{r}} = m\dot{r} \\
p_\phi = \frac{\partial T}{\partial \dot{\phi}} = mr^2\dot{\phi}
\end{split}
\end{equation}

Thus,
\begin{equation}
\begin{split}
H = T + U \\
H = \frac{1}{2m} (p_r^2+\frac{p_\phi}{r^2}) + U(r) \\
\end{split}
\end{equation}
Therefore having
\begin{equation}
H = \frac{1}{2m} [(m\dot{r})^2 + m^2r^2\dot{\phi}^2] + (- \frac{ke^{-\beta t}}{r})
\end{equation}

Is my method correct so far? If so, how do I continue?

And to find the total energy, I just add T + U, right?

\begin{equation}
\frac{1}{2}m(\dot{r}^2 + r^2\dot{\phi}^2) + (- \frac{ke^{-\beta t}}{r})
\end{equation}