The derivative of a function of a variable with respect to a function of the same variable I have a function $f(x)$ defined as follows:
$$
f(x)=\frac{1-g(x)}{1-xg(x)}.
$$
Because $f$ contains the function $g(x)$, I guess you could say $f$ is a function of $g(x)$ and $x$.
Given this, a mathematician says
$$
\frac{\partial}{\partial x}f=\frac{\partial f}{\partial g}\frac{\partial g}{\partial x} + \frac{\partial f}{\partial x}.
$$
I'm not following his reasoning.  For one, I would have thought that $\frac{\partial}{\partial x}f=\frac{\partial f}{\partial x}$.  So I'm not sure how that other term is fitting in here.
Can anyone explain this?
 A: Assume that your $f$ depends as 
$$f=f(x,g)=\dfrac{1-g}{1-xg}.$$
Now, by use of chain's rule of vector analysis, we compute 
:
$$\dfrac{df}{dt}
=
\dfrac{\partial f}{\partial x}\dfrac{dx}{dt}+\dfrac{\partial f}{\partial g}\dfrac{dg}{dt},$$
and this is for any parameter $t$.
But if we take $t=x$ we get
$$\dfrac{df}{dx}
=
\dfrac{\partial f}{\partial x}+\dfrac{\partial f}{\partial g}\dfrac{dg}{dx},\qquad (*)$$
Now, the partial derivatives of $f$ are
$$\dfrac{\partial f}{\partial x}=\dfrac{-(1-g)(-g)}{(1-xg)^2}=\dfrac{(1-g)g}{(1-xg)^2}$$
and 
$$\dfrac{\partial f}{\partial g}
=\dfrac{-(1-xg)-(1-g)(-x)}{(1-xg)^2}
=\dfrac{x-1}{(1-xg)^2},$$
then, 
by subbing them into $(*)$, we receive:
$$\dfrac{df}{dx}
=
\dfrac{(1-g)g}{(1-xg)^2}
+
\dfrac{x-1}{(1-xg)^2}
\dfrac{dg}{dx}.\qquad (1)
$$

Also there is an alternative anyone can do.
If $f(x)=\dfrac{1-g(x)}{1-xg(x)}$ then
$$f'(x)=\dfrac{d}{dx}\left(\dfrac{1-g(x)}{1-xg(x)}\right),$$ 
which can be developed employing elementary derivative's properties.
The result would be
$$\dfrac{df}{dx}=\dfrac{(1-g)g+(x-1)g'}{(1-xg)^2}.\qquad (2)$$ 

Both $(1)$ and $(2)$ coincide.
