CHAIN RULE Maths21a, O. KnillREMEMBER? If f and g are functions of one variable t, then d/dtf(g(t)) = f′(g(t))g′(t). For example,d/dt sin(log(t)) = cos(log(t))/t.GRADIENT. Define ∇f(x, y) = (fx(x, y), fy(x, y)). It is called the gradient of f.THE CHAIN RULE. If ~r(t) is curve in space and f is a function of three variables, we get a function of onevariables t 7→ f(~r(t)). The chain rule isd/dtf(~r(t)) = ∇f(~r(t)) · ~r′(t)WRITING IT OUT. Writing the dot product out givesddtf(x(t), y(t)) = fx(x(t), y(t))x′(t) + fy(x(t), y(t))y′(t) .EXAMPLE. Let z = sin(x + 2y), where x and y ar e functions of t: x = et, y = cos(t). What isdzdt?Here, z = f (x, y) = sin(x + 2y), zx= cos(x + 2y), and zy= 2 cos(x + 2y) anddxdt= et,dydt= − sin(t) anddzdt= cos(x + 2y )ex− 2 cos(x + 2y) sin(t).EXAMPLE. If f is the tempera tur e distribution in a roo m and ~r(t)is the path of the spider Shelob, then f (~r(t)) is the temperature,Shelob experiences at time t. The rate of change depends on thevelocity ~r′(t) of the spider as well as the temperature gradient ∇fand the angle between gradient a nd velocity. For example, if thespider moves pe rpendicular to the gradient, its velocity is tangentto a level cur ve and the rate of change is zero.EXAMPLE. A nicer spider called ”Nabla” moves along a circle ~r(t) = (cos(t), sin(t)) on a table withtemperature distribution T (x, y) = x2− y3. Find the rate of change of the temperature, ”Nabla” experiences.SOLUTION. ∇T (x, y) = (2x, −3y2), ~r′(t) = (− sin(t), cos(t)) d/dtT (~r(t)) = ∇T (~r(t)) · ~r′(t) =(2 cos(t), −3 sin(t)2) · (− sin(t), cos(t)) = −2 cos(t) sin(t) − 3 sin2(t) cos(t).APPLICATION ENERGY CONSERVATION. If H(x, y) is the energ y of a system, the system moves satisfiesthe equationsx′(t) = Hy, y′(t) = −Hx. For example, if H(x, y) = y2/2+ V (x) is a sum of kinetic and potentialenergy, then x′(t) = y, y′(t) = V′(x) is equivalent to x′′(t) = −V′(x). In the case of the Kepler problem, wehad V (x) = Gm/|x|.The energy H is conserved . Proof. The chain rule shows that d/dtH(x(t), y(t)) =Hx(x, y)x′(t) + Hy(x, y)y′(t) = Hx(x, y)Hy(x, y) − Hy(x, y)Hx(x, y) = 0.APPLICATION: IMPLICIT DIFFERENTIATION.From f (x, y) = 0 one can express y as a function of x. From d/df(x, y(x)) = ∇f · (1, y′(x)) = fx+ fyy′= 0 weobtain y′= −fx/fy.EXAMPLE. f(x, y) = x4+ x sin(xy) = 0 defines y = g(x). If f(x, g(x)) = 0, then gx(x) = −fx/fy=−(4x3+ sin(xy) + xy cos(xy))/(x2cos(xy)).APPLICATION: DIFFERENTIATION RULES. One ring of the chain, rules themall!f(x, y) = x + y, x = u(t), y = v(t), d/dt(x + y) = fxu′+ fyv′= u′+ v′.f(x, y) = xy, x = u(t), y = v(t), d/dt(xy) = fxu′+ fyv′= vu′+ uv′.f(x, y) = x/y, x = u(t), y = v(t), d/dt(x/y) = fxu′+ fyv′= u′/y − v′u/v2.DIETERICI EQUATIO N. In thermodynamics the temperature T , the pressure p and the volume Vof a gase are related. One refinement of the ideal gas law pV = RT is the Dieterici equationf(p, V, T ) = p(V − b)ea/RV T− RT = 0. The constant b depends on the volume of the molecules and adepends on the interaction of the molecules. (A different variatio n of the ideal gas law is van der Wa als law).Problem: compute VT.If V = V (T, p), the chain rule says fVVT+ fT= 0, so thatVT= −fT/fV= −(−ap(V − b)ea/RV T/(RV T2) −R)/(pV ea/RV T− p(V − b)ea/RV T/(RV2T )). (This could be simplified to (R + a/T V )/(RT/(V − b) − a/V2)).DERIVATIVE. If f : Rn→ Rmis a map, its derivative f′is the m × n matrix [f′]ij=∂∂xjfi.MORE DERIVATIVES. (The last three derivatives will only appear later)f : R → R3curvef′velocity vector.f : R3→ Rscalar functionf′gradient vector.f : R2→ R3surfacef′tangent matrixf : R2→ R2coo rdinate changef′Jacobean matrix.f : R3→ R3gradient fieldf′Hessian matrix.THE GENERAL CHAIN RULE. (for people who have seen some linear algebra). First of all, thed/dtf(~r(t)) = ∇f (r(t)) · ~r′(t) is true in a ny dimension. If f is vector valued, the same equa tion holds for eachcomponent d/dtfi(~r(t)) = ∇fi(r(t)) · ~r′(t). One can further assume that ~r depends on different variables. Thenthis formula holds for each variable xi. Here is the general chain rule for the curious: If f : Rn→ Rmandg : Rk→ Rn, we can compose f ◦ g, which is a map from Rkto Rm. The chain rule expresses the derivativeof f ◦ g(x) = f(g(x)) in terms of the derivatives of f and g.∂∂xjf(g(x))i=Pk∂∂xkfi(g(x))∂∂xjgk(x)or short(f ◦ g)′(x) = f′(g(x)) · g′(x)Both f′(g(x)) and g′(x) are matrices and · is the matrix multiplication. The chain rule in higher dimensionslooks like the chain rule in one dimension, only that the objects are matrices and the multiplication is matrixmultiplication.EXAMPLE. GRADIENT IN POLAR COORDINATES. In polar coordinates, the gradient is defined as ∇f =(fr, fθ/r). Using the chain rule, we can relate this to the usual gradient: d/drf (x(r, θ), y(r, θ)) = fx(x, y) cos(θ)+fy(x, y) sin(θ) and d/(rdθ)f(x(r, θ), y(r, θ)) = −fx(x, y) sin(θ) + fy(x, y) cos(θ) means that the length of ∇f isthe same in both coordinate systems.PROOFS OF THE CHAIN RULE.1. Proof. Near any point, we can approximate f by a linear function L. It is enough to check thechain rule for linear functions f(x, y) = ax + by − c and if ~r(t) = (x0+ tu, y0+ tv) is a line. Thenddtf(~r(t)) =ddt(a(x0+ tu) + b(y0+ tv )) = au + bv and this is the dot product of ∇f = (a, b) with ~r′(t) = (u, v).2. Proof. Plugging in the definitions of the derivatives and use limits.WHERE IS THE CHAIN RULE NEEDED? (informal).While the chain rule is useful in calculations using the composition of functions, the iteration of maps or indoing change of variables, it is also use ful for understanding some theoretical aspects. Examples:• In the proof of the fact that gradients are orthogonal to level surfaces. (see Wednesday).• It appears in change of variable formulas.• It will be used in the fundamental theorem for line integrals coming up later in the course.• The chain rule illustrates also the Lagrange multiplier method which we will see later.• In fluid dynamics, PDE’s often involve terms ut+ u∇u which give the change of the velocity in theframe of a fluid particle.• In chaos theory, where one wants to understand what happens after iterating a map f .ICE Chain rule Maths21aThe Mars surface on which ”opportunity” drives has the height f (x, y) = x + (2x2+ 3y2− xy). The rovermoves
View Full Document