Lecture 14: Review of Differentiability, Tangent Planes, and Introduction to the Chain Rule

  • Review of Differentiability and Tangent Planes (from Lecture 13)

    • One-Variable Case (1D):

      • The derivative (f(a))(f'(a)) is the slope of the tangent line to the curve y=f(x)y=f(x) at x=ax=a.

      • Approximated by slopes of secant lines, as the difference h0h \to 0.

      • Limit definition: (f(a)=limh0f(a+h)f(a)h)(f'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}).

      • Rearranged form (linearization with error term): (f(a+h)=f(a)+f(a)h+E(h)h)(f(a+h) = f(a) + f'(a)h + E(h)h) where E(h)0E(h) \to 0 as h0h \to 0. This implies the error goes to zero quickly.

      • Linearization: By re-indexing and setting x=a+hx = a+h, we get the equation of the tangent line: (L(x)=f(a)+f(a)(xa))(L(x) = f(a) + f'(a)(x-a)). This is the first-degree Taylor polynomial centered at aa.

    • Two-Variable Case (2D):

      • An analogous multi-variable limit definition exists (e.g., lim(Δx,Δy)(0,0)f(a+Δx,b+Δy)f(a,b)(Δx)2+(Δy)2\lim_{(\Delta x, \Delta y) \to (0,0)} \frac{f(a+\Delta x, b+\Delta y) - f(a,b)}{\sqrt{(\Delta x)^2 + (\Delta y)^2}} and more complex algebraic manipulations).

      • Differentiability Definition: A function f(x,y)f(x,y) is differentiable at (a,b)(a,b) if it is well approximated by its tangent plane at (a,b)(a,b). This is similar to the 1D case where a function is differentiable if well approximated by its tangent line.

      • Geometric Understanding of Partial Derivatives:

        • To understand partial derivatives geometrically, one slices the surface z=f(x,y)z = f(x,y) with planes of fixed xx or yy values (e.g., y=y<em>0y = y<em>0 or x=x</em>0x = x</em>0).

        • These slices create curves on the surface. When viewed as one-variable functions, the slope of these curves is the partial derivative at that point.

        • The tangent vectors to these curves at a given point effectively span the tangent plane at that point (forming an affine space).

      • Tangent Plane as Linearization: The tangent plane is the two-variable analog of the tangent line and represents the linearization of the function at that point.

      • Differentiability Condition (easier to check): A function f(x,y)f(x,y) is differentiable at (a,b)(a,b) if its partial derivatives, f<em>xf<em>x and f</em>yf</em>y, exist and are continuous in a region containing (a,b)(a,b). This is a sufficient condition.

  • Differentials and Total Differential

    • Concept Definition: Differentials (dxdx, dydy) represent the linearized change in a variable, while increments (Δx\Delta x, Δy\Delta y) represent the actual change.

    • 1D Example:

      • For the independent variable: Δx=dx\Delta x = dx.

      • For the dependent variable: Δy\Delta y (actual change in f(x)f(x)) vs. dydy (linearized change along the tangent line). The formula for the linearized change is dy=f(x)dxdy = f'(x)dx.

    • 2D Case:

      • For independent variables: Δx=dx\Delta x = dx and Δy=dy\Delta y = dy.

      • For the dependent variable (Z=f(x,y)Z=f(x,y)), the total differential (dZdZ) is the linearized change in ZZ (change along the tangent plane).

      • Total Differential Formula: (dZ=fxdx+fydy)(dZ = \frac{\partial f}{\partial x} dx + \frac{\partial f}{\partial y} dy).

      • Geometric Interpretation of dZdZ: It represents how much the ZZ coordinate changes as one moves between two points on the tangent plane, given changes dxdx and dydy in the XX and YY directions respectively.

      • Relationship to Differentiability Definition in 2D: The complicated definition of 2D differentiability, (f(a+Δx,b+Δy)=f(a,b)+fx(a,b)Δx+fy(a,b)Δy+E<em>1(Δx)Δx+E</em>2(Δy)Δy)(f(a+\Delta x, b+\Delta y) = f(a,b) + \frac{\partial f}{\partial x}(a,b)\Delta x + \frac{\partial f}{\partial y}(a,b)\Delta y + E<em>1(\Delta x)\Delta x + E</em>2(\Delta y)\Delta y) where E<em>1,E</em>20E<em>1, E</em>2 \to 0 as (Δx,Δy)(0,0)(\Delta x, \Delta y) \to (0,0), can be understood as:

        • The terms fx(a,b)Δx+fy(a,b)Δy\frac{\partial f}{\partial x}(a,b)\Delta x + \frac{\partial f}{\partial y}(a,b)\Delta y are precisely the total differential dZdZ. They represent the change along the tangent plane.

        • The terms E<em>1(Δx)Δx+E</em>2(Δy)ΔyE<em>1(\Delta x)\Delta x + E</em>2(\Delta y)\Delta y are error terms (ΔZdZ\Delta Z - dZ) that quantify the deviation between the actual surface and its tangent plane approximation.

    • Practical Application: Error Propagation

      • Differentials can be used to estimate how uncertainties in input measurements propagate to the uncertainty of a calculated output quantity (e.g., in science labs).

      • Example: Volume of a Cone

        • Formula: V=13πr2hV = \frac{1}{3} \pi r^2 h.

        • Measurements: radius r=10r = 10 cm, height h=25h = 25 cm.

        • Measurement errors: Δr=dr=±0.1\Delta r = dr = \pm 0.1 cm, Δh=dh=±0.1\Delta h = dh = \pm 0.1 cm.

        • Goal: Estimate the error in the volume (dVdV).

        • Apply total differential formula: (dV=Vrdr+Vhdh)(dV = \frac{\partial V}{\partial r} dr + \frac{\partial V}{\partial h} dh).

        • Calculate partial derivatives:

          • Vr=23πrh\frac{\partial V}{\partial r} = \frac{2}{3} \pi r h

          • Vh=13πr2\frac{\partial V}{\partial h} = \frac{1}{3} \pi r^2

        • Plug in values: (dV=(23π(10)(25))(0.1)+(13π(10)2)(0.1))(dV = (\frac{2}{3}\pi (10)(25))(0.1) + (\frac{1}{3}\pi (10)^2)(0.1)) (values for drdr and dhdh are bounds of error, so ±\pm is often implied).

        • The calculated volume is V=π(10)2(25)/3V = \pi (10)^2 (25) / 3 plus or minus dVdV. This provides an estimate of the error using a linear approximation.

  • Chain Rule

    • Motivation: To understand the rate of change of a function in terms of an indirect variable by compounding the rates of change of direct variables.

    • 1D Recall: If y=f(x)y = f(x) and x=g(t)x = g(t), then yy is a differentiable function of tt, and its derivative is given by the chain rule: (dydt=dydxdxdt)(\frac{dy}{dt} = \frac{dy}{dx} \frac{dx}{dt}).

    • Case 1: Two Intermediate Variables, One Independent Variable

      • Let Z=f(x,y)Z = f(x,y) where x=x(t)x = x(t) and y=y(t)y = y(t).

      • The chain rule for this case is: (dZdt=fxdxdt+fydydt)(\frac{dZ}{dt} = \frac{\partial f}{\partial x} \frac{dx}{dt} + \frac{\partial f}{\partial y} \frac{dy}{dt}).

      • This formula can be proven using limits of difference quotients, similar to the 1D case (though skipped in class).

      • Analogy to Total Differential: It resembles the total differential formula (dZ=fxdx+fydydZ = \frac{\partial f}{\partial x} dx + \frac{\partial f}{\partial y} dy), where effectively dxdx and dydy are replaced by dxdtdt\frac{dx}{dt}dt and dydtdt\frac{dy}{dt}dt and then divided by dtdt.

      • Example 1: Find dZ/dtdZ/dt for Z=x2y+3xy4Z = x^2y + 3xy^4, with x=sin(2t)x = \sin(2t) and y=cos(t)y = \cos(t) when t=0t=0.

        • Calculate partial derivatives of ZZ: Zx=2xy+3y4\frac{\partial Z}{\partial x} = 2xy + 3y^4 and Zy=x2+12xy3\frac{\partial Z}{\partial y} = x^2 + 12xy^3.

        • Calculate derivatives of xx and yy with respect to tt: dxdt=2cos(2t)\frac{dx}{dt} = 2\cos(2t) and dydt=sin(t)\frac{dy}{dt} = -\sin(t).

        • Evaluate x(0)=0x(0)=0 and y(0)=1y(0)=1.

        • Substitute into the chain rule formula: dZdt=(2(0)(1)+3(1)4)(2cos(0))+((0)2+12(0)(1)3)(sin(0))\frac{dZ}{dt} = (2(0)(1) + 3(1)^4)(2\cos(0)) + ((0)^2 + 12(0)(1)^3)(-\sin(0))

        • =(3)(2)+(0)(0)=6= (3)(2) + (0)(0) = 6.

      • Geometric Understanding: The path (x(t),y(t))(x(t), y(t)) in the XY-plane creates a curve on the surface Z=f(x,y)Z=f(x,y). The derivative dZ/dtdZ/dt represents the slope of the tangent vector to this curve on the surface.

      • Applied Example: Ideal Gas Law: Let P=f(T,V)P = f(T,V) from PV=NRTPV = NRT, assuming NR=8.31NR = 8.31, so P=8.31TVP = \frac{8.31T}{V}. Find the rate pressure changes (dP/dtdP/dt) given rates of change for temperature (dT/dtdT/dt) and volume (dV/dtdV/dt).

        • Chain Rule Formula: (dPdt=PTdTdt+PVdVdt)(\frac{dP}{dt} = \frac{\partial P}{\partial T} \frac{dT}{dt} + \frac{\partial P}{\partial V} \frac{dV}{dt}).

        • Calculate partial derivatives:

          • PT=8.31V\frac{\partial P}{\partial T} = \frac{8.31}{V}

          • PV=8.31TV2\frac{\partial P}{\partial V} = -\frac{8.31T}{V^2}

        • Plug in given values (e.g., V=100V=100, T=300T=300, dT/dt=0.1dT/dt=0.1, dV/dt=0.1dV/dt=0.1) into the formula.

    • Case 2: Two Intermediate Variables, Two Independent Variables

      • Let Z=f(x,y)Z = f(x,y) where x=x(s,t)x = x(s,t) and y=y(s,t)y = y(s,t).

      • This generalizes from Case 1 by treating one of the independent variables (ss or tt) as a constant when differentiating with respect to the other.

      • Formulas:

        • Zs=fxxs+fyys\frac{\partial Z}{\partial s} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial s} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial s} (treating tt as constant)

        • Zt=fxxt+fyyt\frac{\partial Z}{\partial t} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial t} (treating ss as constant)

      • Terminology: ZZ is the output/dependent variable; x,yx,y are intermediate variables; s,ts,t are independent variables.

    • General Case: Many Intermediate and Independent Variables

      • Let U=f(x<em>1,x</em>2,,x<em>n)U = f(x<em>1, x</em>2, \dots, x<em>n), where each intermediate variable x</em>ix</em>i is a function of multiple independent variables t<em>1,t</em>2,,t<em>mt<em>1, t</em>2, \dots, t<em>m (i.e., x</em>i=x<em>i(t</em>1,,tm)x</em>i = x<em>i(t</em>1, \dots, t_m)).

      • The chain rule for any partial derivative of UU with respect to an independent variable tjt_j is:

        • (Ut<em>j=</em>i=1nUx<em>ix</em>itj)(\frac{\partial U}{\partial t<em>j} = \sum</em>{i=1}^{n} \frac{\partial U}{\partial x<em>i} \frac{\partial x</em>i}{\partial t_j}).

      • This formula sums over all intermediate variables (xix_i) and covers all previous cases.

      • Terminology: UU is the output/dependent variable; x<em>1,,x</em>nx<em>1, \dots, x</em>n are intermediate variables; t<em>1,,t</em>mt<em>1, \dots, t</em>m are independent variables.