146 CHAPTER 6. THE DERIVATIVE
6.3 The Chain RuleWith the above lemma, it is easy to prove the chain rule.
Theorem 6.3.1 (The chain rule) Let U and V be open sets U ⊆ X and V ⊆ Y . Sup-pose f : U → V is differentiable at x ∈ U and suppose g : V → Fq is differentiable atf (x) ∈V . Then g ◦f is differentiable at x and
D(g ◦f)(x) = Dg (f (x))Df (x) .
Proof: This follows from a computation. Let B(x,r)⊆U and let r also be small enoughthat for ∥v∥ ≤ r, it follows that f (x+v) ∈V . Such an r exists because f is continuous atx. For ∥v∥< r, the definition of differentiability of g and f implies
g (f (x+v))−g (f (x)) =
Dg (f (x))(f (x+v)−f (x))+o(f (x+v)−f (x))
= Dg (f (x)) [Df (x)v+o(v)]+o(f (x+v)−f (x))
= D(g (f (x)))D(f (x))v+o(v)+o(f (x+v)−f (x)) (6.11)= D(g (f (x)))D(f (x))v+o(v)
By Lemma 6.2.3. From the definition of the derivative D(g ◦f)(x) exists and equalsD(g (f (x)))D(f (x)). ■
6.4 The Matrix of the DerivativeThe case of most interest here is the only one I will discuss. It is the case where X =Rn andY = Rm, the function being defined on an open subset of Rn. Of course this all generalizesto arbitrary vector spaces and one considers the matrix taken with respect to various bases.However, I am going to restrict to the case just mentioned here. As above, f will be definedand differentiable on an open set U ⊆ Rn.
As discussed in the review material on linear maps, the matrix of Df (x) is the matrixhaving the ith column equal to Df (x)ei and so it is only necessary to compute this. Let tbe a small real number such that
f (x+ tei)−f (x)−Df (x)(tei)
t=
o(t)t
Therefore,f (x+ tei)−f (x)
t= Df (x)(ei)+
o(t)t
The limit exists on the right and so it exists on the left also. Thus
∂f (x)
∂xi≡ lim
t→0
f (x+ tei)−f (x)
t= Df (x)(ei)
and so the matrix of the derivative is just the matrix which has the ith column equal to theith partial derivative of f . Note that this shows that whenever f is differentiable, it followsthat the partial derivatives all exist. It does not go the other way however as discussed later.