3.2 Product and Quotient Rules

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

Problems from James Stewart,
  "Calculus," Second Edition, Brooks/Cole, 2001

Mathematica knows the Product and Quotient Rules.

Stewart, section 3.2

"D" is the differentiation operator.

In[82]:=

Clear[f, g]  f[x] ; g[x] ;  Print["The derivative of the product f[x] g[x ... D[f[x] g[x], x]] Print["The derivative of the quotient f[x]/g[x] is ", D[f[x]/g[x], x]]

The derivative of the product f[x] g[x] is g[x] f^′[x] + f[x] g^′[x]

The derivative of the quotient f[x]/g[x] is f^′[x]/g[x] - (f[x] g^′[x])/g[x]^2

Well, that version of the quotient rule may not be what we expected.

In[87]:=

Print["The derivative of the quotient f[x]/g[x] is ", Simplify[D[f[x]/g[x], x]]]

The derivative of the quotient f[x]/g[x] is  (g[x] f^′[x] - f[x] g^′[x])/g[x]^2

That looks more familiar.

Calculate a Derivative.

Stewart, cf. exercise 3.2.15

Use Mathematica to define a certain function y[v] and to calculate its derivative.

In[88]:=

Clear[y, v]  y[v_] := (v^3 - 2v v^(1/2))/v^2 y[v]

Out[90]=

(-2 v^(3/2) + v^3)/v^2

In[91]:=

y '[v] Simplify[y '[v]]

Out[91]=

(-3 v^(1/2) + 3 v^2)/v^2 - (2 (-2 v^(3/2) + v^3))/v^3

Out[92]=

1 + 1/v^(3/2)

Find a Tangent Line.

Stewart, cf. exercise 3.2.20

Let's use Mathematica to define and graph a certain function y[x]
and then to find the equation of the tangent line to the graph of y at x = 2.

In[93]:=

<<Graphics`Colors`

In[94]:=

Clear[y, x, a, b, m]  y[x_] :=   x^(1/2)/(x^2 + 1)  Plot[y[x], {x, 0, 3},        PlotStyle  SapGreen] ;

[Graphics:HTMLFiles/3.2_prodQuoRules_13.gif]

Now, calculate the derivative of y.

In[97]:=

y '[x] Simplify[y '[x]]

Out[97]=

-(2 x^(3/2))/(1 + x^2)^2 + 1/(2 x^(1/2) (1 + x^2))

Out[98]=

(1 - 3 x^2)/(2 x^(1/2) (1 + x^2)^2)

Find the equation of the tangent line to the graph of y at x = 2.

In[99]:=

a = 2 ; b = y[2] m = y '[2]  Print["The equation of the tangent line is y =", m (x - a) + b]

Out[100]=

2^(1/2)/5

Out[101]=

1/(10 2^(1/2)) - (4 2^(1/2))/25

The equation of the tangent line is y =2^(1/2)/5 + (1/(10 2^(1/2)) - (4 2^(1/2))/25) (-2 + x)

Let's check that result by plotting y and its tangent line on the same screen.

In[103]:=

tan[x_] :=   m (x - a) + b ;  RowBox[{RowBox[{Plot, [, RowBox[{{y[x], tan[x] ... Box[{MediumSeaGreen, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{a, y[a]}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.2_prodQuoRules_22.gif]

How Many Tangent Lines to the Graph of y(x) Pass through P(1,2)?

Stewart, cf. exercise 3.2.37

How many tangent lines to the graph of y[x] pass through the point P(1,2) ?

In[105]:=

Clear[y, x, a]  y[x_] :=   x/(x + 1)  RowBox[{RowBox[{Plot, [, RowBo ... RowBox[{MediumSeaGreen, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{1, 2}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.2_prodQuoRules_24.gif]

From the picture, it seems evident that there should be two, corresponding to the two branches of the graph.
To be tangent to the graph of y[x], a line would have to have an equation of the form tan[x] = y'[a] (x - a) + y[a]
for some appropriate value of a.

In[108]:=

tan[x_] =   y '[a] (x - a) + y[a]

Out[108]=

a/(1 + a) + (-a/(1 + a)^2 + 1/(1 + a)) (-a + x)

Moreover,the tangent line must go through the point P(1,2), so that 2 = tan[1].
Let's set up that relationship.

In[109]:=

Solve[2  tan[1], a]

Out[109]=

{{a -2 - 3^(1/2)}, {a -2 + 3^(1/2)}}

Those are the two appropriate values of a.
Let's use them to calculate the two tangent lines.

In[110]:=

a1 = -2 - 3^(1/2) ; a2 = -2 + 3^(1/2) ;  tan1[x_] =   y '[a1] (x - a1) + y[a ... RowBox[{MediumSeaGreen, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{1, 2}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.2_prodQuoRules_30.gif]

One tangent line looks pretty convincing, and the other is at least plausible.
Extend the domain of x to the left to get a better image of the second line.

In[115]:=

RowBox[{RowBox[{Plot, [, RowBox[{{y[x], tan1[x], tan2[x]}, ,, {x, -10, 2}, ,, ,   ...  RowBox[{MediumSeaGreen, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{1, 2}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.2_prodQuoRules_32.gif]

The leftmost point of tangency is at x = a1.

In[116]:=

N[a1]

Out[116]=

RowBox[{-, 3.73205}]

Let's focus on that point.

In[117]:=

RowBox[{RowBox[{Plot, [, RowBox[{{y[x], tan1[x]}, ,, {x, a1 - 1, a1 + 1}, ,, ,  & ...  RowBox[{MediumSeaGreen, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{1, 2}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.2_prodQuoRules_36.gif]

Yup! Pretty convincing.


Created by Mathematica  (April 19, 2004)