If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Implicit differentiation

Some relationships cannot be represented by an explicit function. For example, x²+y²=1. Implicit differentiation helps us find ​dy/dx even for relationships like that. This is done using the chain ​rule, and viewing y as an implicit function of x. For example, according to the chain rule, the derivative of y² would be 2y⋅(dy/dx). Created by Sal Khan.

Want to join the conversation?

  • leafers ultimate style avatar for user Jack
    Would this be considered multivariable calculus?
    (184 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user bruno.garcia
    Sorry, maybe it's a silly question, but how do we know when the variables are implicitly related? I mean, what would be an example of non-related variables?
    (134 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Mehrdad Ghods
      Actually it is an interesting question. Let's start with an example of non-related variables:
      Consider the function f value of which is dependent on value of x and y. For example f(x,y) = x + 3 * y where value of f(x,y) is dependent on values of x and y; however x or y are not necessarily dependent on each other.In such a function you can have a general df/dx and df/dy but you can't define a general dy/dx unless you define it based on a specific value of f(x,y).

      So, how can we know when the variables are implicitly related? Whenever you can show that changing one variable x necessarily leads to change in the other variable y to hold your equation valid you can say those two variables are related. In short you can define a general dy/dx or dx/dy

      This might be helpful if you are really into this:
      http://ocw.mit.edu/courses/mathematics/18-02-multivariable-calculus-fall-2007/index.htm
      (158 votes)
  • blobby green style avatar for user Enrico
    Am I the only one puzzled by the very first operation? I mean, applying the d/dx operator to both sides of the equation... is it legit? Does it preserve the equality? What's its meaning? Why does it lead to the result that we want(dy/dx of that relationship)?
    Maybe I don't fully understand WHY he does this operation...
    (108 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam blue style avatar for user Ethan Dlugie
      I understand your concerns. At first, it does seem a little sketchy to take the derivative of both sides of an equation. However, you are already familiar with this. If I established the equality y=x^2 and I asked, "What is the derivative?" you could easily tell me that dy/dx=2x. Notice, you took the derivative wrt. x of both sides: d/dx(y)=d/dx(x^2) -> dy/dx=2x
      Sal is allowed to solve for dy/dx as he does thanks to the chain rule. If I said 2y-2x=1 and I said find the derivative wrt. x, you would think that it is easy. Solve for y and take the derivative: dy/dx=1.
      Now I say, "take the derivative before solving for y". Alright:
      d/dx(2y-2x)=d/dx(1) -> 2*dy/dx-2=0 -> dy/dx=1. The reason that I could just continue with the notation "dy/dx" is because y is a function of x, but I don't know what exactly its relationship to x is. Therefore, I leave dy/dx as an abstract quantity.
      The real use of implicit differentiation is when you can't just solve for x. Say I have something weird like cos(x*y)=sin(x). I don't know about you, but I'm not sure how to solve in terms of x for that guy! So, we take the derivative:
      d/dx cos(x*y) = d/dx sin(x)
      dcos(x*y)/d(x*y) * d(x*y)/dx = cosx (I used chain rule on the left side)
      -sin(x*y) * (x*dy/dx+y*1) = cosx (I used product rule)
      x*dy/dx+y = -cosx/sin(x*y)
      dy/dx = ( -cosx/sin(x*y) - y) / x

      It's not pretty, but it sure works! The only setback with this is that the derivative is now in terms of both x and y. So, instead of just plugging in values of x, we have to plug in values of x and y (i.e. a coordinate on the original graph) to find the derivative at a point.
      Hope that helps!
      (156 votes)
  • blobby green style avatar for user Eric Robinson
    From to , Sal tries to explain that d/dx of y^2 is the same as d/dx of y(x)^2 and that this is an application of the chain rule. I am missing how y(x)^2 is a compound function for which the chain rule applies. What is the inside function and what is the outside function? Is dy^2/dy for the outside function?
    (30 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Just Keith
      Let me cover a little about the chain rule that is sometimes missed. When taking any derivative, we always apply the chain rule, but many times that is trivially true and just ignored. For example,

      d/dx (x²) actually involves the chain rule:
      d/dx(x²) = 2(x) (dx/dx) = 2x
      Of course, dx/dx = 1 and is trivial, so we don't usually bother with it.

      We do the same thing with y², only this time we won't get a trivial chain rule
      d/dx (y²) = d(y²)/dy (dy/dx) = 2y dy/dx

      Personally, I think using the y' and x' notation is easier for implicit differentiation. Here is the same computation using that notation:
      (Remember that x' = 1 and is almost always omitted, but I will write it just for clarity)
      x² + y² = 1
      2x(x') + 2y(y') = 0
      x(x') + y (y') = 0 ← I just divided by 2
      y(y') = −x(x')
      y' = −x(x') / y
      y' = -x/y
      (Of course, we wouldn't really bother writing x' since it is trivially equal to 1.)
      (97 votes)
  • blobby green style avatar for user Vivian Leung
    I don't quite understand the difference between d/dx and dy/dx. If we're taking the derivative of y with respect to x in this case, what was it that we were doing before? I'm really confused by these terms now...
    (41 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Creeksider
      The expression d/dx can be taken to mean "the rate of change with respect to x" of whatever follows it. So we can write, for example, d/dx x² = 2x. As another example, we can write d/dx y, and this would mean "the rate of change with respect to x of y." But it's more convenient to combine the d/dx and the y to write dy/dx, which means the same thing.

      y = x²
      d/dx y = d/dx x²
      dy/dx = 2x
      (62 votes)
  • blobby green style avatar for user Emily Phillips
    This might be a dumb question, but, it appears that finding the tangent line if a point on the unit circle is like finding either it's tangent or cotangent. Is that the case, is that why they're named the way they are?
    (26 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Gabriel Clark
    What about problems like (2y-x)/(y^2-3)=5
    I seem to be able to do the problems where I am using the product rule but when I get one of these I just cannot seem to get the correct answer. Can't find any examples anywhere for these types of problems.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Varun Raghavendra
    How can you consider y as a function of x? Because for every x, there are two y s. Isn't this contradictory to the definition of a function?
    (10 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Aztec Binaynay
    Sorry didn't start my calculus here in Khanacademy so I don't really know what the derivative notation Sal is using here... What does it mean to have derivative of something with respect to something?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user J E
      dy/dx is basically another way of writing y' and is used a lot in integral calculus. dy/dx is said to be taking the derivative of y with respect to x (sort of like 'solve for y in terms of x' - type terminology). So dy/dt would be taking the derivative of y with respect to t where t is your independent variable.
      Hope this helps!
      (11 votes)
  • leaf green style avatar for user Jason Pickles
    at about , when Sal is taking the derivative of y^2, why is he using the chain rule and not the power rule?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Creeksider
      He's using both. The chain rule is required here because we're differentiating with respect to x and the expression includes y. We're able to do this by treating y as a function of x. This means that y² is actually a composition of two functions: the squaring function applies to whatever function would turn x into y. We don't necessarily know what that function is, but that's okay, it's why we're doing implicit differentiation instead of normal (explicit) differentiation.
      (9 votes)

Video transcript

So we've got the equation x squared plus y squared is equal to 1. I guess we could call it a relationship. And if we were to graph all of the points x and y that satisfied this relationship, we get a unit circle like this. And what I'm curious about in this video is how we can figure out the slope of the tangent line at any point of this unit circle. And what immediately might be jumping out in your brain is, well a circle defined this way, this isn't a function. It's not y explicitly defined as a function of x. For any x value we actually have two possible y's that satisfy this relationship right over here. So you might be tempted to maybe split this up into two separate functions of x. You could say y is equal to the positive square root of 1 minus x squared. And you could say y is equal to the negative square root of 1 minus x squared. Take the derivatives of each of these separately. And you would be able to find the derivative for any x, or the derivative of the slope of the tangent line at any point. But what I want to do in this video is literally leverage the chain rule to take the derivative implicitly. So that I don't have to explicitly define y is a function of x either way. And the way we do that is literally just apply the derivative operator to both sides of this equation. And then apply what we know about the chain rule. Because we are not explicitly defining y as a function of x, and explicitly getting y is equal to f prime of x, they call this-- which is really just an application of the chain rule-- we call it implicit differentiation. And what I want you to keep in the back of your mind the entire time is that it's just an application of the chain rule. So let's apply the derivative operator to both sides of this. So it's the derivative with respect to x of x squared plus y squared, on the left hand side of our equation. And then that's going to be equal to the derivative with respect to x on the right hand side. I'm just doing the same exact thing to both sides of this equation. Now if I take the derivative of the sum of two terms, that's the same thing as taking the sum of the derivative. So this is going to be the same thing as the derivative with respect to x of x squared, plus the derivative with respect to x of y squared. I'm writing all my orange stuff first. So let's see. This is going to be x squared, this is going to be y squared. And then this is going to be equal to the derivative with respect to x of a constant. This isn't changing with respect to x. So we just get 0. Now this first term right over here, we have done many, many, many, many, many, many times. The derivative with respect to x of x squared is just the power rule here. It's going to be 2 times x to the first power. We could just say 2x. Now what's interesting is what we're doing right over here. The derivative with respect to x of y squared. And the realization here is to just apply the chain rule. If we're taking the derivative with respect to x of this something, we just have to take the derivative-- let me make it clear-- we're just going to take the derivative of our something. The derivative of y squared-- that's what we're taking, you can kind of view that as a function-- with respect to y and then multiply that times the derivative of y with respect to x. We're assuming that y does change with respect to x. y is not some type of a constant that we're writing just an abstract terms. So we're taking the derivative of this whole thing with respect to y. Once again, just the chain rule. And then we're taking the derivative of y with respect to x. It might be a little bit clearer if you kind of thought of it as the derivative with respect to x of y, as a function of x. This might be, or y is a function of x squared, which is essentially another way of writing what we have here. This might be a little bit clearer in terms of the chain rule. The derivative of y is a function of x squared with respect to y of x. So the derivative of something squared with respect to that something, times the derivative of that something, with respect to x. This is just the chain rule. I want to say it over and over again. This is just the chain rule. So let's do that. What do we get on the right hand side over here? And I'll write it over here as well. This would be equal to the derivative of y squared with respect to y, is just going to be 2 times y. 2 times y, just an application of the chain rule. And the derivative of y with respect to x? Well, we don't know what that is. So we're just going to leave that as times the derivative of y with respect to x. So let's just write this down over here. So we have is 2x plus the derivative of something squared, with respect to that something, is 2 times the something. In this case, the something is y, so 2 times y. And then times the derivative of y with respect to x. And this is all going to be equal to 0. Now that was interesting. Now we have an equation that has the derivative of a y with respect to x in it. And this is what we essentially want to solve for. This is the slope of the tangent line at any point. So all we have to do at this point is solve for the derivative of y with respect to x. Solve this equation. So let's do that. And actually just so we can do this whole thing on the same page so we can see where we started, let me copy and paste this up here. This is where we left off. And let's continue there. So let's say let's subtract 2x from both sides. So we're left with 2y times the derivative of y, with respect to x, is equal to-- we're subtracting 2x from both sides-- so it's equal to negative 2x. And if we really want to solve for the derivative of y with respect to x, we can just divide both sides by 2y. And we're left with the derivative of y with respect to x. Let's scroll down a little bit. The derivative of y with respect to x is equal to, well the 2s cancel out. We we're left with negative x over y. So this is interesting. We didn't have to us explicitly define y as a function of x here. But we got our derivative in terms of an x and a y. Not just only in terms of an x. But what does this mean? Well, if we wanted to find, let's say we wanted to find the derivative at this point right over here. Which, if you're familiar with the unit circle, so if this was a 45 degree angle, this would be the square root of 2 over 2 comma the square root of 2 over 2. What is the slope of the tangent line there? Well, we figured it out. It's going to be negative x over y. So the slope of the tangent line here is going to be equal to negative x. So negative square root of 2 over 2 over y. Over square root of 2 over 2, which is equal to negative 1. And that looks just about right.