Why does this derivative equation hold? $$\frac{d(Q/x)}{dx} = \frac{x(\frac{dQ}{dx})-Q(\frac{dx}{dx})}{x^2}$$
Assume $Q$ is a function of $x$. This equation is in my microeconomics textbook, but I don't know how we can get from the left-hand side to the right-hand side. Can someone please explain?

According to the product rule:
$$\frac{d(Q/x)}{dx} = \frac{d(Q\cdot 1/x)}{dx} = \frac{dQ}{dx}\cdot1/x + Q\cdot\frac{d(1/x)}{dx} = \frac{\frac{dQ}{dx}}{x} - \frac{Q}{x^2} = \frac{x(\frac{dQ}{dx})-Q(\frac{dx}{dx})}{x^2}$$
