If x = a cosθ and y = b sinθ , find second derivative

I'm guessing the second derivative is for y with respect to x, i.e.
[tex]\dfrac{\mathrm d^2y}{\mathrm dx^2}[/tex]
Compute the first derivative. By the chain rule,
[tex]\dfrac{\mathrm dy}{\mathrm dx}=\dfrac{\mathrm dy}{\mathrm d\theta}\dfrac{\mathrm d\theta}{\mathrm dx}=\dfrac{\frac{\mathrm dy}{\mathrm d\theta}}{\frac{\mathrm dx}{\mathrm d\theta}}[/tex]
We have
[tex]y=b\sin\theta\implies\dfrac{\mathrm dy}{\mathrm d\theta}=b\cos\theta[/tex]
[tex]x=a\cos\theta\implies\dfrac{\mathrm dx}{\mathrm d\theta}=-a\sin\theta[/tex]
and so
[tex]\dfrac{\mathrm dy}{\mathrm dx}=\dfrac{b\cos\theta}{-a\sin\theta}=-\dfrac ba\cot\theta[/tex]
Now compute the second derivative. Notice that [tex]\frac{\mathrm dy}{\mathrm dx}[/tex] is a function of [tex]\theta[/tex]; so denote it by [tex]f(\theta)[/tex]. Then
[tex]\dfrac{\mathrm d^2y}{\mathrm dx^2}=\dfrac{\mathrm df}{\mathrm dx}[/tex]
By the chain rule,
[tex]\dfrac{\mathrm d^2y}{\mathrm dx^2}=\dfrac{\mathrm df}{\mathrm d\theta}\dfrac{\mathrm d\theta}{\mathrm dx}=\dfrac{\frac{\mathrm df}{\mathrm d\theta}}{\frac{\mathrm dx}{\mathrm d\theta}}[/tex]
We have
[tex]f=-\dfrac ba\cot\theta\implies\dfrac{\mathrm df}{\mathrm d\theta}=\dfrac ba\csc^2\theta[/tex]
and so the second derivative is
[tex]\dfrac{\mathrm d^2y}{\mathrm dx^2}=\dfrac{\frac ba\csc^2\theta}{-a\sin\theta}=-\dfrac b{a^2}\csc^3\theta[/tex]