By Marco


2014-10-01 15:03:30 8 Comments

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?

3 comments

@Orest Bucicovschi 2014-10-01 15:43:36

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

@kalmanIsAGameChanger 2018-02-15 10:20:08

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.

@Deepak 2014-10-01 15:09:54

$$\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)}$$

@Marco 2014-10-02 13:29:40

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?

@Deepak 2014-10-02 14:39:52

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.

@WorldSEnder 2016-01-20 17:08:15

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}$

@Deepak 2016-01-20 22:54:18

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}}$

@Simply Beautiful Art 2016-10-02 00:31:54

@Deepak Actually, I think that if $f'(x_0)=0$ and $f(x_0)=0$, $g'(x)$ might exist.

@Deepak 2016-11-15 12:40:39

To whoever downvoted me, know this: a downvote without a comment is totally meaningless.

@ThatsRightJack 2017-11-03 07:19:11

Does this chain rule hold for complex variables $\displaystyle \frac{dg(z)}{df(z)} = \frac{g'(z)}{f'(z)}$?

@iwantmyphd 2018-09-20 15:41:53

@Deepak What would be the form if this were the second (or third, or fourth...) derivative? Does every successive derivative just bring another multiplicative factor of $1/f'(x)$? In other words if $dg(x)/df(x) = g'(x)/f'(x)$ is $d^2g(x)/df(x)^2 = g'(x)/(f'(x)^2)$?

@Deepak 2018-09-23 03:44:57

@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.

@Deepak 2018-09-23 05:41:46

Sorry the extreme LHS should've read $$\frac{d^2g(x)} {(df(x))^2} $$

@iwantmyphd 2018-09-24 16:33:57

@Deepak Is this still true if $g$ is a function of $f$ rather than $x$? In other words, if the second derivative is $d^2g(f(x))/(df(x))^2$, does the result in your comment still hold? Ultimately, I want $d^2g(f)/df^2$, not $d^2g/dx^2$, although I realize that both $f$ and $g$ are themselves functions of $x$.

@Deepak 2018-09-26 12:06:32

@iwantmyphd It wouldn't change the answer once you put everything in terms of $x$. I worked everything out in terms of the Leibniz notation, which I favour. If you use Lagrange's notation (like $f'(x)$), you should note that what you wrote is basically equivalent to $g''(f)$, which is a very tricky bit of notation. Basically, you need to express $g$ as a function of $f$, then differentiate it. It all works out in the end. You can try the first and second derivatives using a nice pair of functions like $g(x) = \sin^2 x$ and $f(x) = \sin x$. Here, note that $g(f)$ is in fact $f^2$.

@Deepak 2018-09-26 12:18:43

@iwantmyphd Using that pair of functions I suggested, and applying my second derivative formula, I just proved (I guess with the most counter-intuitive method imaginable) the trig identity $\frac{2\cos x \cos 2x + \sin x \sin 2x}{\cos^3x} =2$. :) :)

@Zereges 2014-10-01 15:08:53

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.

Related Questions

Sponsored Content

1 Answered Questions

0 Answered Questions

Derivative of a vector with respect to a vector

2 Answered Questions

[SOLVED] Partial derivative of the logistic function

1 Answered Questions

1 Answered Questions

[SOLVED] Derivative of a function w.r.t another function

  • 2017-02-07 10:03:53
  • user137684
  • 374 View
  • -1 Score
  • 1 Answer
  • Tags:   derivatives

2 Answered Questions

2 Answered Questions

[SOLVED] Derivative of function composed with itself

1 Answered Questions

[SOLVED] Derivative with respect to another function

1 Answered Questions

[SOLVED] Partial Derivative of the one variable function

  • 2014-09-01 17:07:05
  • Fsantus
  • 880 View
  • 2 Score
  • 1 Answer
  • Tags:   derivatives

Sponsored Content