Open in TheBrain

06 - Implicit differentiation, what's going on here?

3Blue1Brown

3.28M subscribers

SUBSCRIBED

Implicit differentiation can feel weird, but what's going on makes much more sense once you view each side of the equation as a two-variable function, f(x, y). Brought to you by you: http://3b1b.co/eoc6-thanksFull series: http://3b1b.co/calculusSeries like this one are funded largely by the community, through Patreon, where supporters get early access as the series is being produced.http://3b1b.co/support------------------ 3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with YouTube, if you want to stay posted about new videos, subscribe, and click the bell to receive notifications (if you're into that). If you are new to this channel and want to see more, a good place to start is this playlist: http://3b1b.co/recommendedVarious social media stuffs: Website: https://www.3blue1brown.comTwitter: https://twitter.com/3Blue1BrownPatreon: https://patreon.com/3blue1brownFacebook: https://www.facebook.com/3blue1brownReddit: https://www.reddit.com/r/3Blue1Brown

00:11

Let me share with you something I found particularly weird when I was a student first learning

00:15

calculus. Let’s say you have a circle with radius

00:18

5 centered at the origin of the xy-coordinate plane, which is defined using the equation

00:23

x2 + y2 = 52. That is, all points on this circle are a distance 5 from the origin, as

00:31

encapsulated by the pythagorean theorem with the sum of the squares of the legs of this

00:36

triangle equalling the square of the hypotenuse, 52.

00:40

And suppose you want to find the slope of a tangent line to this circle, maybe at the

00:45

point (x, y) = (3, 4). Now, if you’re savvy with geometry, you

00:50

might already know that this tangent line is perpendicular to the radius line touching

00:55

that point. But let’s say you don’t already know that, or that you want a technique that

01:00

generalizes to curves other than circles. As with other problems about slope of tangent

01:06

lines, they key thought here is to zoom in close enough that the curve basically looks

01:11

just like its own tangent line, then ask about a tiny step along that curve.

01:17

The y-component of that little step is what you might call dy, and the x-component is

01:21

a little dx, so the slope we’re looking for is the rise over run dy/dx.

01:28

But unlike other tangent-slope problems in calculus, this curve is not the graph of a

01:33

function, so we cannot take a simple derivative, asking about the size of a tiny nudge to the

01:39

output of a function caused by some tiny nudge to the input. x is not an input and y is not

01:46

an output in this case, they’re both just interdependent values related by some equation.

01:53

This is called an “implicit curve”; it’s just the set of all points (x, y) that satisfy

01:59

some property written in terms of the two variables x and y.

02:04

The procedure for finding dy/dx here is what I found very weird as a calculus student,

02:12

you take the derivative of both sides of this equation like this: For the derivative of

02:16

x2 you write 2xdx, similarly y2 becomes 2ydy, and the derivative of the constant 52 on the

02:26

right is 0. You can see why this feels strange, right?

02:32

What does it mean to take a derivative of an expression with multiple variables? And

02:36

why are we tacking on the little dy and dx in this way?

02:42

But if you just blindly move forward with what you get here, you can rearrange to find

02:48

an expression for dy/dx, which in this case comes out to -x/y.

02:56

So at a point with coordinates (x, y) = (3, 4), that slope would be -¾, evidently.

03:05

This strange process is called “implicit differentiation”. Don’t worry, I have

03:10

an explanation for how you can interpret taking a derivative of an expression with two variables

03:15

like this. But first, I want to set aside this particular

03:19

problem, and show how this is related to a different type of calculus problem: Related

03:24

rates.

03:26

Imagine a 5 meter long ladder up against a wall, where the top of the ladder starts of

03:32

4 meters above the ground, which, by the pythagorean theorem, means the bottom is 3 meters away

03:37

from the wall. And say it’s slipping down the wall in such

03:41

a way that the top of the ladder is dropping at 1 meter per second.

03:46

The question is, in that initial moment, what is the rate at which the bottom of the ladder

03:52

is moving away from the wall. It’s interesting, right? That distance from

03:57

the bottom of the ladder to the wall is 100% determined by the distance between the top

04:03

of the ladder and the floor, so we should have enough information to figure out how

