Open in TheBrain

03 - Derivative formulas through geometry

3Blue1Brown

3.28M subscribers

SUBSCRIBED

A few derivative formulas, such as the power rule and the derivative of sine, demonstrated with geometric intuition. Brought to you by you: http://3b1b.co/eoc3-thanksAnd by Brilliant: https://brilliant.org/3b1bGreat video by Think Twice showing this geometric view of the derivative of sin(x)https://youtu.be/R4o7sraVMZgMusic:[https://vincerubinetti.bandcamp.com/a...](https://youtu.be/R4o7sraVMZg)Music:https://vincerubinetti.bandcamp.com/a...------------------ 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

Now that we've seen what a derivative means, and what it has to do with rates of change.

00:16

Our next step is to learn how to actually compute these guys, as in if I give you some kind of function

00:21

with an explicit formula you'd want to be able to find what the formula for its derivative is.

00:25

Maybe it's obvious, but I think it's worth stating explicitly why this is an important thing

00:31

to be able to do. Why much of a calculus students time ends up going towards grappling with

00:36

derivatives of abstract functions rather than thinking about concrete rate of change problems,

00:41

Is because a lot of real-world phenomena. The sort of things that we want to use calculus

00:46

to analyze are modeled using polynomials, trigonometric functions, exponential's

00:51

and other pure functions like that. So if you build up some fluency with the ideas

00:56

of rates of change for those kinds of pure abstract functions. It gives you a language to more

01:01

readily talk about the rates at which things change in concrete situations that you might be

01:05

using calculus to model. But it is way too easy for this process to feel like just memorizing a list

01:12

of rules. And if that happens, if you get that feeling it's all so easy to lose sight of the fact that

01:17

derivatives are fundamentally about just looking at tiny changes to some quantity,

01:20

and how that relates to a resulting tiny change in another quantity. So in this video

01:25

and in the next one, my aim is to show you how you can think about a few of these rules intuitively

01:29

and geometrically. And I really want to encourage you to never forget that tiny nudges

01:34

are at the heart of derivatives. let's start with a simple function like f(x) = x2, what if I asked

01:42

you it's derivative. That is if you were to look at some value x like x = 2 and compare it to a value

01:48

slightly bigger, just dx bigger. What's the corresponding change in the value of the

01:53

function df, and in particular what's df divided by dx - The rate at which this function is changing

02:00

per unit change in x as a first step for intuition. We know that you can think of this ratio df/dx

02:07

as the slope of a tangent line to the graph of x2, and from that you can see that the slope

02:13

generally increases as x increases. At 0 the tangent line is flat so the slope is 0 at x = 1.

02:19

That's something a bit steeper at x = 2, it's steeper still but looking at graphs isn't generally the

02:27

best way to understand the precise formula for a derivative, for that it's best to take

02:32

a more literal look at what x2 actually means. And in this case let's go ahead and picture a square

02:37

whose side length is x if you increase x by some tiny nudge, some little dx.

02:43

What's the resulting change in the area of that square, that slight change, in area

02:48

is what df means in this context. It's the tiny increase to the value of f(x) = x2 caused by

02:56

increasing x by that tiny nudge dx. Now you can see that there's three new bits of area in this diagram, two thin

03:03

rectangles and a miniscule square. The two thin rectangles each have side lengths of x and dx

03:08

so they account for two times x * dx units of new area. For example let's say x was 3 and dx was 0.01.

03:17

Then that new area from these two thin rectangles would be 2 * 3 * 0.01 which is 0.06,

03:23

about 6 times the size of dx. That little square there has an area of dx2, but you should

03:27

think of that as being really tiny, negligibly tiny. For example, if dx was 0.01, that would be only 0.0001.

03:38

And keep in mind, I'm drawing DX with a fair bit of width here just so we can actually

03:47

see it, but always remember - in principle dx should be thought of as a truly tiny amount

03:53

and for those truly tiny amounts. A good rule of thumb is that you can ignore anything that includes a dx

03:59

raised to a power greater than 1. That is a tiny change squared is a negligible change what this leaves us with

04:07

is that df is just some multiple of dx, and that multiple 2x which you could also write as df/dx

04:15

