Find $\frac{d y}{d x}$ :
$\sin ^{2} y+\cos x y=\pi$
The given relationship is $\sin ^{2} y+\cos x y=\pi$
Differentiating this relationship with respect to x, we obtain
$\frac{d}{d x}\left(\sin ^{2} y+\cos x y\right)=\frac{d}{d x}(\pi)$
$\Rightarrow \frac{d}{d x}\left(\sin ^{2} y\right)+\frac{d}{d x}(\cos x y)=0$ ...(1)
Using chain rule, we obtain
$\frac{d}{d x}\left(\sin ^{2} y\right)=2 \sin y \frac{d}{d x}(\sin y)=2 \sin y \cos y \frac{d y}{d x}$ ...(2)
$\frac{d}{d x}(\cos x y)=-\sin x y \frac{d}{d x}(x y)=-\sin x y\left[y \frac{d}{d x}(x)+x \frac{d y}{d x}\right]$
$=-\sin x y\left[y .1+x \frac{d y}{d x}\right]=-y \sin x y-x \sin x y \frac{d y}{d x}$ ...(3)
From (1), (2), and (3), we obtain
$2 \sin y \cos y \frac{d y}{d x}-y \sin x y-x \sin x y \frac{d y}{d x}=0$
$\Rightarrow(2 \sin y \cos y-x \sin x y) \frac{d y}{d x}=y \sin x y$
$\Rightarrow(\sin 2 y-x \sin x y) \frac{d y}{d x}=y \sin x y$
$\therefore \frac{d y}{d x}=\frac{y \sin x y}{\sin 2 y-x \sin x y}$