Differentiating a g(x) with respect to a function f(x) Suppose I have 
$$g(x)=\frac{1}{x(f(x))}$$
What is $d g(x)/ d f(x)$?
I know that for some function $h(f(x)),$ we have that $$\frac{d h(x)}{d f(x)}=\frac{h'(x)}{f'(x)}$$
By this rule, the derivative of $g(x)$ is
$$\frac{-xf'(x)+f(x)}{x^2f(x)}*\frac{1}{f'(x)}$$
Is this correct?
 A: I'm interpreting the term '$x(f(x))$' in the denominator of $g$ as a product, so
$$ 
 g(x) = \frac{1}{x} \frac{1}{f(x)}.
$$
In that case, you can write $g(x) = G(x,f(x))$ with $G(w,z) = \frac{1}{w}\frac{1}{z}$. It's somewhat unclear what you mean with '$d g(x)/d f(x)$', but the most straightforward way to interpret this is that you want to know how $g$ varies if you vary $f(x)$, while leaving $x$ fixed. This is equivalent to taking the partial derivative of $G$ with respect to its second variable $z$, which yields
$$
\frac{\partial G}{\partial z}(w,z) = -\frac{1}{w} \frac{1}{z^2}
$$
Then, replacing $w$ by $x$ and $z$ by $f(x)$, we get
$$
'd g(x)/d f(x)' = \frac{\partial G}{\partial z}(x,f(x)) = \frac{-1}{x} \frac{1}{(f(x))^2}.
$$
Note that if you interpret the term '$x ( f(x))$' in the denominator of $g$ as a composition of the functions $x \to f(x)$ and $f(x) \to x$, you find that (under certain regularity assumptions for $f$), that the composition $x (f (x))$ is just equal to $x$ itself: first, you send $x$ to $f(x)$, and then send $f(x)$ back to $x$ again. In that case, '$x(f(x))$' is just a complicated way of writing '$x$'. I assume that this isn't how I should interpret the brackets.
Edit: Another interpretation is the following. You introduce a change of coordinates (or variable substitution); instead of considering $g$ as a function of $x$, you consider it as a function of the new coordinate '$f$'. This means that $x$ becomes a function of $f$, so $g$ is written as follows:
$$
g(x(f)) = \frac{1}{x(f)} \frac{1}{f}.
$$
Here, I used that $x(f)$ is the inverse of $f(x)$, so that $f(x(f)) = f$. Note that this inverse only exists locally, but the interval of definition usually becomes apparent by looking at which points denominators become zero.
Anyway, by the chain rule, we have
$$
\frac{\text{d}}{\text{d} f}\Big(g(x(f))\Big) = \frac{\text{d} g}{\text{d} x}(x(f))\,\frac{\text{d} x}{\text{d} f}(f).
$$
Now, we can calculate
$$
 \frac{\text{d} g}{\text{d} x}(x) = -\frac{1}{x^2} \frac{1}{f(x)} - \frac{1}{x} \frac{1}{f(x)^2} \frac{\text{d} f}{\text{d} x}(x).
$$
Evaluating $\frac{\text{d} g}{\text{d} x}$ at the new coordinate $f$ is the same as substituting $x(f)$ for $x$. As mentioned before, this means that $f(x)$ is replaced by $f$. What about $\frac{\text{d} f}{\text{d} x}$ evaluated at $x(f)$? Here, you can use that 'the derivative of the inverse is the inverse of the derivative', in other words
$$
\frac{\text{d} f}{\text{d} x}(x(f)) = \left(\frac{\text{d} x}{\text{d} f}(f)\right)^{-1}.
$$
Hence,
$$
 \frac{\text{d} g}{\text{d} x}(x(f)) = -\frac{1}{x(f)^2} \frac{1}{f} - \frac{1}{x(f)} \frac{1}{f^2} \left(\frac{\text{d} x}{\text{d} f}(f)\right)^{-1},
$$
so we get
$$
\frac{\text{d}}{\text{d} f}\Big(g(x(f))\Big) = -\frac{1}{x(f)^2} \frac{1}{f} \frac{\text{d} x}{\text{d} f}(f) - \frac{1}{x(f)} \frac{1}{f^2}.
$$
A: $$g'_f=\frac{dg}{df}=\frac{dg}{dx}\frac{dx}{df}=\frac{g'_x}{f'_x}=-\frac {(xf'+f)}{x^2f^2f'}$$
The rule is for $g'_x$:
$$(\frac 1 h)'=\frac {-h'}{h^2}$$
Consider $h=xf$
$$g'(x)=(\frac 1 {xf})'=-\frac {(xf)'} {(xf)^2}=-\frac {(xf'+f)}{x^2f^2}$$
A: $$\frac{dg}{df}=\frac{\dfrac{dg}{dx}}{\dfrac{df}{dx}}=\frac{-\dfrac1{x^2f}-\dfrac {f'}{xf^2}}{f'}=-\frac1{x^2ff'}-\frac1{xf^2}.$$
