Taking the derivative of an expression containing multivariate functions I'd like to take the derivative of
$$
\cfrac{x_1(p,w)/ x_2(p,w)}{p_1/p_2} = (p_1/p_2)^{\delta-2}
$$
I'm supposed to see that
$$
\cfrac{\text d [x_1(p,w)/ x_2(p,w)]}{\text d [p_1/p_2]} =
(\delta-1)(p_1/p_2)^{\delta-2}
$$
Note that $p = (p_1, p_2)$
I'm obviously not thinking right, but my thought was since we're taking $\text d[p_1/p_2]$ this would mean we could treat $p_1/p_2$ as though it were a single variable and differentiate like so...
$$
(\delta-2)(p_1/p_2)^{\delta-3}
$$
What's the correct way to approach this derivative? (I'm happy to number crunch. I'm not not sure where to start.)

Note that we are given
$$x_1(p_1,p_2,w)/x_2(p_1,p_2,w)=(p_1/p_2)^{\delta-1}\tag1$$
Inasmuch as the right-hand side of $(1)$ depends only on the ratio $p_1/p_2$, we can proceed to differentiate both sides by the variable $p_1/p_2$ and arrive at the coveted result
$$\frac{d(x_1/x_2)}{d(p_1/p_2)}=(\delta-1)(p_1/p_2)^{\delta-2}$$
And we are done!
Note that we could take a second derivative now with respect to $p_1/p_2$ to find
$$\frac{d^2(x_1/x_2)}{d(p_1/p_2)^2}=(\delta-1)(\delta-2)(p_1/p_2)^{\delta-3}$$
