The equivalent problems are also found in Marion problem 7-22, and other formal classical mechanics textbook. Here what i want to know why instructor solution and some websites gives this kinds of approach.
A particle of mass m moves in one dimension under the influence of a force
\begin{align}
F(x,t) = -k x^{-2} exp(-t/τ)
\end{align}
where k and τ are positive constants.
what i want to do is compute its lagrangian.
\begin{align} & F(x,t) = - \frac{\partial U(x,t)}{\partial x}, \end{align}
First i know that this kinds of approach (The $F=-\nabla U$ is only holds for conservative forces, $i.e$, path-independent, position dependence potential), is vaild indeed
Many similar textbook, and their solution used above relation to rederive $U$, and compute $L$ and $H$.
I think their purpose is to show that even if $H$ is written as $H=T+U$, this $H$ is different from $E$. $i.e$, even though $H$ is written as $H=T+U$, since the force is depend on time explicitly, $H$ is no longer $E$.
I understand the procedure but not accept the first part. In general (?) i know that time dependent force is non-conservative force. Am i wrong? Does $F=-\frac{\partial U}{\partial x}$ kinds of thing always holds?
cf, from wiki
Mathematical description[edit] A force field F, defined everywhere in space (or within a simply-connected volume of space), is called a conservative force or conservative vector field if it meets any of these three equivalent conditions:
The curl of F is the zero vector: \begin{align} \nabla \times \vec{F} = \vec{0}. \, \end{align}
There is zero net work (W) done by the force when moving a particle through a trajectory that starts and ends in the same place:
\begin{align} W \equiv \oint_C \vec{F} \cdot \mathrm{d}\vec r = 0.\, \end{align}The force can be written as the negative gradient of a potential, \begin{align} \Phi: \vec{F} = -\nabla \Phi. \, \end{align}