is the derivative of x2. For example, if you were starting at x = 3, then as you slightly increase x

04:23

the rate of change in the area per unit change in length added dx2/dx would be 2 * 3 or 6.

04:31

And if instead you were starting at x = 5, the rate of change would be ten units of area per unit change in x.

04:40

Let's go ahead and try a different simple function f(x) = x3. This is going to be the geometric view

04:47

of the stuff that I went through algebraically in the last video. What's nice here is that we can think of x3

04:52

as the volume of an actual cube, whose side lengths are x. And when you increase x by a tiny nudge, a tiny dx

05:00

the resulting increase in volume is what I have here in yellow. That represents all the volume in a cube

05:07

with side lengths x plus dx. That's not already in the original cube, the one with side length x.

05:12

It's nice to think of this new volume as broken up into multiple components, but almost all of it comes

05:18

from these three square faces, or set a little more precisely as dx approaches zero.

05:22

Precisely as dx approaches zero, those three squares comprise a portion closer and closer to 100%

05:29

of that new yellow volume. Each of those thin squares has a volume of x2 * dx,

05:38

the area of the face times that little thickness dx. So in total this gives us 3x2 dx of volume change.

05:46

And to be sure there are other slivers of volume here, along the edges, and that tiny one in the corner. But all

05:52

of that volume is going to be proportional to dx2 or dx3 so we can safely ignore them.

05:58

Again this is ultimately because they're going to be divided by dx, and if there's still any dx remaining

06:05

then those terms aren't going to survive the process of letting dx approach 0. What this means is

06:12

that the derivative of x3, the rate at which x3 changes per unit change of x is 3x2.

06:20

What that means in terms of graphical intuition is that the slope of the graph of x3

06:25

at every single point x is exactly 3x2. And reasoning about that slope, it should make sense

06:36

that this derivative is high on the left, and then zero at the origin, and then high again as you move to the right.

06:43

But just thinking in terms of the graph would never have landed us on the precise quantity 3x2.

06:48

For that we had to take a much more direct look at what x3 actually means now in practice.

06:55

You wouldn't necessarily think of the square every time you're taking the derivative of x2. Nor would

07:00

you necessarily think of this cube whenever you're taking the derivative of x3, both of them fall under a pretty

07:06

recognizable pattern for polynomial terms the derivative of x4 turns out to be 4x3. The derivative

07:13

of x5 is 5x4. The derivative of x to the n for any power n is nx(n-1).

07:26

This right here is what's known in the business as the power rule. In practice

07:32

we all quickly just get jaded and think about this symbolically as the exponent

07:36

hopping down in front leaving behind one less than itself. Rarely pausing to think about the

07:41

geometric delights that underlie these derivatives. That's the kind of thing

07:46

that happens when these tend to fall in the middle of much longer computations.

07:49

But rather than tracking it all off to symbolic patterns let's just take a moment and think about why this works.

07:55

For powers beyond just 2 and 3 when you nudge that input x, increasing it slightly to x + dx, working out the

08:03

exact value of that nudged output would involve multiplying together these n separate x + dx terms.

08:10

The full expansion would be really complicated but part of the point of derivatives is that most of that

08:17

complication can be ignored. The first term in your expansion is xn, this is analogous to the

08:23

area of the original square or the volume of the original cube from our previous examples.

08:30

For the next terms in the expansion, you can choose mostly x's with a single dx since there are

08:43

n radicals from which you could have chosen that single dx. This gives us n separate terms all of which include

08:50

n-1 x's times a dx giving a value of x(n-1) times dx. This is analogous to how the majority of

08:59

the new area in the square came from those two bars each with area x * dx,

09:04

or how the bulk of the new volume in the cube came from those three thin squares.

09:09

Each of which had a volume of x2 times dx. There will be many other terms of this expansion

09:16

but all of them are just going to be some multiple of dx2 so we can safely ignore them.

09:21

And what that means is that all but a negligible portion of the increase in the output

09:26

comes from n copies of this x to the (n-1) * dx - that's what it means.

09:32

For the derivative of xn to be n * x(n-1) and even though, like I said in practice, you'll find

09:41

yourself performing this derivative quickly and symbolically imagining the exponent,

