Solution (source code)

= Solution

Use the <gradient flow> of $-f$, namely $\dot{\boldsymbol r}=\nabla f$; any positive change of speed leaves the same trajectory. At the starting point,
$$
\nabla f(1,1)=\left(-\frac43,\frac23\right),
$$
so the path initially points up and left, with slope $dy/dx=-1/2$. At every regular point it crosses the <level sets> orthogonally, because the <gradient> is normal to the contours. Along it,
$$
\frac{df}{ds}=\nabla f\cdot\dot{\boldsymbol r}=|\nabla f|^2>0
$$
until a stationary point is approached.

The red curve in the plot first rises above $y=1$, then bends down towards the maximum $(0,1)$. It stays on the side $x>0$ and approaches the maximum without crossing it in finite gradient-flow time. Indeed $\dot x=-4x(1+y+y^2)/D^2$ preserves the sign of $x$, and the critical level increases from its starting value $0$ towards $1$. The requested curve is an ascending trajectory, not a contour or a straight segment joining the initial and final points.