Week 6 - Chain Rule

1. Differentiation Rules

1.1. The Chain Rule

  • Definition
    • If g is differentiable at x and f is differentiable at g(x), then the composite function F=fgF = f \circ g defined by F(x)=f(g(x))F(x) = f(g(x)) is differentiable at x and F' is given by the product F(x)=f(g(x))g(x)F'(x)=f'(g(x)) \cdot g'(x)

1.2. Implicit Differentiation

  • This consists of differentiating both sides of the equation with respect to x and then solving the resulting equation for y'.

  • Sample 1: x2+y2=25x^2+y^2=25, find ddxy\frac{d}{dx}y, and the tangent to the circle at point (3, 4).

      • ddx(x2+y2)=ddx(25)ddx(x2)+ddx(y2)=02x+2yddxy=0ddxy=xy\begin{aligned} \frac{d}{dx}(x^2+y^2) &= \frac{d}{dx}(25) \\ \frac{d}{dx}(x^2) + \frac{d}{dx}(y^2) &= 0 \\ 2x + 2y \cdot \frac{d}{dx}y &= 0 \\ \frac{d}{dx}y &= -\frac{x}{y} \end{aligned}
      • PS: y is a function of x and using the Chain Rule, we have ddx(y2)=ddy(y2)ddxy=2yddxy\frac{d}{dx}(y^2) = \frac{d}{dy}(y^2) \cdot \frac{d}{dx}y = 2y\frac{d}{dx}y
    • At the point (3, 4) we have x = 3 and y = 4, so ddxy=34\frac{d}{dx}y = -\frac{3}{4}
  • Sample 2: x3+y3=axyx^3+y^3=axy (folium of Descartes)
    • x3+y3=6xyx^3+y^3=6xy, find ddxy\frac{d}{dx}y
    • 3x2+3y2y=6xy+6yx2+y2y=2xy+2y(y22x)y=2yx2y=2yx2y22x\begin{aligned} 3x^2 + 3y^2y' &= 6xy' + 6y \\ x^2 + y^2y' &= 2xy' + 2y \\ (y^2 - 2x)y' &= 2y - x^2 \\ y' &= \frac{2y - x^2}{y^2 - 2x} \end{aligned}

