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?

It is known as the quotient rule.  The more general derivative is given as:
$$\frac{d}{dx}\frac fg=\frac{f'g-fg'}{g^2}$$
Inputting $f=Q$ and $g=x$ gives
$$\frac{d}{dx}\frac Qx=\frac{Q'x-Qx'}{x^2}=\frac{x\left(\frac{dQ}{dx}\right)-Q\require{cancel}\cancel{\frac{dx}{dx}}}{x^2}$$
$$=\frac{x\left(\frac{dQ}{dx}\right)-Q}{x^2}$$
