I'm just starting partials and don't understand this at all. I'm told to hold $y$ "constant", so I treat $y$ like just some number and take the derivative of $\frac{1}{x}$, which I hope I'm correct in saying is $-\frac{1}{x^2}$, then multiply by $y$, getting $-\frac{y}{x^2}$.
But apparently the correct answer is $\frac{1}{x}$. What am I missing?
When you take the derivative of $\frac{y}{x}$ with respect to $y$ you are computing $\frac{\partial }{\partial y} \frac{y}{x} = \frac{1}{x}$ because here you are holding $x$ constant. If you take the derivative of the same expression with respect to $x$ then you compute $\frac{\partial}{\partial x} \frac{y}{x} = - \frac{y}{x^2}$ and this is when you hold $y$ constant.