04:07

the rates of change for each value depend on each other, but it might not be entirely

04:13

clear at first how to relate the two.

04:17

First thing’s first, it’s always nice to give names to the quantities we care about.

04:21

So label the distance from the top of the ladder to the ground y(t), written as a function

04:27

of time because it’s changing. Likewise, label the distance between the bottom of the

04:32

ladder and the wall x(t). They key equation here that relates these

04:36

terms is the pythagorean theorem: x(t)2 + y(t)2 = 52. What makes this equation powerful

04:46

is that it’s true at all points in time.

04:50

One way to solve this would be to isolate x(t), figure out what what y(t) must be based

04:57

this 1 meter/second drop rate, then take a derivative of the resulting function; dx/dt,

05:04

the rate at which x is changing with respect to time.

05:07

And that’s fine; it involves a couple layers of using the chain rule, and it will definitely

05:11

work for you. But I want to show a different way to think about the same thing.

05:17

This left-hand side of the equation is a function of time, right? It just so happens to equal

05:22

a constant, meaning this value evidently doesn’t change while time passes, but it’s still

05:28

written as an expression dependent on time which we can manipulate like any other function

05:33

with t as an input. In particular, we can take a derivative of

05:38

the left hand side, which is a way of saying “If I let a little bit of time pass, dt,

05:45

which causes y to slightly decrease, and x to slightly increase, how much does this expression

05:51

change”. On the one hand, we know that derivative should

05:55

be 0, since this expression equals a constant, and constants don’t care about your tiny

06:00

nudge to time, they remain unchanged. But on the other hand, what do you get by

06:05

computing the derivative of this left-hand-side? The derivative of x(t)2 is 2x(t)(the derivative

06:13

of x). That’s the chain rule I talked about last video. 2x*dx represents the size of a

06:20

change to x2 caused by a change to x, and we’re dividing by dt.

06:26

Likewise, the rate at which y(t)2 is changing is 2y(t)(the derivative of y).

06:35

Evidently, this whole expression must be zero, which is equivalent to saying x2+y2 doesn’t

06:43

change while the ladder moves. And at the very start, t=0, the height y(t)

06:49

is 4 meters, the distance x(t) is 3 meters, and since the top of the ladder is dropping

06:56

at a rate of 1 meter per second, that derivative dy/dt is -1 meters/second.

07:04

Now this gives us enough information to isolate the derivative dx/dt, which, when you work

07:09

it out, is (4/3) meters per second.

07:13

Now compare this to the problem of finding the slope of tangent line to the circle. In

07:22

both cases, we had the equation x2 + y2 = 52, and in both cases we ended up taking the derivative

07:29

of each side of this expression. But for the ladder problem, these expressions

07:34

were functions of time, so taking the derivative has a clear meaning: it’s the rate at which

07:40

this expression changes as time change. But what makes the circle situation strange

07:45

is that rather than saying a small amount of time dt has passed, which causes x and

07:50

y to change, the derivative has the tiny nudges dx and dy both just floating free, not tied

07:57

to some other common variable like time. Let me show you how you can think about this:

08:03

Give this expression x2 + y2 a name, maybe S.

08:08

S is essentially a function of two variables, it takes every point (x, y) on the plane and

08:14

associates it with a number. For points on this circle, that number is

08:19

  1. If you step off that circle away from the center, that value would be bigger. For

08:25

other points (x, y) closer to the origin, that value is smaller.

08:30

What it means to take a derivative of this expression, a derivative of S, is to consider

08:35

a tiny change to both these variables, some tiny change dx to x, and some tiny change

08:42

dy to y –and not necessarily one that keeps you on this circle, by the way, it’s just

08:47

some tiny step in any direction on the xy-plane– and ask how much the value of S changes. That

08:56

difference in the value of S, from the original point to the nudged point, is what I’m writing

09:02

as “dS”. For example, in this picture we’re starting

09:07

at a point where x is 3 and y is 4, and let’s just say that step dx is... -0.02, and that

09:17

dy is -0.01. Then the decrease to S, the amount the x2+y2 changes over that step, will be

09:27

