# Reconcile the chain rule with a derivative formula

I know the chain rule is like this: $f(g(x)) = f'(g(x))g'(x)$.

However, I encountered a derivative with which I cannot reconcile the statement above.

Let $F$ be a function of $x$ and $z$, and $z$ is a function of $x$. Then by the chain rule: $$\frac{dF}{dx} = \frac{\partial{F}}{\partial{x}} + \frac{\partial{F}}{\partial{z}}\frac{\partial{z}}{\partial{x}}$$

I'm not sure how the equation is derived. The second part of the left hand side $\frac{\partial{F}}{\partial{z}}\frac{\partial{z}}{\partial{x}}$ looks similar to the chain rule. I'm not sure where $\frac{\partial{F}}{\partial{x}}$ came from.

• I think the left side should be a total derivative, $\frac{dF}{dx}$. – mr_e_man Jun 7 '18 at 1:05
• @mr_e_man What's the difference between $\frac{dF}{dx}$ and my notation? I thought the total derivative should be a linear map. – user1691278 Jun 7 '18 at 1:17
• The partial derivative treats $z$ as a constant while $x$ varies (or vice versa). The total derivative treats $z$ as a function of $x$. – mr_e_man Jun 7 '18 at 1:19
• If $x$ and $z$ are both functions of another parameter $t$, the general chain rule is $\frac{dF}{dt} = \frac{\partial F}{\partial x}\frac{dx}{dt} + \frac{\partial F}{\partial z}\frac{dz}{dt}$. This problem has $x=t$. – mr_e_man Jun 7 '18 at 1:22
• It’s just the multivariable chain rule. Remember that $\partial x/\partial x=1$. – amd Jun 7 '18 at 1:39

For a function $F=F(x,y)$ where you are going to make the dependece $x=x(t)$ and $y=y(t)$, the total differential is $$dF=\frac{\partial F}{\partial x}dx+\frac{\partial F}{\partial y}dy,$$ and the chain rule is $$\frac{dF}{dt}=\frac{\partial F}{\partial x}\frac{dx}{dt}+\frac{\partial F}{\partial y}\frac{dy}{dt}.$$ But if $x=t$ then $$\frac{dF}{dx}=\frac{\partial F}{\partial x}+\frac{\partial F}{\partial y}\frac{dy}{dx}.$$

People who are new to this kind of computations are easily confused by abuse of notation; indeed quite a lit of detail is hidden in the formula you asked.

Let me begin by recalling the general form of the chain rule:

If $F : \mathbb{R}^m \to \mathbb{R}^n$ and $G : \mathbb{R}^l \to \mathbb{R}^m$ are differentiable, then the derivative of the composition $F\circ G$ evaluated at $\mathrm{x} \in \mathbb{R}^l$ is given by

$$[D(F\circ G)]_{\mathrm{x}} = [DF]_{G(\mathrm{x})}[DG]_{\mathrm{x}}$$

• When $l=m=n=1$, then the above formula reduces to $(f\circ g)'(x) = f'(g(x))g'(x)$.

• The assumption can be significantly weakened by restricting $F$ and $G$ to smaller domains and asking differentiability only at certain points, although it does not change the essence of the above statement.

Now, in order to make the computation in question a bit more rigorous, let us explicate the function relation between $z$ and $x$: let $g$ be such that $z = g(x)$. If we write $G(x) = (x, g(x))$, then the chain rule applied to the composition $F \circ G$ tells that

\begin{align*} \frac{d}{dx} F(x, g(x)) &= [D(F \circ G)]_{x} = [DF]_{G(x)} [DG]_x \\ &= \begin{pmatrix} \frac{\partial F}{\partial x} & \frac{\partial F}{\partial z} \end{pmatrix}_{G(x)} \begin{pmatrix} \frac{dx}{dx} \\ \frac{dg(x)}{dx} \end{pmatrix}_x \\ &= \frac{\partial F}{\partial x}(x, g(x)) + \frac{\partial F}{\partial z}(x, g(x))g'(x) \end{align*}

• Hi, Could you please explain what is $[D(F\circ G)]_{\mathrm{x}}$? Does $[DF]_{G(x)} [DG]_x$ means $[DF]_{G(x)} \times [DG]_x$? – LE Anh Dung Nov 6 '19 at 8:00
• @MadnessForMATH, both $DF$ and $DG$ are linear operators, or more easily, matrices. (They are called Jacobian matrices.) So $[DF]_{G(x)} [DG]_x$ is the multiplication of two matrices $[DF]_{G(x)}$ and $[DG]_x$. – Sangchul Lee Nov 6 '19 at 8:22
• Ah, I also have a question about the chain rule with your notation here. If you don't mind, please have a look at it! – LE Anh Dung Nov 6 '19 at 8:28