Calculating the acceleration vector of elliptical curve. Satisfying Kepler's first law but not second. I am trying to solve problem 16 in section 1.6 of David Bressoud book Second Year Calculus. He gives a hint at the end of the book which says. If $r$ and $\theta$ are related by $\frac{r^2\cos^2(\theta)}{a^2}+\frac{r^2\sin^2(\theta)}{b^2}=1$ and if $r^2\frac{d\theta}{dt}=k$ then $\vec{a}=\frac{-rk}{a^2b^2}\vec{u_r}$. Where $\vec{u_r}$ and $\vec{u_\theta}$ are the local coordinates. He gives a formula for $\vec{a}$ earlier in the text as $\vec{a}=(\frac{d^2r}{dt^2}-r(\frac{d\theta}{dt})^2)\vec{u_r}+\frac{1}{r}\frac{d}{dt}(r^2\frac{d\theta}{dt})\vec{u_\theta}$. Specifically I need help calculating $\frac{d^2r}{dt}$ without the $\theta$ term. Also $k$ is a constant. My current calculation has lead to $\frac{d^2r}{dt^2}=\frac{k}{r}(\frac{1}{b^2}-\frac{1}{a^2})(\frac{k\cos(2\theta)}{r}+\frac{\sin(2\theta)}{2})$.

we have $\frac{r^2 \cos^2(\theta)}{a^2}+\frac{r^2 \sin^2 (\theta)}{b^2} = 1$
Differentiating this equation with respect to $t$, gives $$r^2\sin(2\theta)\frac{d\theta}{dt}\left(\frac{1}{b^2}-\frac{1}{a^2}\right)+2\frac{1}{r}\frac{dr}{dt}=0$$
Now replacing $\frac{d\theta}{dt} = \frac{k}{r^2}$, gives
$$\sin(2\theta)\left(\frac{1}{b^2}-\frac{1}{a^2}\right)+2\frac{1}{r}\frac{dr}{dt}=0$$
We need to find the derivative of $\sin 2\theta$ to progress. This equals $$2\frac{k}{r^2}\cos 2\theta$$
Now, $\cos 2\theta = 2\cos^2\theta -1$ and from the equation, using $\cos^2(\theta) + \sin^2 \theta = 1$, we have $$ \cos^2(\theta) = \left(\frac{1}{r^2} - \frac{1}{b^2}\right)\left(\frac{1}{a^2}-\frac{1}{b^2}\right)^{-1}$$ So $$\cos 2\theta = 2 \left(\frac{1}{r^2} - \frac{1}{b^2}\right)\left(\frac{1}{a^2}-\frac{1}{b^2}\right)^{-1} - 1$$
Now from before we have $$\frac{d}{dt}\left(\frac{1}{r}\frac{dr}{dt}\right) = \frac{k}{r^2}\cos 2\theta\left(\frac{1}{a^2}-\frac{1}{b^2}\right)$$
$$\frac{1}{r}\frac{d^2r}{dt^2}-\frac{1}{r^2}\left(\frac{dr}{dt}\right)^2 = \frac{k}{r^2}\cos 2\theta\left(\frac{1}{a^2}-\frac{1}{b^2}\right)$$
We already have an expression for $\left(\frac{dr}{dt}\right)^2$ in terms of $\sin^2 2 \theta = 1-\cos^2  2\theta$. So all that's left to do is to substitute in the expression for $\cos^2 2\theta$.
