310 CHAPTER 17. THE DERIVATIVE OF A FUNCTION OF MANY VARIABLES

and so fy (0,0) = 0. Thus the partial derivatives exist. However, the function is not differ-entiable at (0,0) because

lim(x,y)→(0,0)

xsin(

1xy

)|(x,y)|

does not even exist, much less equals 0. To see this, let x = y and let x→ 0.

17.6 The Chain Rule

17.6.1 The Chain Rule For Functions Of One VariableFirst recall the chain rule for a function of one variable. Consider the following picture.

Ig→ J

f→ R

Here I and J are open intervals and it is assumed that g(I)⊆ J. The chain rule says that iff ′ (g(x)) exists and g′ (x) exists for x ∈ I, then the composition, f ◦g also has a derivativeat x and

( f ◦g)′ (x) = f ′ (g(x))g′ (x) .

Recall that f ◦g is the name of the function defined by f ◦g(x)≡ f (g(x)). In the notationof this chapter, the chain rule is written as

D f (g(x))Dg(x) = D( f ◦g)(x) . (17.8)

17.6.2 The Chain Rule For Functions Of Many VariablesLet U ⊆Rn and V ⊆Rp be open sets and let f be a function defined on V having values inRq while g is a function defined on U such that g (U)⊆V as in the following picture.

Ug→V

f→ Rq

The chain rule says that if the linear transformations (matrices) on the left in (17.8) bothexist then the same formula holds in this more general case. Thus

Df (g (x))Dg (x) = D(f ◦g)(x)

Note this all makes sense because Df (g (x)) is a q× p matrix and Dg (x) is a p×n matrix.Remember it is all right to do (q× p)(p×n). The middle numbers match. More precisely,

Theorem 17.6.1 (Chain rule) Let U be an open set in Rn, let V be an open set in Rp, letg : U → Rp be such that g (U) ⊆ V , and let f : V → Rq. Suppose Dg (x) exists for somex ∈U and that Df (g (x)) exists. Then D(f ◦g)(x) exists and furthermore,

D(f ◦g)(x) = Df (g (x))Dg (x) . (17.9)

In particular,∂ (f ◦g)(x)

∂x j=

p

∑i=1

∂f (g (x))

∂yi

∂gi (x)

∂x j. (17.10)