3.6 Implicit Differentiation

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

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

Acknowledgement: Thanks to Prof. Clay Ross for showing me how to use ContourPlot to produce these pictures.

Graphing Implicit Functions: Folium of Descartes

Stewart, Section 3.6

Let's plot the Folium of Descartes.
Start by graphing the surface f[x,y] = x^3 + y^3 - 6x y

Plot3D[x^3 + y^3 - 6x y, {x, -4, 4}, {y, -4, 4}, AxesLabel {x, y, z}] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_3.gif]

Here are some level curves of that surface - a kind of topographic map showing the lay of the land..

<<Graphics`Colors`

ContourPlot[x^3 + y^3 - 6x y, {x, -4, 4}, {y, -4, 4},      &n ... p;            PlotPoints100] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_6.gif]

And here is the Folium of Descartes -- the level curve at level 0.

ContourPlot[x^3 + y^3 - 6x y, {x, -4, 4}, {y, -4, 4},      &n ... p;            PlotPoints100] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_8.gif]

Let's make a transect of theough this region, over hill and dale, always keeping y = 2.

transect[x_] := x^3 + y^3 - 6x y /. y2 transect[x]

8 - 12 x + x^3

Plot[transect[x], {x, -4, 4}, PlotStyleOrange] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_12.gif]

Which points on this orange curve correspond to points on the Folium of Descartes?

Graphing Implicit Functions: Concoid of Nicomedes

Stewart, Exercise 3.6.18

Let's plot the Conchoid of Nicomedes.

ContourPlot[(y + 1)^2 (4 - y^2) - x ^2y^2, {x, -4, 4}, {y, -4, 4},    & ... p;            PlotPoints100] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_14.gif]

Implicit Differentiation Using Mathematica

This exercise is based on the development shown in Green, Evans, Johnson, "Exploring Calculus with Mathematica, to Accompany Calculus, by Hughes-Hallett, Gleason, et. al.," pages 127-129

Define y = y(x) by an equation it must satisfy, and then find dy/dx by implicit differentiation.

(* Suppose Sin[x + y] + (x^2 + y^2)^(1/2)  x y + 4  *)g[x_,  ... p;            PlotPoints100] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_16.gif]

Here is the curve we will study.

curvePlot = ContourPlot[g[x, y], {x, -4, 4}, {y, -10, 10},     &nb ... p;            PlotPoints100] ;

[Graphics:HTMLFiles/3.6_implicitDifferentiation_18.gif]

Now let's find dy/dx by implicit differentiation.

Clear[x, y, soln] ;  Print["Solve the equation ", D[g[x, y[x]], x], " == 0 for y'[x]."]  soln = Solve[D[g[x, y[x]], x]  0, y '[x]]

Solve the equation  -y[x] - x y^′[x] + Cos[x + y[x]] (1 + y^′[x]) + (2 x + 2 y[x] y^′[x])/(2 (x^2 + y[x]^2)^(1/2))  == 0 for y'[x].

{{y^′[x]  (-x - Cos[x + y[x]] (x^2 + y[x]^2)^(1/2) + y[x] (x^2 + y[x]^2)^(1/2))/(y[x] - x (x^2 + y[x]^2)^(1/2) + Cos[x + y[x]] (x^2 + y[x]^2)^(1/2))}}

Find dy/dx when x=2^(1/2) and y=-2^(1/2).

(1) First, verify that the point P(2^(1/2),-2^(1/2)) lies on the curve.

a = 2^(1/2) ; b = -2^(1/2) ;  g[a, b]

0

(2) Now evaluate y' at the point P(2^(1/2),-2^(1/2)).

soln rule = soln /. x  a /. y[a]  b

{{y^′[x]  (-x - Cos[x + y[x]] (x^2 + y[x]^2)^(1/2) + y[x] (x^2 + y[x]^2)^(1/2))/(y[x] - x (x^2 + y[x]^2)^(1/2) + Cos[x + y[x]] (x^2 + y[x]^2)^(1/2))}}

{{y^′[2^(1/2)]  (-2 - 3 2^(1/2))/(2 - 3 2^(1/2))}}

Tangent Lines for Implicit Functions

Find the equation of the tangent line to the previous graph at the point P(2^(1/2),-2^(1/2)).

m = y '[a] /.First[First[rule]] ;  t[x_] := m (x - a) + b Print["The tangent line has equation t[x] = ", t[x], "."]

The tangent line has equation t[x] =  -2^(1/2) + ((-2 - 3 2^(1/2)) (-2^(1/2) + x))/(2 - 3 2^(1/2))  .

Plot the tangent line on the same screen as the curve.

RowBox[{RowBox[{RowBox[{tanPlot,  , =,  , RowBox[{Plot, [, RowBox[{t[x], ,, RowBox[{{, RowBox[ ... RowBox[{{, RowBox[{Red, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Point[{a, b}]}], }}]}]}], ]}], ;}]

[Graphics:HTMLFiles/3.6_implicitDifferentiation_38.gif]

[Graphics:HTMLFiles/3.6_implicitDifferentiation_39.gif]

Use the tangent line to approximate the value of y when x = 1.5.

We calculated the tangent line at a = Sqrt[2], so let's first of all verify that 1.5 is pretty close to 2^(1/2).

N[a]

1.41421

Now, use the tangent line to the curve at x = 2^(1/2) to approximate the value of y when x = 1.5.

RowBox[{RowBox[{pt,  , =,  , 1.5}], ;}] approxVal = t[pt] ;  Print["The approximate value of y when x = 1.5 is ", approxVal, "."]

RowBox[{The approximate value of y when x = 1.5 is , , RowBox[{-, 1.17542}], , .}]

Finally, use the original equation to evaluate the accuracy of this last approximation.

Clear[val] ;  Print["Solve the equation \n", g[pt, val], " == 0 \nfor M ... imate value."]  mathApproxVal = val /. FindRoot[g[pt, val]  0, {val, t[pt]}]

RowBox[{Solve the equation \n, , RowBox[{-4, -, RowBox[{1.5,  , val}], +, RowBox[{RowB ... RowBox[{1.5, }], +, val}], ]}]}], ,  == 0 \nfor Mathematica's approximate value.}]

RowBox[{-, 1.18592}]

Calculate the relative accuracy of the tangent line approximation to y[1.5],
taking Mathematica's approximation as the best answer available at this stage.

relAccuracy = Abs[(approxVal - mathApproxVal)/mathApproxVal]

0.00885978

The relative difference is less than 0.89%


Created by Mathematica  (April 19, 2004)