📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Implicit differentiation, what's going on here? | Chapter 6, Essence of calculus

3Blue1Brown15:34

Transcription

Let me share something that I found particularly strange when I was a student learning calculus for the first time.

Suppose you have a circle with a radius of 5 centered at the origin of the xy-plane. This is expressed by the equation x squared plus y squared equals 5 squared, meaning that all points on the circle are 5 units away from the origin, as understood from the Pythagorean theorem, where the sum of the squares of the legs of this triangle equals the square of the hypotenuse, 5 squared.

Now, suppose you want to find the slope of a tangent line to the circle, perhaps at the point (x, y) equals (4, 3). If you are an expert in geometry, you might already know that this tangent line is perpendicular to the radius that touches the circle at that point. But let’s assume you don’t actually know that, or maybe you want a method that generalizes to curves other than just circles.

As with other problems related to the slope of tangent lines to curves, the basic idea here is to zoom in enough so that the curve essentially looks like its tangent line, and then ask about a small step along this curve. The y-component of this small step is what we can call dy, and the x-component is dx. So, the slope we want is the vertical change divided by the horizontal change, that is, dy divided by dx.

However, unlike other tangent slope problems in calculus, this curve is not a graph of a function, so we cannot simply find the derivative, which asks about the simple change in the function's output resulting from a small change in its input. Here, x is not an input and y is not an output; rather, both are dependent on each other and are related by some equation. This is called an implicit curve, which is just a set of points (x, y) that satisfy a property (or condition, such as an equation) written in terms of the variables x and y.

The procedure for finding dy and dx for such curves is what I found very strange when I was a student studying calculus. You take the derivative of both sides like this: for x squared, you write 2x in dx, and similarly, y squared becomes 2y in dy, and then the derivative of that constant 5 squared on the right is 0.

Now you can see why this seems a bit strange, right? What does it mean to differentiate a mathematical expression that contains multiple variables, and why do we handle dy and dx this way? But if you blindly continue with what you have, you can rearrange this equation and find an expression for dy divided by dx, which in this case becomes negative x divided by y.

So at the point with coordinates (x, y) equal to (4, 3), this slope will be negative 3 divided by 4, clearly. This strange process is called implicit differentiation. And don’t worry, I have an explanation for how to interpret the differentiation of an expression with two variables like this.

But first, I want to set this problem aside and show how it relates to a different type of calculus problem, known as related rates problems. Imagine a ladder 5 meters long leaning against a wall, where the top of the ladder starts at a height of 4 meters above the ground, which means, according to the Pythagorean theorem, that the bottom of the ladder is 3 meters away from the wall.

Now suppose it slides down in such a way that the top of the ladder drops at a rate of 1 meter per second. The question is, at that initial moment, what is the rate at which the bottom of the ladder is moving away from the wall? It’s interesting, isn’t it? We can find the distance from the bottom of the ladder to the wall as 100% dependent on the distance from the top of the ladder to the ground.

So we should have enough information to know how the rates of change of each of these values depend on each other, but it may not be entirely clear how these two values are connected. The first is of lesser priority. It’s always good to give names to the quantities we care about, so let’s call that distance from the top of the ladder to the ground y(t), written as a function of time as it changes. Similarly, name the distance from the bottom of the ladder to the wall x(t).

The main equation that relates these terms is the Pythagorean theorem: x(t) squared plus y(t) squared equals 5 squared. What makes this equation powerful for use is that it is true at all times. One way you can solve this problem is to isolate x(t), then find what y(t) must be based on the falling rate of 1 meter per second, and you can get the derivative of the resulting function dx/dt, the rate at which x changes with respect to time.

That’s fine; it involves two layers of using the chain rule, and it will definitely work for you, but I want to clarify a different way you can think about the same problem. This left side of the equation is a function of time, isn’t it? It equals a constant, meaning the value does not change over time, but it is still written as an expression dependent on time, which means we can treat it like any other function with t as an input.

In particular, we can differentiate this left side, which is a way of saying, if you let a little time pass, a small amount of time dt, leading to a slight decrease in y and a slight increase in x, what is the change in this expression? On one hand, we know that this derivative must be 0, since the expression is constant, and constants do not care about those small changes in time; they remain constant.

But on the other hand, what do you get when you compute this derivative? Well, the derivative of x(t) squared is 2 times x(t) times the derivative of x. This is the chain rule I mentioned in the last video. 2x dx, x squared resulting from a change in x, and then we divide by dt, representing the size of the change with respect to time. Similarly, the rate at which y(t) squared changes is 2y times the derivative of y.

Now, it’s clear that this entire expression must equal 0, and this is an equivalent way of saying that x squared plus y squared must not change while the ladder moves. Initially, time t equals 0, the height y(t) is 4 meters, and that distance x(t) is 3 meters. Since the top of the ladder drops at a rate of 1 meter per second, the derivative dy/dt equals negative 1 meter per second.

