I would like to solve a problem, where I differentiate a function by a fraction, something like this:
$$\frac{\partial (x_1^\delta / x_2^\gamma)}{\partial (x_1/x_2)}$$
I was told that such a problem could be solved by a substitution: $z = x_1/x_2$, expressing problematic variables in terms of $z$ and then differentiating by $z$. Supposedly, this approach could function as a substitute to chain rule.
However, I stumbled upon few problems and decided to test it out. The new case I tried it on was the following:
$$\frac{\partial(x_1/x_2)^\gamma}{\partial(x_1/x_2)}$$
I know the solution of this problem:
$$\frac{\partial(x_1/x_2)^\gamma}{\partial(x_1/x_2)} = \gamma \left( \frac{x_1}{x_2} \right)^{\gamma-1}$$
Nevertheless, when I try to solve it by the substitution, the results differ:
$$ \frac{\partial \left( \frac{z \cdot x_2}{x_1/z} \right)^\gamma}{\partial z} = \frac{\partial(z x_2 x_1^{-1} z)^\gamma}{\partial z} = \frac{\partial(z^2 x_2 x_1^{-1} )^\gamma}{\partial z} = \gamma (z^2 x_2 x_1^{-1} )^{\gamma-1} x_2 x_1^{-1} 2 z$$
Substituting $z = x_1/x_2$ back I obtain the following:
$$\gamma \left(\frac{x_1}{x_2} \right)^{\gamma-1} \cdot2$$
As we can see, the results differ... Not substantially (only constant) but differ none the less...
The question:
- Did I do some mistake?
- Do I use this approach correctly?
- When this approach can be used and when it cannot be?