1.3. Derivatives of Inverse Function

  • If f is a differentiable function, and f' is continuous, and f(a)0f'(a) \ne 0, then
    • f1(y)f^{-1}(y) is defined for y near f(a), f1f^{-1} is differentiable near f(a), (f1)(f^{-1})' is continuous near f(a), and (f1)(y)=1f(f1(y))(f^{-1})'(y)=\frac{1}{f'(f^{-1}(y))}
  • Sample: f(x)=x2 (x>0), f(x)=2xf1(x)=x(f1)(x)=1f(f1(x))=1f(x)=12x\begin{aligned} f(x) &= x^2\ (x>0),\ f'(x) = 2x \\ f^{-1}(x) &= \sqrt{x} \\ (f^{-1})'(x) &= \frac{1}{f'(f^{-1}(x))} = \frac{1}{f'(\sqrt{x})} = \frac{1}{2\sqrt{x}} \end{aligned}

1.4. Derivatives of Logarithmic Functions

  • Sample 1: f(x)=ex, f(x)=ex(proved in the end of week 5)f1(x)=logx(f1)(x)=1f(f1(x))=1f(logx)=1elogx=1x\begin{aligned} f(x) &= e^x,\ f'(x) = e^x \text{(proved in the end of week 5)} \\ f^{-1}(x) &= \log{x} \\ (f^{-1})'(x) &= \frac{1}{f'(f^{-1}(x))} = \frac{1}{f'(\log{x})} = \frac{1}{e^{\log{x}}} \\ &= \frac{1}{x} \end{aligned}
  • Sample 2: f(x)=logbxf(x)=ddxlogxlogb=1logbddxlogx=1logb1x=1xlogb\begin{aligned} f(x) &= \log_{b}{x} \\ f'(x) &= \frac{d}{dx}\frac{\log{x}}{\log{b}} = \frac{1}{\log{b}} \cdot \frac{d}{dx}\log{x} = \frac{1}{\log{b}} \cdot \frac{1}{x} \\ &= \frac{1}{x \cdot \log{b}} \end{aligned}
  • Sample 3: f(x)=bx=(elogb)x=elogbxf(x)=elogbxddx(logbx) (chain rules)=(elogb)xlogb=bxlogb\begin{aligned} f(x) &= b^x \\ &= (e^{\log{b}})^x = e^{\log{b} \cdot x} \\ f'(x) &= e^{\log{b} \cdot x} \cdot \frac{d}{dx}(\log{b} \cdot x)\ \text{(chain rules)} \\ &= (e^{\log{b}})^{\cdot x} \cdot \log{b} \\ &= b^x \cdot \log{b} \end{aligned}

Logarithmic Differentiation

  • The calculation of derivatives of complicated functions involving products, quotients, or powers can often be simplified by taking logarithms.
  • Sample: Differentiate f(x)=(1+x2)5(1+x3)8(1+x4)7f(x)=\frac{(1+x^2)^5 \cdot (1+x^3)^8}{(1+x^4)^7}, y=(1+x2)5(1+x3)8(1+x4)7logy=log(1+x2)5(1+x3)8(1+x4)7ddxlogy=ddxlog(1+x2)5(1+x3)8(1+x4)7ddxlogy=ddx(5log(1+x2)+8log(1+x3)7log(1+x4))1yddxy=5ddxlog(1+x2)+8ddxlog(1+x3)7ddxlog(1+x4)1yddxy=52x1+x2+83x21+x374x31+x4ddxy=(52x1+x2+83x21+x374x31+x4)(1+x2)5(1+x3)5(1+x4)7\begin{aligned} y &= \frac{(1+x^2)^5 \cdot (1+x^3)^8}{(1+x^4)^7} \\ \log{y} &= \log{\frac{(1+x^2)^5 \cdot (1+x^3)^8}{(1+x^4)^7}} \\ \frac{d}{dx}\log{y} &= \frac{d}{dx}\log{\frac{(1+x^2)^5 \cdot (1+x^3)^8}{(1+x^4)^7}} \\ \frac{d}{dx}\log{y} &= \frac{d}{dx}(5\log{(1+x^2)} + 8\log{(1+x^3)} - 7\log{(1+x^4)}) \\ \frac{1}{y} \cdot \frac{d}{dx}y &= 5\frac{d}{dx}\log{(1+x^2)} + 8\frac{d}{dx}\log{(1+x^3)} - 7\frac{d}{dx}\log{(1+x^4)} \\ \frac{1}{y} \cdot \frac{d}{dx}y &= 5\frac{2x}{1+x^2} + 8\frac{3x^2}{1+x^3} - 7\frac{4x^3}{1+x^4} \\ \frac{d}{dx}y &= (5\frac{2x}{1+x^2} + 8\frac{3x^2}{1+x^3} - 7\frac{4x^3}{1+x^4}) \cdot \frac{(1+x^2)^5 \cdot (1+x^3)^5}{(1+x^4)^7}\\ \end{aligned}

2. Justify the Derivative Rules

2.1. The Power Rule

  • ddxxn=nxn1\frac{d}{dx}x^{-n}=-nx^{-n-1}
    • Before, the power rule only apply for the real numbers, this formula apply for all rational numbers.
  • Use chain rules to find the derivative of f(x)=1xnf(x)=\frac{1}{x^n} :
    • First use the limit theorem to find the derivative of f(x)=1xf(x)=\frac{1}{x}: ddx1x=limh01x+h1xh=limh0xhxx(x+h)h=limh0hx(x+h)h=limh01x(x+h)=1x2\begin{aligned} \frac{d}{dx}\frac{1}{x} &= \lim_{h \to 0}\frac{\frac{1}{x+h}-\frac{1}{x}}{h} \\ &= \lim_{h \to 0}\frac{\frac{x-h-x}{x(x+h)}}{h} \\ &= \lim_{h \to 0}\frac{\frac{-h}{x(x+h)}}{h} \\ &= \lim_{h \to 0}\frac{-1}{x(x+h)} \\ &= -\frac{1}{x^2} \\ \end{aligned}
    • Then use chain rules to find the derivative of f(x)=1xnf(x)=\frac{1}{x^n}: ddx1xn=1(xn)2ddxxn=1(xn)2nxn1=nx2n+n1=nxn1\begin{aligned} \frac{d}{dx}\frac{1}{x^n} &= - \frac{1}{(x^n)^2} \cdot \frac{d}{dx}x^n \\ &= - \frac{1}{(x^n)^2} \cdot nx^{n-1} \\ &= - nx^{-2n+n-1} \\ &= - nx^{-n-1} \end{aligned}
  • Sample: Differentiate y=x2, (x>0)y=x^{\sqrt{2}},\ (x>0), logy=logx2ddxlogy=ddxlogx21yddxy=ddx2logx1x2ddxy=21xddxy=21xx2ddxy=2x21\begin{aligned} \log{y} &= \log{x^{\sqrt{2}}} \\ \frac{d}{dx}\log{y} &= \frac{d}{dx}\log{x^{\sqrt{2}}} \\ \frac{1}{y} \cdot \frac{d}{dx}y &= \frac{d}{dx}\sqrt{2}\log{x} \\ \frac{1}{x^{\sqrt{2}}} \cdot \frac{d}{dx}y &= \sqrt{2} \cdot \frac{1}{x} \\ \frac{d}{dx}y &= \sqrt{2} \cdot \frac{1}{x} \cdot x^{\sqrt{2}} \\ \frac{d}{dx}y &= \sqrt{2} \cdot x^{\sqrt{2}-1} \\ \end{aligned}

2.2. The Product Rule

  • Use logarithms to prove: f(x)>0, g(x)>0,log(f(x)g(x))=log(f(x))+log(g(x))ddxlog(f(x)g(x))=ddxlog(f(x))+ddxlog(g(x))1f(x)g(x)ddxf(x)g(x)=1f(x)ddxf(x)+1g(x)ddxg(x)ddxf(x)g(x)=g(x)ddxf(x)+f(x)ddxg(x)\begin{aligned} f(x) &> 0,\ g(x) > 0, \\ \log(f(x)g(x)) &= \log(f(x)) + \log(g(x)) \\ \frac{d}{dx} \log(f(x)g(x)) &= \frac{d}{dx} \log(f(x)) + \frac{d}{dx} \log(g(x)) \\ \frac{1}{f(x)g(x)} \cdot \frac{d}{dx}f(x)g(x) &= \frac{1}{f(x)} \cdot \frac{d}{dx}f(x) + \frac{1}{g(x)} \cdot \frac{d}{dx}g(x) \\ \frac{d}{dx}f(x)g(x) &= g(x) \cdot \frac{d}{dx}f(x) + f(x) \cdot \frac{d}{dx}g(x) \end{aligned}

2.3. The Quotient Rule

  • First we need to calculate the derivative of 1g(x)\frac{1}{g(x)} : we have proved this:f(x)=1x, f(x)=1x2so, ddx1g(x)=1(g(x))2g(x)\begin{aligned} \text{we have proved this:} f(x) &= \frac{1}{x},\ f'(x) = -\frac{1}{x^2} \\ so,\ \frac{d}{dx}\frac{1}{g(x)} &= - \frac{1}{(g(x))^2} \cdot g'(x) \end{aligned}

  • Then: ddxf(x)g(x)=ddx(f(x)1g(x))=f(x)1g(x)+f(x)(1(g(x))2g(x))=f(x)g(x)f(x)g(x)(g(x))2\begin{aligned} \frac{d}{dx}\frac{f(x)}{g(x)} &= \frac{d}{dx}(f(x) \cdot \frac{1}{g(x)}) \\ &= f'(x) \cdot \frac{1}{g(x)} + f(x) \cdot (- \frac{1}{(g(x))^2} \cdot g'(x)) \\ &= \frac{f'(x) \cdot g(x) - f(x) \cdot g'(x)}{(g(x))^2} \\ \end{aligned}

