3

I recently was reading spivak calculus on manifold and I've arrived to chain rule he wrote that

\begin{gather}F(x)=f(g_{1}(x),...,g_{m}(x))\end{gather}

then he took the derivative which lead to

\begin{gather} \frac{d F(x)}{dx}=\sum_{j=1}^{m}\frac{\partial f}{\partial g_{j}}.\frac{dg_{j} }{dx}\end{gather}

let's talk about the case that $x$ is a scalar and $g_{1}(x)=x$ and $g_{2}(x)=x^2$

\begin{gather} \frac{d F(x)}{dx}=\frac{\partial f}{\partial x}.\frac{d x}{dx}+\frac{\partial f}{\partial (x^2)}.2x \end{gather}

doesn't that mean that we've considered $f$ as being function of $2$ variables ,because we took the partial derivatives w.r.t variables inside it ?

  • Your example is $F=f(x,x^2)$, so yes, $f$ is a function of two variables. The notation $\frac{\partial f}{\partial x^2}$ is confusing. It would be clearer to give new names to $f$'s parameters: think of it as $f(y,z)$ and take $\frac{\partial f}{\partial y}$ at $y=x$ and take $\frac{\partial f}{\partial z}$ at $z=x^2$. – Karl May 22 '23 at 16:55
  • 3
    NEVER IN A MILLION YEARS would Spivak have written the notation $\dfrac{\partial f}{\partial g_j}$. Do NOT ever use functions in the place of variables. Indeed, Spivak writes $D_j f$ for the partial derivative of $f$ with respect to its $j$th variable. – Ted Shifrin May 22 '23 at 17:09
  • @Karl

    if we wrote that $f(x,x^3)=x+sin(x^3)$ this is also a 2 variable function ?

    – Mason carlos May 22 '23 at 20:01
  • That doesn't really make sense as a definition for $f$. Do you mean $f(x,y)=x+\sin y$? – Karl May 22 '23 at 21:13
  • @Karl, if in your example we substitute $y=x^2$ , it became $f(x,x^2)=x+sin(x^2)$ , could it still be function of 2 variable? – Mason carlos May 22 '23 at 21:29
  • Yes, if $f(y,z)$ is defined as $y+\sin z$, and $F(x)$ is defined as $f(x,x^2)$, then $F$ is a function of one variable and $f$ is a function of two variables. $F$ has a single derivative and $f$ has two partial derivatives. – Karl May 22 '23 at 21:41
  • @Karl, which makes $f$ takes 2 variable which are $x$ and $x^2$ and obviously makes $f(x,x^2) =x+sin(x^2)$ a function of 2 variable, right? – Mason carlos May 22 '23 at 21:46
  • Do you really want to use "$x^2$" as the name of a variable? That's very confusing. – Karl May 22 '23 at 21:55
  • @Karl, but isn't that what you have wrote? Or you mean something else ? , What I want to illustrate that when applying composition the input to the function is the compoposed one in that case in our case the function $f$ takes 2 input which is $x$ and the composed function $x^2$ – Mason carlos May 22 '23 at 22:00
  • I'm not sure what you mean. It sounds like maybe you should step back and think about the difference between defining a function and evaluating a function. – Karl May 22 '23 at 22:04
  • @Karl, I will clarify what my question is, having a function like $f(x)=x^2$ if we have swapped between $x$ and $g(x)$ , we get $f(g(x))=(g(x))^2$ making $g(x)$ input to our original function, similarly if $f(x,y)=x+sin(y)$ swapping between $y$ and $2x$ make our original one take $f(x,2x)=x+sin(2x) $ , which is still also a multivariable function which takes $x$ and $2x$ as input to it , is that clear ? – Mason carlos May 22 '23 at 22:42
  • $f$ is a function that takes two inputs. If you want to plug in $x$ and $2x$ as the two inputs, then you are defining a new function (which we can call $F$) which takes only one input ($x$). $F$ is not a multivariable function, but it is related to $f$. – Karl May 22 '23 at 23:48
  • @Karl But to $f$ after the composition of $x$ and $2x$ it still takes 2 input ? Because while computing derivative we also take a partial derivative – Mason carlos May 22 '23 at 23:55
  • The derivative of the single-variable function $F$ is related to the partial derivatives of the multivariable function $f$ because $F$ is defined using $f$. Is there a problem you're having trouble solving or are you just concerned about terminology? – Karl May 23 '23 at 00:30

1 Answers1

2

$f$ is a real-valued function of $m$ real variables $x_1, \ldots, x_n$. We can form the partial derivatives $\dfrac{\partial f}{\partial x_{j}}$ with respect to these variables which are again functions of the $m$ real variables $(x_1, \ldots, x_n)$. The naming of the input variable is irrelevant, for $m = 2$ one often writes $f(x,y)$ instead of $f(x_1,x_2)$ and gets the two partial derivatives $\dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}$. Similarly, for $m = 3$ one often writes $f(x,y,z)$ instead of $f(x_1,x_2,x_3)$ and gets the three partial derivatives $\dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}, \dfrac{\partial f}{\partial z}$.