around 2(3)(0.02) + 2(4)(0.01). That’s what this derivative expression 2xdx + 2ydy

09:40

means, it tells you how much the value x2+y2 changes, as determined by the point (x, y)

09:47

where you started, and the tiny step (dx, dy) that you take.

09:53

As with all things derivative, this is only an approximation, but it gets more and more

09:58

true for smaller and smaller choices of dx and dy.

10:02

The key point is that when you restrict yourself to steps along this circle, you’re essentially

10:08

saying you want to ensure that this value S doesn’t change; it starts at a value of

10:13

25, and you want to keep it at a value of 25; that is, dS should be 0.

10:20

So setting this expression 2xdx + 2ydy equal to 0 is the condition under which a tiny step

10:28

stays on the circle. Again, this is only an approximation. Speaking

10:33

more precisely, that condition keeps you on a tangent line of the circle, not the circle

10:39

itself, but for tiny enough steps those are essentially the same thing.

10:45

Of course, there’s nothing special about the expression x2+y2 = 52 here. You could

10:48

have some other expression involving x’s and y’s, representing some other curve,

10:49

and taking the derivative of both sides like this would give you a way to relate dx to

10:50

dy for tiny steps along that curve. It’s always nice to think through more examples,

10:52

so consider the expression sin(x)*y2 = x, which corresponds to many U-shaped curves

11:00

on the plane. Those curves represent all the points (x, y) of the plane where the value

11:08

of sin(x)*y2 equals the value of x. Now imagine taking some tiny step with components

11:19

(dx, dy), and not necessarily one that keeps you on the curve. Taking the derivative of

11:25

each side of this equation will tell us how much the value of that side changes during

11:30

this step. On the left side, the product rule that we

11:34

found in the last video tells us that this should be “left d-right plus right d-left”:

11:40

sin(x)(the change to y2), which is 2ydy, plus y2(the change to sin(x)), which is cos(x)dx.

11:52

The right side is simply x, so the size of a change to the value is exactly dx, right?

11:59

Setting these two sides equal to each other is a way of saying “whatever your tiny step

12:04

with coordinates (dx, dy) is, if it’s going to keep us on this curve, the values of both

12:10

the left-hand side and the right-hand side must change by the same amount.” That’s

12:15

the only way this top equation can remain true.

12:20

From there, depending on what problem you’re solving, you could manipulate further with

12:24

algebra, where perhaps the most common goal is to find dy divided by dx.

12:33

As one more example, let me show how you can use this technique to help find new derivative

12:41

formulas. I’ve mentioned in a footnote video that

12:43

the derivative of ex is itself, but what about the derivative of its inverse function the

12:48

natural log of x? The graph of ln(x) can be thought of as an

12:54

implicit curve; all the points on the xy plane where y = ln(x), it just happens to be the

13:02

case that the x’s and y’s of this equation aren’t as intermingled as they were in other

13:07

examples. The slope of this graph, dy/dx, should be

13:13

the derivative of ln(x), right? Well, to find that, first rearrange this equation

13:20

y = ln(x) to be ey = x. This is exactly what the natural log of x means; it’s saying

13:28

e to the what equals x. Since we know the derivative of ey, we can

13:34

take the derivative of both sides, effectively asking how a tiny step with components (dx,

13:40

dy) changes the value of each side. To ensure the step stays on the curve, the

13:47

change to the left side of the equation, which is ey*dy, must equals the change to the right

13:54

side, which is dx. Rearranging, this means dy/dx, the slope of

14:02

our graph, equals 1/ey. And when we’re on this curve, ey is by definition the same as

14:11

x, so evidently the slope is 1/x. An expression for the slope of the graph of

14:18

function in terms of x like this is the derivative of that function, so evidently the derivative

14:24

of ln(x) is 1/x.

14:33

By the way, all of this is a little peek into multivariable calculus, where you consider

14:38

functions with multiple inputs, and how they change as you tweak those inputs.

14:44

The key, as always, is to have a clear image in your head of what tiny nudges are at play,

14:50

and how exactly they depend on each other.

14:54

Next up, I’ll talk about about what exactly a limit is, and how it’s used to formalize

14:58

the idea of a derivative.

Attachments