Energy function of pendulum Im following G.Teschl book for ODE and dynamical systems, and in problem 6.26 Im asked to find the energy function of the mathematical pendulum $\ddot x = -\mu \dot x - sin(x) $.
The book shows a standar(i guess) way to find an energy function, so I tried to emulate it as follows, 
We amplify $\ddot x = -\mu \dot x - sin(x)$ by $\dot x$ and we get $\ddot x \dot x= -\mu \dot x^{2} - sin(x)\dot x$ which can be writen as $\frac{d}{dt} \frac{{\dot x}^{2}}{2} = -\mu \dot x^{2} - sin(x)\dot x  $. Now we will call $- \dot U(x)=-\mu \dot x - sin(x)$, then, $\frac{d}{dt} \frac{{\dot x}^{2}}{2} = -\dot U(x) \dot x$ which leads us to $\frac{d}{dt} (\frac{{\dot x}^{2}}{2} + U(x))=0$. And this should represent the derivative of the energy function of the double pendulum. Now Im asked to show that the energy function could be used as a Liapunov function to prove stability of $(0,0)$ but I havent been able to do the last thing, I havent been able to solve it explicitly, so any help would be really appreciated.
Thanks so much guys <3 
 A: Your argument doesn’t make sense; the time derivative of $U(x)$ isn’t $\dot{U}(x)\dot{x}$ but rather $U’(x)\dot{x}$. The trouble then arises in defining $U’(x)=-\mu\dot{x}-\sin x$, because the right-hand side will depend on time.
What problem 6.26 is really asking is whether “the energy,” meaning the energy for the pendulum without friction (which is the sum of kinetic $\dot{x}^2/2$ and potential $U(x)$ where $U’(x)=\sin x$), is still conserved for the pendulum with friction. The answer is no, because taking the time derivative of the energy gives
$$\dot{T}+\dot{U}=\dot{x}\ddot{x}+\dot{x}\sin x=-\mu\dot{x}^2$$
which is always negative (because the problem specifies $\mu>0$). 
So “the energy” (meaning the energy for the pendulum without friction) is now strictly decreasing along trajectories, which makes sense: the pendulum dissipates energy as it moves toward the asymptotic equilibrium at the origin in phase space. Indeed, because the energy above is now strictly decreasing it can be used as a Liapunov function.
