TITLE: Proving $\ddot x = w-2x+x^2$, where $w\ge0$, conserves energy
QUESTION [5 upvotes]: Take $\ddot x = w-2x+x^2$, where $w\ge0$.
Show that the evolution of $x$ conserves a form of the energy and identify the potential function, sketching the phase portrait for $w=0$.
I am not too sure what is meant by the question. I know that to prove energy is conserved, you need to show that the derivative equals $0$. If we take $V = w-2x+x^2$, then $\dot V = -2\dot x+2x\dot x = 2\dot x(x-1) = 0$, but how do we prove this equals $0$, if this is what we need to show?
I also thought it may be helpful to rewrite the equation as the system:
$\dot x=y$, $\dot y = w-2x+x^2$, which would give $\dot V = 2y(x-1)$.
Any help would be hugely appreciated, thank you!

REPLY [11 votes]: In physics courses we tend to use the following trick: multiply $\ddot x = w-2x+x^2$ by $\dot x$ to obtain
$$ \dot x \ddot x = (w-2x+x^2)\dot x \ \ \Rightarrow \ \ \frac{d}{dt}\left( \frac{1}{2}\dot x^2 \right) = \frac{d}{dt} \left( wx-x^2+\frac{1}{3}x^3 \right)$$
Consequently,
$$ \frac{d}{dt}\left( \frac{1}{2}\dot x^2 - wx+x^2-\frac{1}{3}x^3 \right) = 0 $$
from which we find
$$ E = \frac{1}{2}\dot x^2 - wx+x^2-\frac{1}{3}x^3 $$
is a constant of the motion. Call it energy if you like.