Now, this gives us enough information to isolate the derivative dx/dt, and when you compute it, it becomes 4/3 meters per second. The reason I brought up this ladder problem is that I want you to compare it to the problem of finding the slope of a tangent line to the circle. In both cases, we had the equation x squared plus y squared equals 5 squared, and in both cases, we ended up finding the derivative of both sides of this expression.

But for the ladder question, these expressions were functions of time, so finding the derivative makes clear sense: it’s the rate at which the mathematical expression changes with time. But what makes the circle situation strange is that instead of saying that a small amount of time dt has passed, causing changes in x and y, the derivative only contains these small changes, dx and dy, floating free, not tied to another common variable, like time.

Let me show you a nice way to think about this. Let’s give this expression x squared plus y squared a name, perhaps s. s is essentially a function of two variables. This function takes every point (x, y) in the plane and associates it with a number. For the points on the circle, it just so happens that this number is 25. If you move away from the circle, that value will be larger. For other points (x, y) close to the center, that value will be smaller.

Now, what it means to find the derivative of this expression (that is, the derivative of s) is to think about a small change in both of these variables, a small change from dx to x, and a small change from dy to y, not necessarily a change that keeps you on the circle, by the way; it’s just a small step in any direction from the xy-plane.

From here, you ask, by how much does the value of s change? And this difference, the difference in the value of s before the push and after the push, is what I denote as ds. For example, in this picture, we start at a point where x equals 3 and where y equals 4, and let’s just say that the step I drew has dx at negative 0.02 and dy at negative 0.01.

So the decrease in s—meaning the amount by which x squared plus y squared changes—during that step will be approximately 2 times 3 times negative 0.02 plus 2 times 4 times negative 0.01. This is what this derivative -2x dx plus 2y dy really means. It’s a recipe to tell you how much the value of x squared plus y squared changes as defined by the point (x, y) where you start and the small step dx dy you take.

And as with all things derivative, this is just an approximate estimate, but it becomes more accurate the smaller values you choose for dx and dy. The key point here is that when you restrict yourself to steps along the circle, you are essentially saying you want to ensure that the value of s does not change. You start with a value of 25 and want to keep it at 25. This means that ds must be 0.

So setting the expression 2x dx plus 2y dy equal to 0 is the condition under which one of these small steps actually stays on the circle. Again, this is just an approximate estimate. More precisely, this condition is what keeps you on the tangent line of the circle, not the circle itself. But for small enough steps, these are essentially the same thing.

Of course, there’s nothing special about the expression x squared plus y squared equals 5 squared. It’s always good to think of more examples, so let’s consider this expression sin x in y squared equals x. This represents a whole set of U-shaped curves in the plane.

And remember that these curves represent all the points (x, y) where the value of sin x in y squared equals the value of x. Now imagine taking some small steps that have components dx dy, not necessarily those that keep you on the curve. Taking the derivative of both sides of this equation will tell us how the value of this side changes during the step.

On the left side, the product rule we talked about in the last video tells us that this must be the left side times d(right) plus right times d(left). This is sin x multiplied by the change in y squared—which is 2y dy—plus y squared multiplied by the change in sin x, which is cos x dx. The right side is simply x, so the amount of change in that value is dx exactly, right?

Now, making these two sides equal to each other is a way of saying that whatever your small step with coordinates dx and dy is, if it keeps us on the curve, the values of both the left side and the right side must change by the same amount. That’s the only way this equation at the top can remain true.

From there, depending on the problem you are trying to solve, you have something to work with algebraically, and perhaps the most common goal is to try to find the value of dy divided by dx.

As a final example here, I want to show you how you can use this implicit differentiation method to find new derivative rules. I mentioned that the derivative of e to the x is itself, but what about the derivative of its inverse function, the natural logarithm of x?

Well, the graph of the natural logarithm of x can be considered an implicit curve. It’s all the points (x, y) in the plane where y equals ln x. It just so happens that the values of x and y in this equation are not intertwined as they were in the other examples. The slope of this graph, dy divided by dx, must be the derivative of ln(x), right?

Well, to find that, first rearrange this equation y = ln(x) to become e to the y equals x. This is exactly what the natural logarithm of x means; it says e to what power equals x. And since we know the derivative of e to the y, we can differentiate both sides here, essentially asking how a small step with components dx and dy changes the value of each side of these sides.

To ensure the step stays on the curve, the change in the left side of the equation—which is e to the y in dy—must equal the change in the right side, which in this case is just dx. Rearranging means that dy divided by dx—the slope of this graph—equals 1 divided by e to the y.

And when we are on the curve, e to the y and x are the same thing by definition, so it’s clear that this slope is 1 divided by x. And of course, expressing the slope of the graph of a function written in terms of x like this is the derivative of that function, so it’s clear that the derivative of ln x is 1 divided by x.

By the way, all of this is just a glimpse into multivariable calculus, where you consider functions with multiple inputs and how they change when you change those multiple inputs. The key, as always, is to have a clear picture in your head of the small changes happening and how each one depends on the others exactly.

In the next episode, I will talk about limits and how to use them to formalize the idea of the derivative. Thank you.