0
$\begingroup$

Simple example:

$f(x) = x \cdot g(x) \cdot h(x)$

$g(x) = 5x^2$

$h(x) = 2x^3$

First, derive $f$ by $x$, then substitute $g$ and $h$:

$\frac{\partial f}{\partial x} = g(x) \cdot h(x) = 10x^5$

And now the other way round, substitute and then derive:

$\frac{\partial f}{\partial x} = \frac{\partial (10 x^6)}{\partial x} = 60 x^5$

What's wrong here? Why does it matter in which order I subsitute known functions in a partial derivative? What is the meaning of this?

2 Answers 2

4

The problem is that you treated $g(x)$ and $h(x)$ as constants. They're not, they depend on $x$. If you take that into account and write $g'(x)$ and $h'(x)$ for their derivatives with respect to $x$, respectively, you'll get the same result regardless of when you substitute for them.

  • 0
    But I thought the partial derivative does exactly this: take everything as constant but the variable that shows up directly itself.2012-11-02
  • 2
    @FooBar: that is what I call the "first fundamental mistake of multivariable calculus". Partial derivatives don't "take everything as constant". A partial derivative is the derivative taken with respect to *one chosen independent variable* while other **independent variables** are held to be fixed. If you declare $g$ and $h$ to be independent variables, then $f$, the dependent variable, is a function of $x$, $g$, and $h$. This is different from the case where you declare only $x$ as the independent variable and make $g$ and $h$ dependent variables. In performing the partial differentiation ...2012-11-02
  • 0
    @FooBar: The potential for confusion surrounding partial derivatives is endless because our notation for them is so ambiguous. You might want to search for some of my other answers to questions about partial derivatives. In a nutshell, when you use partial derivatives you need to have very clear in your mind what you're treating as independent variables, what you're changing and what you're keeping constant. As a rule, if you have a function $g(x)$, then $g$ depends on $x$ and you can't use both $x$ and $g$ as independent variables simultaneously, i.e. you can't keep $g$ fixed as $x$ varies.2012-11-02
  • 0
    ... you can only take other **independent variables** as fixed. You are not allowed to hold other **dependent variables** as fixed. Incidentally, this leads to the "second fundamental mistake of multivariable calculus": to specify a partial derivative, you must specify what are the independent and dependent variables. There are times when it is not clear from context (for example in studying thermodynamics). If one is not clear about which are precisely the independent and dependent variables, the notation $\partial/\partial x$ is meaningless.2012-11-02
  • 0
    Thanks all of you. I chose this answer as the correct one in combination with Willies comment which solved my problem fully ("independent" was the keyword, I was not aware of this).2012-11-02
2

It doesn't appear that you're applying the product rule correctly in the first case.

If you apply the product rule on $f(x)=xg(x)h(x)$ you should get

$$\frac{df}{dx} = xg(x)h'(x)+xg'(x)h(x)+g(x)h(x).$$

  • 0
    partial derivative of f(x, g(x), h(x)) by x treats g and h as constant, I thought? Or the other way round: Then why partial derive at all if I'm not allowed to treat something as constant?2012-11-02
  • 0
    Nope, there is no "partial" derivative of $f$ in this sense. Partial derivatives are taken with respect to *independent* variables, but $g$ and $h$ are *dependent* variables with respect to $x$.2012-11-02
  • 0
    Another way of looking at it is $\frac{df}{dx}$ is the change in $f$ as a result of a small change in $x$. If $x$ changes, then as you have written it, so too does $g(x)$ and $h(x)$. Therefore, we must account for the effects of changes of $g(x)$ and $h(x)$ as a consequence of small changes of $x$.2012-11-02