How to derive a differential equation of an ellipse
The equation $$ \frac{x^2}{a^2}+\frac{y^2}{b^2}=1 \tag{1}$$ has two variables: $\{ x, y \}.$ By "derive," it seems that you mean $ \frac{dx}{dy}.$
Well, differentiating equation $(1)$ w.r.t $y,$ we get: $$ \frac{d}{dy} \frac{x^2}{a^2} + \frac{d}{dy} \frac{y^2}{b^2} = \frac{d}{dy} 1 \tag{2}$$
First, note that $\dfrac{d}{dy} 1 = 0,$ $\dfrac{d}{dy} y = 1,$ and $\dfrac{d}{dy} f^2 = 2 f \dfrac{df}{dy}.$
So
$ \dfrac{d}{dy} \dfrac{x^2}{a^2} = 2 \dfrac{x^{2-1}}{a^2} \dfrac{dx}{dy}$
$ \dfrac{d}{dy} \dfrac{y^2}{b^2} = 2 \dfrac{y^{2-1}}{b^2} \dfrac{dy}{dy} $
In other words, equation $(2)$ becomes:
$$ 2\frac{x}{a^2} \frac{dx}{dy} + 2 \frac{y}{b^2} = 0. $$
The rest is simple algebra, you can isolate $\dfrac{dx}{dy}$ one side, and get: $$ -\frac{dx}{dy} = \frac{a^2}{b^2} \frac{y}{x} $$