09:45

hopping down to the front. Every now and then it's nice to just step back and remember why these rules work.

09:52

Not just because it's pretty, and not just because it helps remind us that math actually makes sense

09:56

and isn't just a pile of formulas to memorize. But because it flexes that very important muscle of

10:02

thinking about derivatives in terms of tiny nudges. As another example think of the function f(x) = 1/x.

10:12

Now, on the one hand you could just blindly try applying the power rule since 1/x

10:18

is the same as writing x(-1). That would involve letting the negative 1 hop down in front

10:24

leaving behind 1 less than itself which is -2. But let's have some fun and see if we can reason about this

10:30

geometrically rather than just plugging it through some formula. The value 1/x is asking what number

10:38

multiplied by x equals 1, so here's how I'd like to visualize it - imagine a little

10:43

rectangular puddle of water sitting in two dimensions whose area is 1, and let's say that its width is x.

10:50

Which means that the height has to be 1/x since the total area of it is 1, so if x was

10:57

stretched out to 2 then that height is forced down to 1/2 and if you increased x up to 3

11:03

then the other side has to be squished down to 1/3 this is a nice way to think about the graph of 1/x.

11:10

By the way, if you think of this with x of the puddle as being in the xy plane then that corresponding output 1/x,

11:17

the height of the graph above that point is whatever the height of your puddle has to be to maintain an area of 1.

11:26

So with this visual in mind for the derivative, imagine nudging up that value of x by some tiny amount,

11:32

some tiny dx. How must the height of this rectangle change so that the area of the puddle remains

11:39

constant at 1 - That is increasing the width by dx, add some new area to the right here so the puddle

11:45

has to decrease in height by some d(1/x) so that the area lost off of that top cancels out the area gained.

11:54

You should think of that d(1/x) as being a negative amount. By the way since it's decreasing the height

12:01

of the rectangle and you know what I'm

12:04

going to leave the last few steps here

12:06

for you for you to pause and ponder and

12:08

work out an ultimate expression and once

12:10

you reason out what D of 1 over X / DX

12:13

should be I want you to compare it to

12:15

what you would have gotten if you had

12:17

just blindly applied the power rule

12:18

purely symbolically

12:20

to

12:20

X to the negative one and while I'm

12:24

encouraging a deposit ponder here's

12:26

another fun challenge if you're feeling

12:27

up to it see if you can reason through

12:30

what the derivative of the square root

12:32

of x should be

12:36

to finish things off I want to tackle

12:38

one more type of function trigonometric

12:40

functions and in particular let's focus

12:42

on the sine function so for this section

12:46

I'm going to assume that you're already

12:47

familiar with how to think about trig

12:49

functions using the unit circle the

12:51

circle with the radius one centered at

12:53

the origin

12:54

for a given value of theta like say zero

12:57

point eight you imagine yourself walking

12:59

around the circle starting from the

13:01

rightmost point until you've traversed

13:03

that distance of zero point eight in arc

13:05

length this is the same thing as saying

13:08

that the angle right here is exactly

13:10

theta radians

13:11

since the circle has a radius of one

13:14

then what sine of theta means is the

13:17

height of that point above the x-axis

13:19

and as your theta value increases and

13:22

you walk around the circle your height

13:25

Bob's up and down between negative one

13:27

and one so when you graph sine of theta

13:30

versus theta you get this wave pattern

13:33

the quintessential wave pattern

13:37

and just from looking at this graph we

13:39

can start to get a feel for the shape of

13:41

the derivative of the sine the slope at

13:44

zero is something positive since sine of

13:47

theta is increasing there and as we move

13:50

to the right and sine of theta

13:51

approaches its peak that slope goes down

13:53

to zero then the slope is negative for a

13:56

little while while the sine is

13:58

decreasing before coming back up to zero

14:00

as the sine graph levels out and as you

14:04

continue thinking this through and

14:06

drawing it out if you're familiar with

14:07

the graph of trig functions you might

14:09

guess that this derivative graph should

14:12

be exactly cosine of theta since all the

14:14

peaks and valleys line up perfectly with

14:16

where the peaks and valleys for the

14:18

cosine function should be and spoiler

14:20

alert the derivative is in fact the

