Difference between revisions of "The Chain Rule for Functions of more than One Variable"

From Department of Mathematics at UTSA
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 39: Line 39:
  
 
===General rule===
 
===General rule===
The simplest way for writing the chain rule in the general case is to use the [[Total derivative#The total derivative as a linear map|total derivative]], which is a linear transformation that captures all [[directional derivative]]s in a single formula.  Consider differentiable functions {{math|''f'' : '''R'''<sup>''m''</sup> → '''R'''<sup>''k''</sup>}} and {{math|''g'' : '''R'''<sup>''n''</sup> → '''R'''<sup>''m''</sup>}}, and a point {{math|'''a'''}} in {{math|'''R'''<sup>''n''</sup>}}.  Let {{math|''D''<sub>'''a'''</sub> ''g''}} denote the total derivative of {{math|''g''}} at {{math|'''a'''}} and {{math|''D''<sub>''g''('''a''')</sub> ''f''}} denote the total derivative of {{math|''f''}} at {{math|''g''('''a''')}}.  These two derivatives are linear transformations {{math|'''R'''<sup>''n''</sup> → '''R'''<sup>''m''</sup>}} and {{math|'''R'''<sup>''m''</sup> → '''R'''<sup>''k''</sup>}}, respectively, so they can be composed.  The chain rule for total derivatives is that their composite is the total derivative of {{math|''f'' ∘ ''g''}} at {{math|'''a'''}}:
+
The simplest way for writing the chain rule in the general case is to use the total derivative, which is a linear transformation that captures all directional derivatives in a single formula.  Consider differentiable functions {{math|''f'' : '''R'''<sup>''m''</sup> → '''R'''<sup>''k''</sup>}} and {{math|''g'' : '''R'''<sup>''n''</sup> → '''R'''<sup>''m''</sup>}}, and a point {{math|'''a'''}} in {{math|'''R'''<sup>''n''</sup>}}.  Let {{math|''D''<sub>'''a'''</sub> ''g''}} denote the total derivative of {{math|''g''}} at {{math|'''a'''}} and {{math|''D''<sub>''g''('''a''')</sub> ''f''}} denote the total derivative of {{math|''f''}} at {{math|''g''('''a''')}}.  These two derivatives are linear transformations {{math|'''R'''<sup>''n''</sup> → '''R'''<sup>''m''</sup>}} and {{math|'''R'''<sup>''m''</sup> → '''R'''<sup>''k''</sup>}}, respectively, so they can be composed.  The chain rule for total derivatives is that their composite is the total derivative of {{math|''f'' ∘ ''g''}} at {{math|'''a'''}}:
 
:<math>D_{\mathbf{a}}(f \circ g) = D_{g(\mathbf{a})}f \circ D_{\mathbf{a}}g,</math>
 
:<math>D_{\mathbf{a}}(f \circ g) = D_{g(\mathbf{a})}f \circ D_{\mathbf{a}}g,</math>
 
or for short,
 
or for short,
 
:<math>D(f \circ g) = Df \circ Dg.</math>
 
:<math>D(f \circ g) = Df \circ Dg.</math>
The higher-dimensional chain rule can be proved using a technique similar to the second proof given above.<ref name="spivak_manifolds">{{cite book |first=Michael |last=Spivak |author-link=Michael Spivak |title=[[Calculus on Manifolds (book)|Calculus on Manifolds]] |location=Boston |publisher=Addison-Wesley |year=1965 |isbn=0-8053-9021-9 |pages=19–20 }}</ref>
+
The higher-dimensional chain rule can be proved using a technique similar to the second proof given above.
  
Because the total derivative is a linear transformation, the functions appearing in the formula can be rewritten as matrices.  The matrix corresponding to a total derivative is called a [[Jacobian matrix]], and the composite of two derivatives corresponds to the product of their Jacobian matrices.  From this perspective the chain rule therefore says:
+
Because the total derivative is a linear transformation, the functions appearing in the formula can be rewritten as matrices.  The matrix corresponding to a total derivative is called a Jacobian matrix, and the composite of two derivatives corresponds to the product of their Jacobian matrices.  From this perspective the chain rule therefore says:
 
:<math>J_{f \circ g}(\mathbf{a}) = J_{f}(g(\mathbf{a})) J_{g}(\mathbf{a}),</math>
 
:<math>J_{f \circ g}(\mathbf{a}) = J_{f}(g(\mathbf{a})) J_{g}(\mathbf{a}),</math>
 
or for short,
 
or for short,
Line 70: Line 70:
 
In the special case where {{math|1=''k'' = 1}}, so that ''f'' is a real-valued function, then this formula simplifies even further:
 
In the special case where {{math|1=''k'' = 1}}, so that ''f'' is a real-valued function, then this formula simplifies even further:
 
:<math>\frac{\partial y}{\partial x_i} = \sum_{\ell = 1}^m \frac{\partial y}{\partial u_\ell} \frac{\partial u_\ell}{\partial x_i}.</math>
 
:<math>\frac{\partial y}{\partial x_i} = \sum_{\ell = 1}^m \frac{\partial y}{\partial u_\ell} \frac{\partial u_\ell}{\partial x_i}.</math>
This can be rewritten as a [[dot product]].  Recalling that {{math|'''u''' {{=}} (''g''<sub>1</sub>, …, ''g''<sub>''m''</sub>)}}, the partial derivative {{math|∂'''u''' / ∂''x''<sub>''i''</sub>}} is also a vector, and the chain rule says that:
+
This can be rewritten as a dot product.  Recalling that '''u''' = (''g''<sub>1</sub>, …, ''g''<sub>''m''</sub>), the partial derivative {{math|∂'''u''' / ∂''x''<sub>''i''</sub>}} is also a vector, and the chain rule says that:
 
:<math>\frac{\partial y}{\partial x_i} = \nabla y \cdot \frac{\partial \mathbf{u}}{\partial x_i}.</math>
 
:<math>\frac{\partial y}{\partial x_i} = \nabla y \cdot \frac{\partial \mathbf{u}}{\partial x_i}.</math>
  
Line 85: Line 85:
  
 
==== Higher derivatives of multivariable functions ====
 
==== Higher derivatives of multivariable functions ====
{{Main|Faà di Bruno's formula#Multivariate version}}
+
 
Faà di Bruno's formula for higher-order derivatives of single-variable functions generalizes to the multivariable case.  If {{math|''y'' {{=}} ''f''('''u''')}} is a function of {{math|1='''u''' = ''g''('''x''')}} as above, then the second derivative of {{math|''f'' ∘ ''g''}} is:
+
Faà di Bruno's formula for higher-order derivatives of single-variable functions generalizes to the multivariable case.  If ''y'' = ''f''('''u''') is a function of {{math|1='''u''' = ''g''('''x''')}} as above, then the second derivative of {{math|''f'' ∘ ''g''}} is:
 
:<math>\frac{\partial^2 y}{\partial x_i \partial x_j} = \sum_k \left(\frac{\partial y}{\partial u_k}\frac{\partial^2 u_k}{\partial x_i \partial x_j}\right) + \sum_{k, \ell} \left(\frac{\partial^2 y}{\partial u_k \partial u_\ell}\frac{\partial u_k}{\partial x_i}\frac{\partial u_\ell}{\partial x_j}\right).</math>
 
:<math>\frac{\partial^2 y}{\partial x_i \partial x_j} = \sum_k \left(\frac{\partial y}{\partial u_k}\frac{\partial^2 u_k}{\partial x_i \partial x_j}\right) + \sum_{k, \ell} \left(\frac{\partial^2 y}{\partial u_k \partial u_\ell}\frac{\partial u_k}{\partial x_i}\frac{\partial u_\ell}{\partial x_j}\right).</math>
  

Latest revision as of 16:21, 20 January 2022

The generalization of the chain rule to multi-variable functions is rather technical. However, it is simpler to write in the case of functions of the form

As this case occurs often in the study of functions of a single variable, it is worth describing it separately.

Case of f(g1(x), ... , gk(x))

For writing the chain rule for a function of the form

f(g1(x), ... , gk(x)),

one needs the partial derivatives of f with respect to its k arguments. The usual notations for partial derivatives involve names for the arguments of the function. As these arguments are not named in the above formula, it is simpler and clearer to denote by

the derivative of f with respect to its ith argument, and by

the value of this derivative at z.

With this notation, the chain rule is

Example: arithmetic operations

If the function f is addition, that is, if

then and . Thus, the chain rule gives

For multiplication

the partials are and . Thus,

The case of exponentiation

is slightly more complicated, as

and, as

It follows that

General rule

The simplest way for writing the chain rule in the general case is to use the total derivative, which is a linear transformation that captures all directional derivatives in a single formula. Consider differentiable functions f : RmRk and g : RnRm, and a point a in Rn. Let Da g denote the total derivative of g at a and Dg(a) f denote the total derivative of f at g(a). These two derivatives are linear transformations RnRm and RmRk, respectively, so they can be composed. The chain rule for total derivatives is that their composite is the total derivative of fg at a:

or for short,

The higher-dimensional chain rule can be proved using a technique similar to the second proof given above.

Because the total derivative is a linear transformation, the functions appearing in the formula can be rewritten as matrices. The matrix corresponding to a total derivative is called a Jacobian matrix, and the composite of two derivatives corresponds to the product of their Jacobian matrices. From this perspective the chain rule therefore says:

or for short,

That is, the Jacobian of a composite function is the product of the Jacobians of the composed functions (evaluated at the appropriate points).

The higher-dimensional chain rule is a generalization of the one-dimensional chain rule. If k, m, and n are 1, so that f : RR and g : RR, then the Jacobian matrices of f and g are 1 × 1. Specifically, they are:

The Jacobian of fg is the product of these 1 × 1 matrices, so it is f′(g(a))⋅g′(a), as expected from the one-dimensional chain rule. In the language of linear transformations, Da(g) is the function which scales a vector by a factor of g′(a) and Dg(a)(f) is the function which scales a vector by a factor of f′(g(a)). The chain rule says that the composite of these two linear transformations is the linear transformation Da(fg), and therefore it is the function that scales a vector by f′(g(a))⋅g′(a).

Another way of writing the chain rule is used when f and g are expressed in terms of their components as y = f(u) = (f1(u), …, fk(u)) and u = g(x) = (g1(x), …, gm(x)). In this case, the above rule for Jacobian matrices is usually written as:

The chain rule for total derivatives implies a chain rule for partial derivatives. Recall that when the total derivative exists, the partial derivative in the ith coordinate direction is found by multiplying the Jacobian matrix by the ith basis vector. By doing this to the formula above, we find:

Since the entries of the Jacobian matrix are partial derivatives, we may simplify the above formula to get:

More conceptually, this rule expresses the fact that a change in the xi direction may change all of g1 through gm, and any of these changes may affect f.

In the special case where k = 1, so that f is a real-valued function, then this formula simplifies even further:

This can be rewritten as a dot product. Recalling that u = (g1, …, gm), the partial derivative u / ∂xi is also a vector, and the chain rule says that:

Example

Given u(x, y) = x2 + 2y where x(r, t) = r sin(t) and y(r,t) = sin2(t), determine the value of u / ∂r and u / ∂t using the chain rule.

and

Higher derivatives of multivariable functions

Faà di Bruno's formula for higher-order derivatives of single-variable functions generalizes to the multivariable case. If y = f(u) is a function of u = g(x) as above, then the second derivative of fg is:

Resources

Licensing

Content obtained and/or adapted from: