I took the natural log of both sides, giving me $x^2y=\ln(\cos y)$.
Then I differentiated: $2xydx + (x^2)dy = (-\tan y)dy$
That turned into $\frac{dy}{dx} = \frac{2xy}{-\tan y-x^2}$
This was marked incorrect. I differentiated with another method and got the right answer. What did I do in this process that was illegal?
We have:
$e^{x^{2}y} = \cos(y)$
$x^{2}y = \ln(\cos(y))$
Implicitly differentiating:
$2xy + x^{2}y' = \frac{d}{dx}(\cos(y))\frac{1}{\cos(y)}$
$2xy + x^{2}y' = -\frac{y'\sin(y)}{\cos(y)}$
$2xy = y'(-\tan(y)-x^{2})$
$y' = -\frac{2xy}{\tan(y)+x^{2}}$
To be safe, you should use derivative notation instead of differentials because differentials aren't exactly "formal".