14:22

cosine of theta but aren't you a little

14:25

curious about why it's precisely cosine

14:27

of theta I mean you could have all sorts

14:29

of functions with peaks and valleys at

14:31

the same points that have roughly the

14:32

same shape but who knows maybe the

14:34

derivative of sine could have turned out

14:36

to be some entirely new type of function

14:38

that just happens to have a similar

14:40

shape well just like the previous

14:42

examples a more exact understanding of

14:45

the derivative requires looking at what

14:47

the function actually represents rather

14:49

than looking at the graph of the

14:50

function so think back to that walk

14:53

around the unit circle having traversed

14:55

an arc with length theta and thinking

14:57

about sine of theta as the height of

14:59

that point

15:01

now zoom in to that point on the circle

15:03

and consider a slight nudge of D theta

15:06

along their circumference a tiny step in

15:09

your walk around the unit circle how

15:11

much does that tiny step change the sign

15:14

of theta how much does this increase D

15:16

theta of arc length increase the height

15:19

above the x-axis

15:20

well zoomed in close enough the circle

15:23

basically looks like a straight line in

15:25

this neighborhood so let's go ahead and

15:26

think of this right triangle where the

15:29

hypotenuse of that right triangle

15:30

represents the nudge D theta along the

15:33

circumference and that left side here

15:35

represents the change in height the

15:37

resulting D sine of theta now this tiny

15:40

triangle is actually similar to this

15:42

larger triangle here with the defining

15:44

angle theta and whose hypotenuse is the

15:47

radius of the circle with length one

15:50

specifically this little angle right

15:52

here is precisely equal to theta radians

15:56

now think about what the derivative of

15:59

sine is supposed to mean it's the ratio

16:01

between that D sine of theta the tiny

16:04

change to the height divided by D theta

16:06

the tiny change to the input of the

16:08

function and from the picture we can see

16:11

that that's the ratio between the length

16:13

of the side adjacent to the angle theta

16:15

divided by the hypotenuse well let's see

16:19

adjacent divided by hypotenuse that's

16:21

exactly what the cosine of theta means

16:23

that's the definition of the cosine

16:26

so this gives us two different really

16:29

nice ways of thinking about how the

16:30

derivative of sine is cosine one of them

16:33

is looking at the graph and getting a

16:34

loose feel for the shape of things based

16:36

on thinking about the slope of the sine

16:38

graph at every single point and the

16:41

other is a more precise line of

16:42

reasoning looking at the unit circle

16:44

itself for those of you that like to

16:48

pause and ponder see if you can try a

16:49

similar line of reasoning to find what

16:51

the derivative of the cosine of theta

16:53

should be in the next video I'll talk

16:57

about how you can take derivatives of

16:59

functions who combine simple functions

17:01

like these ones either as sums or

17:03

products or function compositions things

17:05

like that and similar to this video the

17:07

goal is going to be to understand each

17:09

one geometrically in a way that makes it

17:11

intuitively reasonable and somewhat more

17:13

memorable as you know by now there are

17:18

many people to thank for this series and

17:20

one group I'd like to call out

17:21

specifically is brilliant org I think

17:24

anyone watching this video would like

17:26

brilliant a lot because they offer a

17:28

problem solving website that teaches you

17:30

to think like a mathematician videos and

17:33

books can offer intuitions and

17:34

explanations but math is not a spectator

17:37

sport the only way to actually solidify

17:40

those intuitions is with your own

17:42

explorations and problem solving

17:44

brilliant offers really well curated

17:47

sequences of guided questions and

17:49

speaking as someone who's worked on

17:51

creating those kinds of sequences before

17:53

I can tell you a lot of thoughtful hard

17:55

work has gone into making these as good

17:57

as they are and the subscription they

17:59

offer to get the full suite of problems

18:01

is a really good deal if you go to

18:04

brilliant org slash three b-1b or more

18:07

simply just follow the links on the

18:08

screen or in the video description that

18:11

lets them know that you came from here

18:12

you can supplement this series with

18:15

their calculus done right sequence and I

18:17

would also recommend looking at their

18:18

probability and complex algebra

18:20

sequences

18:37

you

18:40

you

Attachments