Lab 2, Math 151-02

IMPLICIT DIFFERENTIATION

Introduction

Goals : Learn to find the slope and tangent line to a plane curve at any point where its graph is smooth via the implicit differentiation.

Recall that a continuous function, y=f(x), defined on an open interval I is implicit in the equation                                                                                                                                                                       
                                                  (*)     F(x,y)=C,
provided that F(x,f(x))=C holds for all  x in I.

It is possible to find the derivative at a point on the graph of  (*)  without first solving the equation for y, by using a technique called  implicit differentiation. We return to  (*) and differentiate both sides of this equation with respect to x, viewing  y as a differentiable function of x, (applying the chain rule whenever differentiating a term involving y), and ultimately solve for ((dy)/(dx)). This procedure can be carried out by invoking the appropriate Mathematica commands.

Examples

Find the slope, m, of the tangent line to the graph of the cardioid with equation: (x^4)+(y^4)-4((y^3)+(x^2)+(x^2)y)+2(x^2)(y^2)=0 at the point P=(((2+(Sqrt[3]))/2),((2(Sqrt[3])+3)/2)).
First, we enter the expression defining the left-hand side of the cardioid equation and the point P.

cardioid=(x^4)+(y^4)-4((y^3)+(x^2)+(x^2)y)+2(x^2)(y^2)
p={(2+Sqrt[3])/2,(2Sqrt[3]+3)/2}

Next, we sketch a graph of the cardoid in the x y-coordinate plane using the Mathematica command ContourPlot. We also plot the position of the point P using the graphics primitive Point. These two graphs are created separately and then combined with the Show command.

cardioidplot=ContourPlot[cardioid==0,{x,-3,3},{y,-1,4},ContourStyle -> {Red, Thick},Axes -> True, Frame -> False];
pointplot=Graphics[{Text[Style["P",Green,14],p+{0.2,0.2}],{PointSize[Large],Green,Point[p]}}];
Show[cardioidplot,pointplot]

In order to be able to perform implicit differentiation we now tell Mathematica that y is actually a function of x using the substitution rule /.y->y[x]. We therefore redefine cardioid:

cardioid=cardioid/.y->y[x]

To differentiate the implicit equation of the cardioid with respect to x, we can use the D command.

cardioidImplicDiff=D[cardioid==0,x]

It is not difficult (for Mathematica) to solve this equation for y'[x]:

soln=Solve[cardioidImplicDiff,y'[x]]

Since the solution is presented to us as a set with only one member,  so we extract the relevant part this way:

yprime=y'[x]/.soln[[1]]

The point p has x-coordinate p[[1]] and y-component p[[2]], so the slope at that point can be found this way (using another set of substitution rules)

m=yprime/.{x->p[[1]],y[x]->p[[2]]}

This is a bit ugly, so let's try

m=Simplify[%]

With the slope and the point, we can write the tangent line as a function of x.

tangentline = m*(x-p[[1]])+p[[2]]

We plot the tangent line, using the same x-range and y-range as before, and combine it with the previous plot:

tangentplot=Plot[tangentline,{x,-3,3},PlotRange->{-1,4},PlotStyle->{Blue,Thick}];
Show[tangentplot,cardioidplot,pointplot]

Exercises

Exercise 2

For this exercise, you will work with the equation x cos(πy)=(((x+y))^2).

(a) Plot a graph of the equation for -8≤x≤8, -5≤y≤6.

(b) Verify that the point P=(((23+(Sqrt[129]))/12),-(5/3)) is on the graph of the equation, and that the point Q = (-2 , 3.2) is not on the graph of the equation.  

Big Hint: 
Solving the equation basically impossible, so don’t do that (although you can try if you like).  You don’t need to solve the equation; you just need to plug each point into the equation and simplify, and you will see whether or not it works.
(You can graph the point and the equation together, but remembering the lesson from last week, that isn’t enough to be sure that a point is really on the curve.)

(c) Use Mathematica to solve for (dy/dx), check this result by working the problem by hand.

(d) Find the slope of the tangent line to the graph of the equation at point P using Mathematica. Express this quantity as (1) an irrational number, then (2) find its decimal representation to ten significant digits (using Mathematica's N[ ] command). 

(e) Use Mathematica to plot a graph which shows that tangent line, together with the graph of the equation and the point P.

(f) Use Mathematica to solve the equation for x.  

(Bonus) Examine the part of the solution in the square root, simplify it a bit, and then use that to explain why the graph of the equation has  (3/2)<y<(5/2).