[00:10] Let me share with you something I found particularly [00:13] weird when I was a student first learning calculus. [00:16] Let's say you have a circle with radius 5 centered at the origin of the xy plane. [00:22] This is something defined with the equation x2 plus y2 equals 5 squared, [00:26] that is, all the points on the circle are a distance 5 from the origin as [00:30] encapsulated by the Pythagorean theorem, where the sum of the squares of [00:34] the two legs on this triangle equals the square of the hypotenuse, 5 squared. [00:40] And suppose you want to find the slope of a tangent line to the circle, [00:44] maybe at the point xy equals 3,4. [00:48] Now if you're savvy with geometry, you might already know that this [00:51] tangent line is perpendicular to the radius touching it at that point. [00:56] But let's say you don't already know that, or maybe you want a [00:59] technique that generalizes to curves other than just circles. [01:03] As with other problems about the slopes of tangent lines to curves, [01:07] the key thought here is to zoom in close enough that the curve basically [01:11] looks just like its own tangent line, and then ask about a tiny step along that curve. [01:17] The y component of that little step is what you might call dy, [01:21] and the x component is dx, so the slope we want is the rise over run, dy divided by dx. [01:28] But unlike other tangent slope problems in calculus, [01:31] this curve is not the graph of a function, so we can't just take a simple derivative, [01:36] asking about the size of some tiny nudge to the output of a function caused by some [01:41] tiny nudge to the input. [01:44] x is not an input, and y is not an output, they're both [01:47] just interdependent values related by some equation. [01:52] This is what's called an implicit curve, it's just the set of all points x, [01:58] y that satisfy some property written in terms of the two variables, x and y. [02:04] The procedure for how you actually find dy, dx for curves like [02:08] this is the thing I found very weird as a calculus student. [02:12] You take the derivative of both sides like this, for x squared you write 2x times dx, [02:19] and similarly y squared becomes 2y times dy, and then the derivative [02:24] of that constant 5 squared on the right is just 0. [02:29] Now you can see why this feels a little strange, right? [02:32] What does it mean to take the derivative of an expression that has multiple [02:37] variables in it, and why is it that we're tacking on dy and dx in this way? [02:42] But if you just blindly move forward with what you get, [02:46] you can rearrange this equation and find an expression for dy divided by dx, [02:51] which in this case comes out to be negative x divided by y. [02:56] So at the point with coordinates x, y equals 3, 4, [02:59] that slope would be negative 3 divided by 4, evidently. [03:05] This strange process is called implicit differentiation. [03:09] Don't worry, I have an explanation for how you can interpret [03:12] taking a derivative of an expression with two variables like this. [03:16] But first I want to set aside this particular problem and show how it's connected [03:20] to a different type of calculus problem, something called a related rates problem. [03:26] Imagine a 5 meter long ladder held up against a wall where the top [03:30] of the ladder starts 4 meters above the ground, [03:33] which by the Pythagorean theorem means that the bottom is 3 meters away from the wall. [03:39] And let's say it's slipping down in such a way that the top [03:42] of the ladder is dropping at a rate of 1 meter per second. [03:46] The question is, in that initial moment, what's the rate at [03:50] which the bottom of the ladder is moving away from the wall? [03:55] It's interesting, right? [03:56] That distance from the bottom of the ladder to the wall is 100% [04:00] determined by the distance from the top of the ladder to the floor. [04:05] So we should have enough information to figure out how the rates of [04:08] change for each of those values actually depend on each other, [04:12] but it might not be entirely clear how exactly you relate those two. [04:16] First things first, it's always nice to give names to the quantities that we care about, [04:21] so let's label that distance from the top of the ladder to the ground y of t, [04:25] written as a function of time because it's changing. [04:29] Likewise, label the distance between the bottom of the ladder and the wall x of t. [04:34] The key equation that relates these terms is the Pythagorean theorem, [04:39] x of t squared plus y of t squared equals 5 squared. [04:43] What makes that a powerful equation to use is that it's true at all points of time. [04:50] One way that you could solve this would be to isolate x of t, [04:54] and then figure out what y of t has to be based on that 1 m per second drop rate, [04:59] and you could take the derivative of the resulting function dx dt, [05:03] the rate at which x is changing with respect to time. [05:07] That's fine, it involves a couple layers of using the chain rule, [05:10] and it'll definitely work for you, but I want to show a different way that you can think [05:15] about the same problem. [05:17] This left hand side of the equation is a function of time, right? [05:21] It just so happens to equal a constant, meaning the value evidently doesn't change [05:26] while time passes, but it's still written as an expression dependent on time, [05:30] which means we can manipulate it like any other function that has t as an input. [05:36] In particular, we can take a derivative of this left hand side, [05:40] which is a way of saying if I let a little bit of time pass, some small dt, [05:45] which causes y to slightly decrease and x to slightly increase, [05:49] how much does this expression change? [05:53] On the one hand, we know that the derivative should be 0, [05:55] since the expression is a constant, and constants don't care about your tiny nudges in [06:00] time, they just remain unchanged. [06:03] But on the other hand, what do you get when you compute this derivative? [06:08] Well, the derivative of x of t squared is 2 times x of t times the derivative of x. [06:14] That's the chain rule that I talked about last video. [06:17] 2x dx represents the size of a change to x squared caused by some change to x, [06:23] and then we're dividing out by dt. [06:27] Likewise, the rate at which y of t squared is [06:30] changing is 2 times y of t times the derivative of y. [06:35] Now evidently, this whole expression must be 0, [06:38] and that's an equivalent way of saying that x squared plus y squared must not [06:42] change while the ladder moves. [06:45] At the very start, time t equals 0, the height, y of t, [06:49] is 4 meters, and that distance x of t is 3 meters. [06:54] And since the top of the ladder is dropping at a rate of 1 meter per second, [06:59] that derivative, dy dt, is negative 1 meters per second. [07:04] Now, this gives us enough information to isolate the derivative, dx dt, [07:08] and when you work it out, it comes out to be 4 thirds meters per second. [07:14] The reason I bring up this ladder problem is that I want you to compare [07:17] it to the problem of finding the slope of a tangent line to the circle. [07:22] In both cases, we had the equation x squared plus y squared equals 5 squared, [07:26] and in both cases we ended up taking the derivative of each side of this expression. [07:32] But for the ladder question, these expressions were functions of time, [07:36] so taking the derivative has a clear meaning, [07:38] it's the rate at which the expression changes as time changes. [07:43] But what makes the circle situation strange is that rather than saying that a small [07:48] amount of time dt has passed, which causes x and y to change, [07:52] the derivative just has these tiny nudges dx and dy just floating free, [07:56] not tied to some other common variable, like time. [08:01] Let me show you a nice way to think about this. [08:03] Let's give this expression x squared plus y squared a name, maybe s. [08:08] s is essentially a function of two variables. [08:11] It takes every point xy on the plane and associates it with a number. [08:16] For points on the circle, that number happens to be 25. [08:20] If you stepped off the circle away from the center, that value would be bigger. [08:25] For other points xy closer to the origin, that value would be smaller. [08:29] Now what it means to take a derivative of this expression, a derivative of s, [08:34] is to consider a tiny change to both of these variables, some tiny change dx to x, [08:40] and some tiny change dy to y, and not necessarily one that keeps you on the circle, [08:45] by the way, it's just any tiny step in any direction of the xy plane. [08:51] From there you ask how much does the value of s change? [08:56] That difference, the difference in the value of s before the nudge and after the nudge, [09:01] is what I'm writing as ds. [09:04] For example, in this picture we're starting off at a point where [09:09] x equals 3 and where y equals 4, and let's just say that the [09:15] step I drew has dx at negative 0.02 and dy at negative 0.01. [09:21] Then the decrease in s, the amount that x squared plus y squared changes over that step, [09:28] would be about 2 times 3 times negative 0.02 plus 2 times 4 times negative 0.01. [09:35] That's what this derivative expression, 2x dx plus 2y dy, actually means. [09:41] It's a recipe for telling you how much the value x squared plus y squared changes as [09:46] determined by the point xy where you start and the tiny step dx dy that you take. And [09:53] As with all things derivative, this is only an approximation, [09:56] but it's one that gets truer and truer for smaller and smaller choices of dx and dy. [10:02] The key point here is that when you restrict yourself to steps along the circle, [10:07] you're essentially saying you want to ensure that this value of s doesn't change. [10:12] It starts at a value of 25 and you want to keep it at a value of 25. [10:17] That is, ds should be 0. [10:20] So setting the expression 2x dx plus 2y dy equal to 0 is the condition [10:25] under which one of these tiny steps actually stays on the circle. [10:30] Again, this is only an approximation. [10:33] Speaking more precisely, that condition is what keeps you [10:36] on the tangent line of the circle, not the circle itself. [10:40] But for tiny enough steps, those are essentially the same thing. [10:45] Of course, there's nothing special about the expression [10:47] x squared plus y squared equals 5 squared. [10:50] It's always nice to think through more examples, [10:53] so let's consider this expression sin of x times y2 equals x. [10:58] This corresponds to a whole bunch of u-shaped curves on the plane. [11:02] And those curves, remember, represent all of the points xy where the [11:06] value of sine of x times y squared happens to equal the value of x. [11:16] Now imagine taking some tiny step with components dx and dy, [11:19] and not necessarily one that keeps you on the curve. [11:23] Taking the derivative of each side of this equation will tell [11:27] us how much the value of that side changes during the step. [11:32] On the left side, the product rule that we talked through last [11:35] video tells us that this should be left d right plus right d left. [11:39] That is sine of x times the change to y squared, which is 2y times dy, [11:44] plus y squared times the change to sine of x, which is cosine of x times dx. [11:52] The right side is simply x, so the size of a change to that value is exactly dx, [11:56] right? Now [11:59] setting these two sides equal to each other is a way of saying whatever your tiny [12:04] step with coordinates dx and dy is, if it's going to keep us on the curve, [12:09] the values of both the left hand side and the right hand side must change by the [12:14] same amount. [12:15] That's the only way this top equation can remain true. [12:20] From there, depending on what problem you're trying to solve, [12:23] you have something to work with algebraically, [12:26] and maybe the most common goal is to try to figure out what dy divided by dx is. [12:33] As a final example here, I want to show you how you can use this technique [12:37] of implicit differentiation to figure out new derivative formulas. [12:42] I've mentioned that the derivative of e to the x is itself, [12:46] but what about the derivative of its inverse function, the natural log of x? [12:50] Well the graph of the natural log of x can be thought of as an implicit curve. [12:56] It's all of the points xy on the plane where y happens to equal ln of x. [13:01] It just happens to be the case that the x's and y's of this [13:04] equation aren't as intermingled as they were in our other examples. [13:09] The slope of this graph, dy divided by dx, should be the derivative of ln of x, right? [13:16] Well to find that, first rearrange this equation [13:20] y equals ln of x to be e to the y equals x. [13:24] This is exactly what the natural log of x means, it's saying e to the what equals x. [13:31] Since we know the derivative of e to the y, we can take the derivative [13:35] of both sides here, effectively asking how a tiny step with [13:39] components dx and dy changes the value of each one of these sides. [13:44] To ensure that a step stays on the curve, the change to the left side of the equation, [13:50] which is e to the y times dy, must equal the change to the right side, [13:54] which in this case is just dx. [13:57] Rearranging, that means dy divided by dx, the slope of our graph, [14:03] equals 1 divided by e to the y. [14:06] When we're on the curve, e to the y is by definition the same thing as x, [14:11] so evidently this slope is 1 divided by x. [14:15] And of course, an expression for the slope of a graph of a function [14:19] written in terms of x like this is the derivative of that function, [14:24] so evidently the derivative of ln of x is 1 divided by x. [14:32] By the way, all of this is a little sneak peek into multivariable calculus, [14:37] where you consider functions that have multiple inputs and how [14:40] they change as you tweak those multiple inputs. [14:44] The key, as always, is to have a clear image in your head of what [14:48] tiny nudges are at play, and how exactly they depend on each other. [14:54] Next up, I'm going to be talking about limits, [14:56] and how they're used to formalize the idea of a derivative. [15:17] Thank you.