Compositions and the Chain Rule using Arrow Diagrams J. B. Thoo Department of Mathematics University of California Davis, CA 95616-8633 USA jb2@math.ucdavis.edu November 14, 1994 (To appear in PRIMUS) Abstract Arrow (or tree, or branch) diagrams are sometimes introduced to freshman calculus students as a mnemonic device for applying the chain rule to functions of several variables. We suggest a particular format for an arrow diagram that can be introduced to students early on as a way to internalize the notion of a composition of functions, and that later can be used as a mnemonic device for applying the chain rule to functions both of one and of several variables. 1 Introduction The use of arrow (or tree, or branch) diagrams as a mnemonic device for computing partial and total derivatives of functions of several variables by the chain rule is not new. For example, Barcellos and Stein [1] use such a diagram in the following manner: to compute the partial derivative ∂z/∂s of a function 1 z = z(x, y) where x = x(s, t) and y = y(s, t), simply add up the contributions from all the possible paths that connect z to s in Figure 1. This yields the desired result, ∂z/∂s = ∂z/∂x · ∂x/∂s + ∂z/∂y · ∂y/∂s. x s y t z Figure 1: A tree diagram for computing the partial derivatives of z. Such a mnemonic device can, indeed, be very useful in helping a novice student master the chain rule for functions of several variables. However, arrow diagrams can be introduced much earlier in a student’s mathematical experience— as early as the first encounter with the notion of a composition of functions. Further, we suggest that to be useful in this context, an arrow diagram should begin with an independent variable and end with a dependent variable (unlike Figure 1, which begins with the dependent variable and ends with the independent variables). 2 Composition of functions We like to tell our students in a precalculus course, for example, to think of a composition of functions as what one does naturally when punching a calculator √ to evaluate, say, y(7) where y(x) = x2 + 3: 7 −→ (7)2 −→ [(7)2 ] + 3 −→ p {[(7)2 ] + 3)}, that is, ( ) −→ ( )2 −→ [ ] + 3 −→ p { }. A typical quiz problem is, Rewrite the function y(x) = √ x2 + 3 as a composition of simpler functions. 2 An acceptable answer would be y(x) : x −→ r(x) = x2 −→ s(r) = r + 3 −→ y(s) = √ s. Such an arrow diagram not only helps the students internalize the concept of a composition of functions by emphasizing how the independent variable depends on the dependent variable, but is also well suited as a mnemonic device for carrying out the chain rule for functions of one variable. 3 The chain rule: functions of one variable When we introduce the chain rule for the first time in a freshman calculus course, we begin by pointing out that built into the Leibniz notation “dy/dx” is the understanding that the “numerator” y is the dependent variable and the “denominator” x is the independent variable; that we seek a chain starting with the independent variable x and ending with the dependent variable y; and that our final result should be entirely in terms of the independent variable x. Once this point is made, then remembering how to evaluate the chain rule for functions of one variable is easy: draw an arrow diagram for dy/dx (beginning with the independent variable x and ending with the dependent variable y) that describes the composition of functions; evaluate the derivative at each step of the chain (arrow diagram); and multiply together all the derivatives along the √ chain. For example, let y = x2 + 3. To evaluate dy/dx we use the diagram dy : dx x dr/dx=2x −→ r = x2 ds/dr=1 −→ s = r+3 √ dy/ds=1/(2 s) −→ y= √ s. Multiplying together all the derivatives along the chain then gives the desired result, dy dx = = dr ds dy 1 · · = 2x · 1 · √ dx dr ds 2 s x √ . x2 + 3 A typical quiz problem is, Suppose that s = s(t), r = r(s), u = u(r), v = v(u), w = w(v), x = x(w), y = y(x), and z = z(y). Write out dz/dt, dz/dx, and dy/dr. 3 ∂x/∂s x ∂z/∂x ∂z : s ∂s z ∂y/∂s y ∂z/∂y Figure 2: Arrow diagram for the chain rule for a function of several variables. Hopefully, the students would first write out the arrow diagram ds/dt dr/ds du/dr dv/du dw/dv dx/dw dy/dx dz/dy t −→ s −→ r −→ u −→ v −→ w −→ x −→ y −→ z, after which obtaining dz/dt, dz/dx, and dy/dr should be relatively easy. For instance, to obtain dy/dr simply multiply together all the derivatives along the segment of the chain that starts with r and ends with y. 4 The chain rule: functions of several variables If a student has already been introduced to using an arrow diagram in the composition of functions and also in differentiating a function of one variable by the chain rule, then using such a diagram to apply the chain rule to a function of several variables will seem quite natural. We return to the first example, Compute the partial derivative ∂z/∂s of a function z = z(x, y) where x = x(s, t) and y = y(s, t). The notation ∂z/∂s indicates that we seek a chain that begins with the independent variable s and ends with the dependent variable z. Thus, we sketch an arrow diagram that shows all the possible paths that begin with s and end with z (see Figure 2). Then, as before, the desired result is obtained by adding together the contributions from all the paths, where each contribution is simply the product of the partial derivatives along that path. A typical quiz problem is, Compute the partial derivatives ∂z/∂q and ∂z/∂r of a function z = z(x, y) where x = x(p, q), y = y(p), and p = p(q, r). 4 ∂z/∂x x ∂x/∂q ∂z : q ∂q ∂x/∂p ∂p/∂q z p ∂z/∂y y dy/dp (a) Computing dz/dq. ∂x/∂p ∂p/∂r ∂z : r ∂r x ∂z/∂x p z dy/dp y ∂z/∂y (b) Computing dz/dr. Figure 3: Arrow diagrams for computing dz/dq and dz/dr. If the students have been following along, then we should see arrow diagrams resembling Figures 3(a) and 3(b), giving the desired results ∂z ∂q ∂z ∂r = = ∂x ∂z ∂p · + · ∂q ∂x ∂q ∂p ∂x ∂z · · + ∂r ∂p ∂x ∂x ∂z ∂p dy ∂z · + · · ∂p ∂x ∂q dp ∂y ∂p dy ∂z · · . ∂r dp ∂y References [1] Barcellos, A., and Stein, S. K., 1992, Calculus and Analytic Geometry, fifth edition (New York: McGraw-Hill). 5