Solution (source code)

= Solution

For both parameters the <autonomous planar system> is $\dot x=v$, $\dot v=-x(x^2+\lambda x+1)$. It has the conserved <energy>
$$
H=\frac{v^2}{2}+V_\lambda(x),\qquad
V_\lambda(x)=\frac{x^4}{4}+\frac{\lambda x^3}{3}+\frac{x^2}{2}.
$$
Indeed $\dot H=v\dot v+V_\lambda'(x)\dot x=0$. At any <equilibrium point> $(x_*,0)$ the <eigenvalues> satisfy
$$
\mu^2=-V_\lambda''(x_*)=-(3x_*^2+2\lambda x_*+1).
$$

For $\lambda=1$, the quadratic $x^2+x+1$ is strictly positive, so the only <equilibrium point> is $(0,0)$, with <eigenvalues> $\pm i$. Since $V_1'(x)$ has the sign of $x$, $V_1$ has a unique strict minimum at zero and tends to infinity in both directions. All positive <energy> levels are closed curves surrounding this stable <center equilibrium>. They are clockwise: rightward when $v>0$ and leftward when $v<0$.

For $\lambda=5/2$, factor $x^2+(5/2)x+1=(x+2)(x+1/2)$. The three <equilibrium points> and their classifications are
$$
\boxed{\begin{array}{c|c|c}
(x_*,0)&\text{eigenvalues}&\text{type}\\\hline
(-2,0)&\pm i\sqrt3&\text{center}\\
(-1/2,0)&\pm\sqrt3/2&\text{saddle}\\
(0,0)&\pm i&\text{center}
\end{array}}
$$
The two <center equilibria> are stable but not asymptotically stable; the <saddle equilibrium> is unstable. At the <saddle equilibrium> the local unstable and stable directions are $v=(\sqrt3/2)(x+1/2)$ and $v=-(\sqrt3/2)(x+1/2)$.

The potential values are $V(-2)=-2/3$, $V(0)=0$, and $V(-1/2)=7/192$. Consequently there are closed loops around the left center for $-2/3<H<0$, closed loops in both wells for $0<H<7/192$, and a figure-eight pair of <homoclinic orbits> at $H=7/192$. At $H=0$ the right center is a stationary point while the left well still has a closed orbit. For $H>7/192$, each closed curve encircles both centers and the saddle.

The two <homoclinic orbits> satisfy $v=\pm\sqrt{2(7/192-V(x))}$. Their outer turning points can be located exactly from
$$
V(x)-\frac7{192}=\frac{(2x+1)^2(12x^2+28x-7)}{192},
\qquad
x_{\rm L,R}=\frac{-7\mp\sqrt{70}}6.
$$
Every nonstationary <energy> curve is oriented to the right in the upper half-plane and to the left in the lower half-plane. The sketches show the closed curves, the separating orbits, the stable and unstable saddle directions and the direction of flow.

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2004/ia/paper-2-phase-portraits.png]
{title=Clockwise phase flows, alternating pendulum saddles and centers, and the one-well and two-well quartic potentials}