3.5 The Chain Rule

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

Problems from James Stewart,
  "Calculus: Concepts and Contexts,"
  Second Edition, Brooks/Cole, 2001

Mathematica Understands the Chain Rule

Stewart, Section 3.5

Let's  declare two functions symbolically, and then take the derivative of their composition.

In[234]:=

Clear[f, g, x, y]  f[y] ; g[x] ;  Print["The derivative of f(g(x)) is ", D[f[g[x]], x], "."]

The derivative of f(g(x)) is f^′[g[x]] g^′[x]  .

The Derivative of a Certain Composition of Functions.

Stewart, cf. Exercise 3.5.31

Let's  find the equation of the tangent line to Cos[Cos[x]] at x = Pi/3.

In[238]:=

<<Graphics`Colors`

In[239]:=

Clear[f, x, a, b, m, tan]  f[x_] := Cos[Cos[x]] ;  RowBox[{RowBox[{Plot, [, Ro ... #62371;,          , PlotStyleRed}], ]}], ;}]

[Graphics:HTMLFiles/3.5_chainRule_5.gif]

In[242]:=

f '[x]

Out[242]=

Sin[x] Sin[Cos[x]]

In[243]:=

a = π/3 ; b = f[a] ; m = f '[a] ;  tan[x_] := m (x - a) + b ;  RowBox[{Ro ... [{{, RowBox[{Orchid, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{a, f[a]}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.5_chainRule_9.gif]

The Derivative of Another Composition of Functions.

Stewart, cf. Exercise 3.5.47

Let's  find the derivatives of f(exp(x)) and exp(f(x)) for an arbitrary differentiable function f.

In[248]:=

Clear[f, x]  f[x] ;  Print["The derivative of f(exp(x)) is ", D[f[Ex ... "."] Print["The derivative of exp(f(x)) is ", D[Exp[f[x]], x], "."]

The derivative of f(exp(x)) is ^x f^′[^x]  .

The derivative of exp(f(x)) is ^f[x] f^′[x]  .


Created by Mathematica  (April 19, 2004)