37
$\begingroup$

I want to calculate the derivative of a function with respect to, not a variable, but respect to another function. For example: $$g(x)=2f(x)+x+\log[f(x)]$$ I want to compute $$\frac{\mathrm dg(x)}{\mathrm df(x)}$$ Can I treat $f(x)$ as a variable and derive "blindly"? If so, I would get $$\frac{\mathrm dg(x)}{\mathrm df(x)}=2+\frac{1}{f(x)}$$ and treat the simple $x$ as a parameter which derivative is zero. Or I should consider other derivation rules?

$\endgroup$
2
  • 1
    $\begingroup$ This is a good question because it appears a lot, but for future people: This notation or question makes no sense. $g$ is a function with it's own domain and range. You can only take derivatives of $g$ with respect to it's domain. That's it. By writing $\frac{d}{df(x)}$ you are taking derivatives over what set? This notation has to mean that you are taking derivatives over the range set of $f$. Therefore this derivative, $\frac{d}{df(x)}$ only applies to functions whose domain set is this range set of $f$. $g$ is defined over the set $X$. $f$ is defined over the set $X$. You cannot apply $\endgroup$
    – DWade64
    Oct 19, 2018 at 13:51
  • $\begingroup$ $\frac{d}{df(x)}$ to either of these functions! You can apply $\frac{d}{df(x)}$ to the inverse function of $f$, which is $f^{-1}$, because this function has the correct domain that the derivative is referring to. You can also apply $\frac{d}{df(x)}$ to the composition function $g \circ f^{-1}$, because this function also has the correct domain that the derivative is referring to. The answer given to this question is the chain rule applied to this composite function (you apply the chain rule to composite functions) $\endgroup$
    – DWade64
    Oct 19, 2018 at 13:54

3 Answers 3

41
$\begingroup$

$$\frac{dg(x)}{df(x)} = \frac{dg(x)}{dx} \cdot \frac{1}{f'(x)} = \frac{g'(x)}{f'(x)}$$

In your example,

$$g'(x) = 2f'(x) + 1 + \frac{f'(x)}{f(x)}$$

So:

$$\frac{dg(x)}{df(x)} = \frac{2f'(x) + 1 + \frac{f'(x)}{f(x)}}{f'(x)} = 2 + \frac{1}{f'(x)} + \frac{1}{f(x)}$$

$\endgroup$
13
  • 2
    $\begingroup$ Thanks, can you give me the name of the theorem for this property? Or a link so I can take a look to the proof? $\endgroup$
    – Marco
    Oct 2, 2014 at 13:29
  • 11
    $\begingroup$ It's all Chain Rule. It's easier to see in Leibniz notation. $\displaystyle \frac{dg}{df} = \frac{dg}{dx}\cdot \frac{dx}{df} = \frac{\frac{dg}{dx}}{\frac{df}{dx}}=\frac{g'(x)}{f'(x)}$. The other application of Chain Rule in differentiating $\ln f(x)$ should be quite obvious. $\endgroup$
    – Deepak
    Oct 2, 2014 at 14:39
  • 1
    $\begingroup$ What happens in the case $f(x) = 0$? Does the derivative simply not exist? My guess would be that the conclusion $\dfrac{dx}{df} = \dfrac{df}{dx}$ would be wrong here and thus the whole thing reduces to $2 + \dfrac{1}{f}$ $\endgroup$ Jan 20, 2016 at 17:08
  • 2
    $\begingroup$ If $f(x)$ is identically zero over the domain, then $\frac{dg}{df}$ would not exist. In fact, even if $f(x)$ is a constant non-zero function, $\frac{dg}{df}$ would not exist because $f'(x) = 0$ (identically). If either $f(x)$ or $f'(x)$ (or both) are zero at a particular point $x_0$ then $\frac{dg}{df}$ would not exist at that point $x_0$. Also, what you wrote ($\frac{dx}{df} = \frac{df}{dx}$) is wrong in any case. The right hand side is the reciprocal of the left hand side, i.e. $\frac{dx}{df} = \frac{1}{\frac{df}{dx}}$ $\endgroup$
    – Deepak
    Jan 20, 2016 at 22:54
  • 1
    $\begingroup$ @iwantmyphd No. You can apply quotient and chain rules to determine this.$$\frac{d^2g(x)}{d^2f(x)} = \frac{d}{df(x)}(\frac{dg(x)}{df(x)})= \frac{\frac{d}{dx}(\frac{g'(x)}{f'(x)})}{f'(x)} = \frac{f'(x)g''(x) - g'(x)f''(x)}{(f'(x))^3}$$ after simplification. $\endgroup$
    – Deepak
    Sep 23, 2018 at 3:44
2
$\begingroup$

You can not. You have to derivate $f(x)$ as function.

$g'(x) = 2f'(x) + 1 + {f'(x) \over f(x)}$

EDIT: Sorry, That would make $dg(x) \over dx$, Deepak is right.

$\endgroup$
1
$\begingroup$

You could if it were a function of $f(x)$ But it's not, due to the $x$ term.

$\endgroup$
1
  • $\begingroup$ So, is it true that the derivative of $g(x)=2f(x)+\log[f(x)]$ wrt $f(x)$ is equal to : $\frac{\mathrm dg(x)}{\mathrm df(x)}=2+\frac{1}{f(x)}$ ? Applying @deepak definition it seems so. $\endgroup$
    – desmond13
    Feb 15, 2018 at 10:20

Not the answer you're looking for? Browse other questions tagged .