Solution verification: Given that $x=\cos \theta$ I want to find $\frac{d^2y}{dx^2}$ in terms of $\frac{dy}{d\theta}$ Given that $x=\cos \theta$ I want to find $\frac{d^2y}{dx^2}$ in terms of $\frac{dy}{d\theta}$. 
My work $\frac{dx}{dy}=-\sin {\theta} \frac{d\theta}{dy}$, rearanging gives $\frac{dy}{dx}=\frac{dy}{d\theta}\frac{1}{-\sin{\theta}}$. Differentiating again with respect to x gives
$\frac{d^2y}{dx^2}=\frac{d^2y}{d\theta^2}\frac{dy}{dx}\frac{1}{-\sin\theta}+\frac{dy}{d\theta}\frac{\cos\theta}{\sin^2\theta}\frac{d\theta}{dx}=\frac{d^2y}{d\theta^2}(\frac{dy}{d\theta}\frac{1}{-\sin\theta})\frac{1}{-\sin\theta}+-\frac{dy}{d\theta}\frac{\cos\theta}{\sin^3\theta}=\frac{d^2y}{d\theta^2}\frac{dy}{d\theta}\frac{1}{\sin^2\theta}-\frac{dy}{d\theta}\frac{\cos\theta}{\sin^3\theta}$. However, when I checked the answer on the student room it did not contain  $\frac{dy}{d\theta}$ in the $\frac{d^2y}{d\theta^2}\frac{dy}{d\theta}\frac{1}{\sin^2\theta}$ bit. The way I get it is just by directly substitution what I have for $\frac{dy}{dx}$ in the previous part. Could someone explain to me why this is wrong?

$\frac {dy}{dx} = \frac {dy}{d\theta}\frac {d\theta}{dx}\\
\frac {d}{dx} \frac {dy}{dx} = \frac {d}{dx}(\frac {dy}{d\theta}) \frac {d\theta}{dx} + \frac {dy}{d\theta}\frac {d}{dx}\frac {d\theta}{dx}\\
\frac {d^2y}{dx^2} = (\frac {d^2y}{d\theta^2}\frac {d\theta}{dx}) \frac {d\theta}{dx} + \frac {dy}{d\theta}(\frac {d^2\theta}{dx^2})\\
\frac {d^2y}{dx^2} = \frac {d^2y}{d\theta^2}(\frac {d\theta}{dx})^2 + \frac {dy}{d\theta}\frac {d^2\theta}{dx^2}\\
$
$\frac {d\theta}{dx} = -\frac {1}{\sqrt{1-x^2}}\\
\frac {d^2\theta}{dx^2} = -\frac {x}{(1-x^2)^\frac 32}$
$\frac {d^2y}{dx^2} = \frac {d^2y}{d\theta^2}\left(\frac {1}{1-x^2}\right) - \frac {dy}{d\theta}\left(\frac {x}{(1-x^2)^{\frac 32}}\right)$
Or
$\frac {dx}{d\theta} = -\sin\theta\\
\frac {d\theta}{dx} = -\csc\theta\\
\frac {d}{dx}\frac {d\theta}{dx} = \frac {d}{d\theta}(-\csc\theta\frac) {d\theta}{dx}\\
\frac {d}{dx}\frac {d\theta}{dx} = -\csc^2\theta\cot\theta\\
\frac {d^2y}{dx^2} = \frac {d^2y}{d\theta^2}\csc^2\theta - \frac {dy}{d\theta}\csc^2\theta\cot\theta$
