Question:
Find $\frac{d y}{d x}$
$x y+y^{2}=\tan x+y$
Solution:
The given relationship is $x y+y^{2}=\tan x+y$
$\frac{d}{d x}\left(x y+y^{2}\right)=\frac{d}{d x}(\tan x+y)$
$\Rightarrow \frac{d}{d x}(x y)+\frac{d}{d x}\left(y^{2}\right)=\frac{d}{d x}(\tan x)+\frac{d y}{d x}$
$\Rightarrow\left[y \cdot \frac{d}{d x}(x)+x \cdot \frac{d y}{d x}\right]+2 y \frac{d y}{d x}=\sec ^{2} x+\frac{d y}{d x}$ [Using product rule and chain rule]
Differentiating this relationship with respect to $x$, we obtain
$\Rightarrow y \cdot 1+x \cdot \frac{d y}{d x}+2 y \frac{d y}{d x}=\sec ^{2} x+\frac{d y}{d x}$
$\Rightarrow(x+2 y-1) \frac{d y}{d x}=\sec ^{2} x-y$
$\therefore \frac{d y}{d x}=\frac{\sec ^{2} x-y}{(x+2 y-1)}$