Implicit Differentiation and Implicit Tangents

by
K. D.  Stroyan
University of Iowa

copyright 1997 by Academic Press, Inc. - All rights reserved.

Special Mathematica Functions

Needs["Graphics`Colors`"];

Notebook Overview

Mathematica can compute implicit derivatives as follows.

References to the text

This NoteBook goes with Chapter 7 of the text, especially Sections 7.3 and 7.4.

Implicit Derivatives

Dt[]

The operator  Dt[] is a "total derivative" operation that differentiates with respect to all variables.  Try this:

\(Clear[a, b, c, x]; 
Dt[a\ x\^2 + b\ x + c]\)

We can also specify one variable as primary:

\(Clear[a, b, c, x]; 
Dt[a\ x\^2 + b\ x + c, x]\)

If we want Dt[] to treat some letters as parameters (or unknown constants), we do this:

\(Clear[a, b, c, x]; 

    Dt[	a\ x\^2 + b\ x + c, x, Constants -> {a, b, c}]\)

Example 7.5

The circle of radius  r  centered at the origin is the set of (x,y) points satisfying

(x^2) + (y^2) = (r^2)

For example, the circle of radius  5  has implicit equation

(x^2) + (y^2) = 25

We can plot this with the command

circle  =  
      ContourPlot[(x^2) + (y^2),  {x, -5, 5}, {y, -5, 5}, 
        ContourShading -> False,  Contours -> {25}, ContourStyle -> {Red}, 
        FrameLabel -> {"x", "y"}];

Mathematica can compute the derivative implicitly as follows:

\(Clear[x, y, dEq, dx, dy]; 

    dEq\  = \ Dt[\ x\^2 + y\^2 == 25, x] /. Dt[y, x] -> \(y'\)[x]\)

Solve[dEq, y'[x]]

The tangent line at (4,3)

The total differential itself can be used to plot the tangent to the circle.

Clear[x, y, dx, dy]; 
    dEq  =  Dt[ (x^2) + (y^2) == 25] /. {Dt[x] -> dx, Dt[y] -> dy}

At a specific point on the circle like  (x,y) = (4,3), we have

\(x\  = 4; y\  = \ 3; 
dEq\)

We change this to regular coordinates by replacing  dx with  (x-4)  and  dy  with  (y-3), so the tangent line is

8(x-4) + 6(y-3) == 0

This can be plotted as:

tanLine =  
      ContourPlot[8 (x - 4)  +  6 (y - 3), 
         {x, -5, 5}, {y, -5, 5}, ContourShading -> False,  
        Contours -> {0}, ContourStyle -> {Blue}, 
        FrameLabel -> {"x", "y"}];

Show[circle, tanLine];

Combined Implicit Tangents

Here is a combined program using the pieces above.

\(Clear[f, x, y, dx, dy]; 
f[x_, y_] := 3\ x\^2 + y\^2\/5; 

    Print["The equation ", f[x, y], "= c"]; 


    differential\  = \ Dt[f[x, y]] /. {Dt[x] -> dx, Dt[y] -> dy}; 

    Print["has differential  ", differential, " = 0"]; 

x\  = \ 1; 
    \ y\  = \ 2; 

    Print["at (x,y) = (", x, ",", y, "), f[x,y] = c = ", 
      f[x, y]]; 

    Print["and the differential is  ", differential, " = 0"]; 


    curve\  = \ 
      ContourPlot[
        f[x + dx, y + dy] - f[x, y], {dx, \(-3\), 7}, {dy, \(-7\), 3}, 
        ContourShading -> False, \ Contours -> {0}, PlotPoints -> 30, 
        ContourStyle -> {Red}, FrameLabel -> {"dx", "dy"}, 
        DisplayFunction -> Identity]; 


    tanLine\  = \ 
      ContourPlot[differential, {dx, \(-3\), 3}, {dy, \(-3\), 3}, 
        ContourShading -> False, \ Contours -> {0}, ContourStyle -> {Blue}, 
        FrameLabel -> {"dx", "dy"}, DisplayFunction -> Identity]; 


    Show[tanLine, curve, Graphics[{Brown, PointSize[0.05], Point[{0, 0}]}], 
      AspectRatio -> Automatic, DisplayFunction -> $DisplayFunction]; \)

Example 7.6

Clear[f, x, y, dx, dy]; f[x_, y_] := ((((x/2)))^2) + ((((y/3)))^2); 
    Print["The equation ", f[x, y], "= c"]; 
    differential = Dt[f[x, y]] /. {Dt[x] -> dx, Dt[y] -> dy}; 
    Print["has differential  ", differential, " = 0"]; x = (8/5); 
    y = (9/5); 
    Print["at (x,y) = (", x, ",", y, "), f[x,y] = c = ", 
      f[x, y]]; 
    Print["and the differential is  ", differential, " = 0"]; 
    curve = ContourPlot[
        f[x + dx, y + dy] - f[x, y], {dx, -5, 2}, {dy, -5, 2}, 
        ContourShading -> False, Contours -> {0}, 
        PlotPoints -> 30, ContourStyle -> {Red}, 
        FrameLabel -> {"dx", "dy"}, 
        DisplayFunction -> Identity]; 
    tanLine = 
      ContourPlot[differential, {dx, -1, 1}, {dy, -1, 1}, 
        ContourShading -> False, Contours -> {0}, 
        ContourStyle -> {Blue}, FrameLabel -> {"dx", "dy"}, 
        DisplayFunction -> Identity]; 
    Show[tanLine, curve, Graphics[{Brown, PointSize[0.05], Point[{0, 0}]}], 
      AspectRatio -> Automatic, 
      DisplayFunction -> $DisplayFunction];

Exercises

Exercise 7.2.1

Calculate the implicit total differentials of the implicit equations:

a

3 (x^2) + ((y^2)/5) == 1

b

x *y == 1

c

x + x*y == 2y

d

y + (Sqrt[y])  ==  x + (x^2)

e

(e^x)  ==  Log[y]

f

x == Sin[x*y]

g

x == Log[Cos[3 x+ 5 y]]

Exercise 7.2.2

Find the total differential and solve for y'[x] = dy/dx:

a

(x^2) - (y^2) == 3

b

y + (Sqrt[y]) == (1/x)

c

x*y == 4

d

y == Cos[x*y]

e

Sin[x] Cos[y] == (1/2)

f

y = Sin[x+y]

Exercise 7.3.1

Use implicit differentiation to plot the tangent line to

(((5  x))^2) -  (((4  y))^2) ==  9  at (x,y) = (1,1)