# Conserved quantity for any motion in 1D

Newton's second law for a nonrelativistic particle of mass $$m$$ in 1D, reads, $$F \bigg(x, \frac{\mathrm{d}x}{\mathrm{d} t}, t \bigg)=m \frac{\mathrm{d}^2 x}{\mathrm{d} t^2}$$, where $$F$$ is the net force function. Now, if we assume that $$F$$ is time-independent and that $$v=\frac{\mathrm{d} x}{\mathrm{d} t}$$, can be written as a function of position $$x$$, $$v=v(x)$$, and using the chain rule we find the equation $$mv\frac{\mathrm{d} v}{\mathrm{d} x}=F(x,v).$$

After some manipulation, we arrive at the differential form $$mv\mathrm{d}v-F(x,v)\mathrm{d}x=0$$. In order for this differential form to be exact, it needs to satisfy the equation $$\frac{\partial}{\partial x} (mv)=-\frac{\partial F}{\partial v}=0$$, which shows that this differential can only be exact iff $$F$$ does not depend on velocity. In order to include forces that depend on velocity, one needs to multiply the differential from by an integrating factor $$\lambda=\lambda(x,v)$$, to obtain $$\lambda mv\mathrm{d}v-\lambda F(x,v)\mathrm{d}x=0$$. Let $$A$$ be the general conserved quantity for 1D motion. Then $$A$$ must satisfy $$\frac{\partial A}{\partial v}=\lambda mv, \frac{\partial A}{\partial x}=-\lambda F(x,v).$$

Now, here comes my question. How can one obtain an explicit formula for $$A$$ in terms of integrals of $$F$$ and $$mv$$. What will be in general the physical interpretation of $$A$$ and the integrating factor $$\lambda$$?

For what it's worth, one may show that a 2nd-order ODE $$\ddot{x}~=~f(x,\dot{x})$$ without explicit time-dependence, or equivalently, a pair of 1st-order ODEs of the form $$\dot{x}~=~v, \qquad \dot{v}~=~f(x,v),$$ always has a local Hamiltonian formulation, cf. e.g. this Phys.SE post. The Hamiltonian is a conserved quantity.