$F$ is the composition of $f$ and the function $g(x) = (g_1(x),\ldots, g_m(x)) \in \mathbb R^m$ of the real variable $x$ which has $m$ coordinate functions $g_j$. Thus the composition $F = f \circ g$ is a real-valued function of one real variable. We can also say that $F(x) = f(x_1,\ldots,x_m)$ with $x_j = g_j(x)$.

In my opinion one should not write $\dfrac{\partial f}{\partial g_{j}}$ for the partial derivative of $f$ with respect to ist $j$-th input variable because this notation suggests that there exist partial derivatives of $f$ with respect to functions $g_j$ - which is not the case. However, that is just a matter of taste and if you correctly understand what it means it will cause no problem to write $\dfrac{\partial f}{\partial g_{j}}$ instead of $\dfrac{\partial f}{\partial x_{j}}$.

I suggest to write $$\frac{d F}{dx}=\sum_{j=1}^{m}\frac{\partial f}{\partial x_{j}}\cdot\frac{dg_{j} }{dx} . \tag{1}$$ At the point $x$ we get $$\frac{d F}{dx}(x)=\sum_{j=1}^{m}\frac{\partial f}{\partial x_{j}}(g(x))\cdot\frac{dg_{j} }{dx}(x) . \tag{2}$$ In your example we have $m = 2$ and $g_1(x) = x, g_2(x) = x^2$. This gives $$\frac{d F}{dx}(x)=\frac{\partial f}{\partial x_{1}}(x,x^2) + \frac{\partial f}{\partial x_{2}}(x , x^2) \cdot 2 x . \tag{3}$$

Let us emphasize that $f(x_1,x_2)$ is a function of two variables. However, $F(x) = f(x,x^2)$ is a function of one variable which allows to form the usual derivative $\dfrac{d F}{dx}$. It can be expressed via $(3)$ in terms of the two partial derivatives $\dfrac{\partial f}{\partial x_{1}}, \dfrac{\partial f}{\partial x_{2}}$. If we write $f(x,y)$ instead of $f(x_1,x_2)$. formula $(3)$ takes the form $$\frac{d F}{dx}(x)=\frac{\partial f}{\partial x}(x ,x^2) + \frac{\partial f}{\partial y}(x , x^2) \cdot 2 x . \tag{4}$$

Let us consider the example $f(x,y) = x +y$. We have $\dfrac{\partial f}{\partial x}(x,y) = 1$ and $\dfrac{\partial f}{\partial y}(x,y) = 1$. With $g_1(x) = x$ and $g_2(x) = x^2$ we get $F(x) = f(x,x^2) = x + x^2$, thus $\dfrac{d F}{dx}(x) = 1 + 2x$. On the RHS of $(4)$ we have $$\frac{\partial f}{\partial x}(x,x^2))\cdot\frac{dg_{1} }{dx}(x) + \frac{\partial f}{\partial y}(x,x^2)\cdot\frac{dg_{2} }{dx}(x) = 1 \cdot 1 + 1 \cdot 2x = 1 + 2x .$$

Paul Frost
  • 76,394
  • 12
  • 43
  • 125
  • then that makes $f(x,x^2)$ function of $2$ variables ,right ?

    because in spivak single variable calculus , he wrote that
    \begin{gather} \frac{d f\circ g (x)}{dx}=\frac{d f(g(x))}{dg(x)}.\frac{d (g(x))}{dx} \end{gather} indicating that $g(x)$ is the input to $f$ , and I've also seen a user wrote that $\frac{d f(g(x))}{dg(x)}$ means that $f$ is a function in $g(x)$

    then by similarity that makes $f(x,x^2)$ function of $2$ variables , right ?

    – Mason carlos May 22 '23 at 17:31
  • @Masoncarlos Yes, $f$ has two variables. – Paul Frost May 22 '23 at 21:34
  • To make sure that I understand correctly, let's take an example, $f(x,y)=x+y$ and $y=2x$ then it became $f(x,2x)=x+2x$ , does $f(x,2x)$ still of 2 variable? – Mason carlos May 22 '23 at 21:38
  • @Masoncarlos See my update. You must distinguish between the functions $f$ and $F$. The first has two variables, the second only one. – Paul Frost May 22 '23 at 22:42
  • You have provided an excellent example in the last paragraph, indeed $F(x)$ is a function of one variable, but talking about $f$ does it still 2 variable function even when we applied the composition "$f(x,x^2)$" , because you took partial derivative of it after you've applied the composition – Mason carlos May 22 '23 at 22:52