Dear MO world,

I'm teaching an undergraduate course on "fun with chaos". As part of a test (on bifurcations in differential equations), I asked students to sketch phase portraits for a family of (2d) differential equations. While preparing my solutions, I fed the differential equations (with one value of the parameter) into a phase portrait plotter on the web and found that there were families of closed curves as solutions, so that the system seemed to have a first integral. Changing the parameter, this persisted. I'm hoping someone can tell me why this should have been obvious to me!

The system was $$ \eqalign{\dot x&=y-x+1\cr \dot y&=y-rx^2.} $$

The phase portrait (with $r=0.15$) looks like this:

Some computation with mathematica reveals that $2rx^3+3y^2+6y-6xy$ is a first integral. The question is *why?* Is this an outrageous coincidence? (I thought that your chance of bumping into a conservative differential equation by accident were nil unless the system was of the form $\ddot x=f(x)$).

So: should I go and buy a lottery ticket, or is there some reason that this I shouldn't be surprised by this?