2.4. Proof the Chain Rule

  • Recall If y = f(x) and x changes from a to a + ∆x, we define the increment of y as Δy=f(a+Δx)f(a)\Delta y = f(a+\Delta x)-f(a). According to the definition of a derivative, we have limΔxoΔyΔx=f(a)\lim_{\Delta x \to o}\frac{\Delta y}{\Delta x}=f'(a). So if we denote by ϵ\epsilon the difference between the difference quotient and the derivative, we obtain limΔx0ϵ=limΔx0(ΔyΔxf(a))=f(a)f(a)=0\lim_{\Delta x \to 0}\epsilon = \lim_{\Delta x \to 0}(\frac{\Delta y}{\Delta x}-f'(a)) = f'(a)-f'(a) = 0. But ϵ=ΔyΔxf(a) Δy=f(a)Δx+ϵΔx \epsilon = \frac{\Delta y}{\Delta x}-f'(a)\ \Rightarrow \Delta y = f'(a)\Delta x + \epsilon \Delta x\ . If we define ϵ\epsilon to be 0 when ∆x = 0, then ϵ\epsilon become a continuous function of ∆x. Thus, for a differentiable function f, we can write Δy=f(a)Δx+ϵΔx where ϵ0 as Δx0\Delta y = f'(a)\Delta x + \epsilon \Delta x \text{ where } \epsilon \to 0\ as\ \Delta x \to 0 and ϵ\epsilon is a continuous function of ∆x. This property of differentiable functions is what enables us to prove the Chain Rule.
  • Now to Prove: Suppose u=g(x) is differentiable at a and y=f(u) is differentiable at b=g(a), If ∆x is an increment in x and ∆u and ∆y are corresponding increments in u and y, then we can use last equation to write Δu=g(a)Δx+ϵ1Δx=(g(a)+ϵ1)Δx\Delta u = g'(a)\Delta x + \epsilon_1\Delta x = (g'(a) + \epsilon_1)\Delta x where ϵ10\epsilon_1 \to 0 as Δx0\Delta x \to 0. Similarly Δy=f(b)Δu+ϵ2Δu=(f(b)+ϵ2)Δu\Delta y = f'(b)\Delta u + \epsilon_2\Delta u = (f'(b) + \epsilon_2)\Delta u where ϵ20\epsilon_2 \to 0 as Δx0\Delta x \to 0. If we now substitute the expression for ∆u, we get Δy=[f(b)+ϵ2][g(a)+ϵ1]Δx\Delta y = [f'(b) + \epsilon_2][g'(a) + \epsilon_1]\Delta x, so ΔyΔx=[f(b)+ϵ2][g(a)+ϵ1]\frac{\Delta y}{\Delta x} = [f'(b) + \epsilon_2][g'(a) + \epsilon_1] As Δx0\Delta x \to 0. So both ϵ20\epsilon_2 \to 0 and ϵ10\epsilon_1 \to 0 as Δx0\Delta x \to 0. Therefore dydx=limΔx0ΔyΔx=limΔx0[f(b)+ϵ2][g(a)+ϵ1]=f(b)g(a)=f(g(a))g(a)\begin{aligned} \frac{dy}{dx} &= \lim_{\Delta x \to 0}\frac{\Delta y}{\Delta x} = \lim_{\Delta x \to 0}[f'(b) + \epsilon_2][g'(a) + \epsilon_1] \\ &= f'(b)g'(a) = f'(g(a))g'(a) \end{aligned}. This prove the Chain Rule.

results matching ""

    No results matching ""