Lecture 11 : Implicit differentiation For more on the graphs of functions vs. the graphs of general equations see Graphs of Functions under Algebra/Precalculus Review on the class webpage. For more on graphing general equations, see Coordinate Geometry. The graph of an equation relating 2 variables x and y is just the set of all points in the plane which satisfy the equation. We saw in Lecture 1 that in some equations relating x and y, we cannot solve for y uniquely in terms of x. For example if we take the equation x2 + y 2 = 25 and try to solve for y in terms of x, we get 2 new equations √ √ y = 25 − x2 and y = − 25 − x2 . The graph of the equation x2 + y 2 = 25 is a circle centered at the origin (0, 0) with radius 5 and the above two equations describe the upper and lower halves of the circle respectively. 6 x2 + y2 = 25 4 2 –5 5 –2 –4 6 4 4 2 f(x) = 25 – x2 2 –5 5 10 –5 –2 –4 5 10 –2 g(x) = – 25 – x2 –4 –6 –6 Now suppose we want to find the equation of the tangent to the circle at the point where x = 4 and y = 3. One method of solving the problem would be to √ √ 1. Solve for y in terms of x, (getting 2 equations y = 25 − x2 and y = − 25 − x2 .) √ 2. Decide which of these parts of the curve pass through the relevant point. (y = 25 − x2 ) 1 3. Take the derivative of y with respect to x for the equation describing that part of the curve −2x (y 0 = 1/2 √25−x 2) 4. Calculate the value of y 0 when x = 4 giving us the slope of the tangent (y 0 = −4/3) 5. Find the equation of the line with that slope through the point (4, 3). (y − 3) = −4/3(x − 4) . The above example was not difficult. However to apply the same method to find the tangent to the curve: 2(x2 + y 2 )2 = 25(x2 − y 2 ) when x = 3 and y = 1 would be much more difficult. (See Notes at the end) Implicit Differentiation There is a much easier method (called implicit differentiation) for finding such tangents thanks to the chain rule: If y is defined implicitly as a function of x by an equation relating x and y, we treat y as a differentiable function of x and proceed as follows: Implicit Differentiation 1. Differentiate both sides of the equation with respect to x, treating y as a differentiable function of x. 2. Collect the terms with y 0 (or dy ) dx on one side of the equation and solve for y 0 . Example Find the equation of a tangent to the circle x2 + y 2 = 25 when x = 4 and y = 3. Note that we do not have to solve for y in terms of x and the calculations involved are much less wearisome. In particular it applies to curves where solving for y in terms of x is very difficult. Both approaches for the example given below are compared at the end of the notes: Example Find the equation of a tangent line to the curve described by the equation 2(x2 + y 2 )2 = 25(x2 − y 2 ) when x = 3 and y = 1. 2 When using implicit differentiation it is important to keep the following in mind: dy dy 2 dxy = y0, = 2yy 0 , = y + xy 0 , dx dx dx where the middle identity follows from the chain rule and the one on the right follows from the product rule. dy Example Find dx = y 0 using implicit differentiation if y 5 + xy 4 = 2. (Please attempt to solve this before looking at the solution on the next page) √ √ d2 y x + y = 1. Example Find y 00 (or dx 2 ) using implicit differentiation if (Please attempt to solve this before looking at the solution on the next page) 3 d √ d1 √ ( x + y) = dx dx 1 −1/2 1 −1/2 dy x + y =0 2 2 dx Solving for dy , dx we bring the terms with dy dx to the left and all other terms to the right: 1 dy 1 =− √ √ 2 y dx 2 x √ multiplying both sides by 2 y, we get √ √ 2 y y dy = − √ = −√ . dx 2 x x To calculate y 00 = d dy ( ), dx dx we have " √ d(√y) √ d(√x) # " √ 1 dy # √ √y x[ 2√y dx ] − y[ 2√1 x ] − x y d dx √ √ 2 dx y 00 = − =− =− dx x x ( x) From above, we know that dy dx √ y = − √x . Substituting that into the expression for y 00 , we get "√ y 00 = − √ y x[ 2√1 y [− √x ]] − √ y[ 2√1 x ] x # . After cancellation and factoring −1/2 out of each term, we get y 00 = 1 [1 2 − x √ y √ ] x . dy Example Find dx by implicit differentiation if y sin(x2 ) = x sin(y 2 ). (Please attempt to solve this before looking at the solution on the next page) 4 Differentiating both sides with respect to x, we get d d (y sin(x2 )) = (x sin(y 2 )) dx dx Using the product rule on both sides, we get sin(x2 ) d(sin(x2 )) dx d(sin(y 2 )) dy +y = sin(y 2 ) + x dx dx dx dx Using the chain rule, we get sin(x2 ) dy dx2 dy 2 + y cos(x2 ) = sin(y 2 ) + x cos(y 2 ) dx dx dx Using the chain rule again, we get sin(x2 ) To solve for dy , dx dy dy + y cos(x2 )[2x] = sin(y 2 ) + x cos(y 2 )[2y] . dx dx we bring all of the terms with sin(x2 ) Factoring dy dx dy dx to the left hand side to get dy dy − 2xy cos(y 2 ) = sin(y 2 ) − 2xy cos(x2 ) dx dx out of every term on the left hand side, we get dy [sin(x2 ) − 2xy cos(y 2 )] = sin(y 2 ) − 2xy cos(x2 ). dx To solve for dy , dx we divide both sides by sin(x2 ) − 2xy cos(y 2 ), to get dy sin(y 2 ) − 2xy cos(x2 ) = . dx sin(x2 ) − 2xy cos(y 2 ) 5 Example The following curve is called the bouncing wagon. At what values of x does the graph have horizontal tangents? See full solution on next page. (Requires True Grit 6 ). We find y 0 and set it equal to 0. 2y 3 + y 2 − y 5 = x4 − 2x3 + x2 d d 4 [2y 3 + y 2 − y 5 ] = [x − 2x3 + x2 ] dx dx 6y 2 y 0 + 2yy 0 − 5y 4 y 0 = 4x3 − 6x2 + 2x y 0 [6x2 + 2y − 5y 4 ] = 4x3 − 6x2 + 2x y0 = 4x3 − 6x2 + 2x . 6x2 + 2y − 5y 4 When y 0 = 0, we have the numerator must equal 0 and 4x3 − 6x2 + 2x = 0 or x(4x2 − 6x + 2) = 0 so p √ 36 − 4(4)2 6± 4 6±2 1 = = = 1 or . x = 0 or x = ± 8 8 8 2 1 We have horizontal tangents at x = 0, x = 1 and x = 2 . 6± 7 Example (Not a good approach) Find the tangent to the curve: 2(x2 + y 2 )2 = 25(x2 − y 2 ) when x = 3 and y = 1. This curve describes a lemniscate, the graph is shown below. To apply our method from page 1 of today’s notes (wrong way to go), we solve for y in terms of x. we look at the equation as a quadratic equation in y 2 treating the x’s as constants, 2(y 4 ) + (4x2 + 25)y 2 + (2x4 − 25x2 ) = 0. We get 4 equations for y: s y=± −(4x2 + 25) ± p (4x2 + 25)2 − 8(2x4 − 25x2 ) . 4 Only two have graphs, since we cannot take the square root of negative numbers. The graphs are shown below. This is in fact an easy example, solving quartic polynomials (in y) is in general is difficult but there is a formula. With powers of 5 and above, there is no general formula. 8 Example Find the equation of a tangent line to the curve described by the equation 2(x2 + y 2 )2 = 25(x2 − y 2 ) when x = 3 and y = 1. d d [2(x2 + y 2 )2 ] = [25(x2 − y 2 )] dx dx 2 2 0 4(x + y )(2x + 2yy ) = 25(2x − 2yy 0 ) 8(x2 + y 2 )x + 8(x2 + y 2 )yy 0 = 50x − 50yy 0 8(x2 + y 2 )x − 50x = −8(x2 + y 2 )yy 0 − 50yy 0 [8(x2 + y 2 ) − 50]x = −[8(x2 + y 2 ) + 50]yy 0 [8(x2 + y 2 ) − 50]x = y0 −[8(x2 + y 2 ) + 50]y] When x = 3 and y = 1, we get [8(10) − 50]3 = y0 −[8(10) + 50]] or −9 90 = = y0 −130 13 The equation of the tangent at this point is (y − 1) = −9 (x − 3). 13 9