Solution (source code)

= Solution

Choose the common initial longitude of the particle and $G$ as zero. Let the fixed inertial <longitude of periapsis> be $\varpi$, positive ahead of that ray. At release $f_0=-\varpi$, but the <mean anomaly> is
$$
M_0=f_0-2e\sin f_0+O(e^2)=-\varpi+2e\sin\varpi+O(e^2).
$$
Thereafter $M(t)=nt+M_0$, $f(t)=M(t)+2e\sin M(t)+O(e^2)$, and the particle's longitude is $\lambda(t)=\varpi+f(t)$. The reference ray has longitude $\lambda_G=n_gt$.

In the <rotating reference frame>, the radial $x$ axis points outward along the star-$G$ ray and the $y$ axis points forward. Define $\delta\lambda=\lambda-\lambda_G$. The exact positional relations are
$$
\boxed{x=r\cos\delta\lambda-a_g,\qquad y=r\sin\delta\lambda.}
$$

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2018/iii/paper-316-rotating-frame.png]
{title=Orbital angles and a <rotating reference frame>}
{description=The stellar radius to G defines the rotating radial axis; the particle is separated from it by delta lambda. The pericentre direction is fixed in the inertial frame. The mean anomaly advances uniformly, while the true anomaly is measured from pericentre to the particle.}

The diagram shows a later instant; initially $\delta\lambda=0$, so $y(0)=0$. Retaining the $O(e)$ correction in $M_0$ is what will preserve that initial condition in the approximate trajectory.