Now that we've seen what a derivative means and what it has to do with rates of change,
our next step is to learn how to actually compute these guys.
As in, if I give you some kind of function with an explicit formula,
you'd want to be able to find what the formula for its derivative is.
Maybe it's obvious, but I think it's worth stating explicitly why this
is an important thing to be able to do, why much of a calculus student's
time ends up going towards grappling with derivatives of abstract
functions rather than thinking about concrete rate of change problems.
It's because a lot of real-world phenomena, the sort of things that
we want to use calculus to analyze, are modeled using polynomials,
trigonometric functions, exponentials, and other pure functions like that.
So if you build up some fluency with the ideas of rates of change for those kinds of
pure abstract functions, it gives you a language to more readily talk about the rates
at which things change in concrete situations that you might be using calculus to model.
But it is way too easy for this process to feel like just memorizing a list of rules,
and if that happens, if you get that feeling, it's also easy to lose sight of the
fact that derivatives are fundamentally about just looking at tiny changes to some
quantity and how that relates to a resulting tiny change in another quantity.
So in this video and in the next one, my aim is to show you how you can think
about a few of these rules intuitively and geometrically,
and I really want to encourage you to never forget that tiny nudges are at the
heart of derivatives.
Let's start with a simple function like f of x equals x squared.
What if I asked you its derivative?
That is, if you were to look at some value x, like x equals 2,
and compare it to a value slightly bigger, just dx bigger,
what's the corresponding change in the value of the function?
dF.
And in particular, what's dF divided by dx, the rate
at which this function is changing per unit change in x.
As a first step for intuition, we know that you can think of this ratio
dF dx as the slope of a tangent line to the graph of x squared,
and from that you can see that the slope generally increases as x increases.
At zero, the tangent line is flat, and the slope is zero.
At x equals 1, it's something a bit steeper.
At x equals 2, it's steeper still.
But looking at graphs isn't generally the best way
to understand the precise formula for a derivative.
For that, it's best to take a more literal look at what x squared actually means,
and in this case let's go ahead and picture a square whose side length is x.
If you increase x by some tiny nudge, some little dx,
what's the resulting change in the area of that square?
That slight change in area is what dF means in this context.
It's the tiny increase to the value of f of x equals x squared,
caused by increasing x by that tiny nudge dx.
Now you can see that there's three new bits of area in this diagram,
two thin rectangles and a minuscule square.
The two thin rectangles each have side lengths of x and dx,
so they account for 2 times x times dx units of new area.
For example, let's say x was 3 and dx was 0.01,
then that new area from these two thin rectangles would be 2 times 3 times 0.01,
which is 0.06, about 6 times the size of dx.
That little square there has an area of dx squared,
but you should think of that as being really tiny, negligibly tiny.
For example, if dx was 0.01, that would be only 0.0001,
and keep in mind I'm drawing dx with a fair bit of width here just so we
can actually see it, but always remember in principle,
dx should be thought of as a truly tiny amount, and for those truly tiny amounts,
a good rule of thumb is that you can ignore anything that includes a dx
raised to a power greater than 1.
That is, a tiny change squared is a negligible change.
What this leaves us with is that dF is just some multiple of dx, and that multiple 2x,
which you could also write as dF divided by dx, is the derivative of x squared.
For example, if you were starting at x equals 3, then as you slightly increase x,
the rate of change in the area per unit change in length added, dx squared over dx,
would be 2 times 3, or 6, and if instead you were starting at x equals 5,
then the rate of change would be 10 units of area per unit change in x.
Let's go ahead and try a different simple function, f of x equals x cubed.
This is going to be the geometric view of the stuff
that I went through algebraically in the last video.
What's nice here is that we can think of x cubed as the volume of an actual
cube whose side lengths are x, and when you increase x by a tiny nudge,
a tiny dx, the resulting increase in volume is what I have here in yellow.
That represents all the volume in a cube with side lengths x plus dx
that's not already in the original cube, the one with side length x.
It's nice to think of this new volume as broken up into multiple components,
but almost all of it comes from these three square faces,
or said a little more precisely, as dx approaches 0,
those three squares comprise a portion closer and closer to 100% of
that new yellow volume.
Each of those thin squares has a volume of x squared times dx,
the area of the face times that little thickness dx.
So in total this gives us 3x squared dx of volume change.
And to be sure there are other slivers of volume here along the edges
and that tiny one in the corner, but all of that volume is going to be
proportional to dx squared, or dx cubed, so we can safely ignore them.
Again this is ultimately because they're going to be divided by dx,
and if there's still any dx remaining then those terms aren't
going to survive the process of letting dx approach 0.
What this means is that the derivative of x cubed,
the rate at which x cubed changes per unit change of x, is 3 times x squared.
What that means in terms of graphical intuition is that the slope of
the graph of x cubed at every single point x is exactly 3x squared.
And reasoning about that slope, it should make sense that this derivative is high on the
left and then 0 at the origin and then high again as you move to the right,
but just thinking in terms of the graph would never have landed us on the precise
quantity 3x squared.
For that we had to take a much more direct look at what x cubed actually means.
Now in practice you wouldn't necessarily think of the square every
time you're taking the derivative of x squared,
nor would you necessarily think of this cube whenever you're taking
the derivative of x cubed.
Both of them fall under a pretty recognizable pattern for polynomial terms.
The derivative of x to the fourth turns out to be 4x cubed,
the derivative of x to the fifth is 5x to the fourth, and so on.
Abstractly you'd write this as the derivative of x to
the n for any power n is n times x to the n minus 1.
This right here is what's known in the business as the power rule.
In practice we all quickly just get jaded and think about this symbolically as
the exponent hopping down in front, leaving behind one less than itself,
rarely pausing to think about the geometric delights that underlie these derivatives.
That's the kind of thing that happens when these tend
to fall in the middle of much longer computations.
But rather than tracking it all off to symbolic patterns,
let's just take a moment and think about why this works for powers beyond just 2 and 3.
When you nudge that input x, increasing it slightly to x plus dx,
working out the exact value of that nudged output would involve
multiplying together these n separate x plus dx terms.
The full expansion would be really complicated,
but part of the point of derivatives is that most of that complication can be ignored.
The first term in your expansion is x to the n.
This is analogous to the area of the original square,
or the volume of the original cube from our previous examples.
For the next terms in the expansion you can choose mostly x's with a single dx.
Since there are n different parentheticals from which you could have chosen
that single dx, this gives us n separate terms,
all of which include n minus 1 x's times a dx,
giving a value of x to the power n minus 1 times dx.
This is analogous to how the majority of the new area in the square came from those
two bars, each with area x times dx, or how the bulk of the new volume in the cube
came from those three thin squares, each of which had a volume of x squared times dx.
There will be many other terms of this expansion,
but all of them are just going to be some multiple of dx squared,
so we can safely ignore them, and what that means is that all but a
negligible portion of the increase in the output comes from n copies of
this x to the n minus 1 times dx.
That's what it means for the derivative of x to the n to be n times x to the n minus 1.
And even though, like I said in practice, you'll find yourself performing this
derivative quickly and symbolically, imagining the exponent hopping down to the front,
every now and then it's nice to just step back and remember why these rules work.
Not just because it's pretty, and not just because it helps remind us that math
actually makes sense and isn't just a pile of formulas to memorize,
but because it flexes that very important muscle of thinking about derivatives in
terms of tiny nudges.
As another example, think of the function f of x equals 1 divided by x.
Now on the hand you could just blindly try applying the power rule,
since 1 divided by x is the same as writing x to the negative 1.
That would involve letting the negative 1 hop down in front,
leaving behind 1 less than itself, which is negative 2.
But let's have some fun and see if we can reason about this geometrically,
rather than just plugging it through some formula.
The value 1 over x is asking what number multiplied by x equals 1.
So here's how I'd like to visualize it.
Imagine a little rectangular puddle of water sitting in two dimensions whose area is 1.
And let's say that its width is x, which means that the height has to be 1 over x,
since the total area of it is 1.
So if x was stretched out to 2, then that height is forced down to 1 half.
And if you increased x up to 3, then the other side has to be squished down to 1 third.
This is a nice way to think about the graph of 1 over x, by the way.
If you think of this width x of the puddle as being in the xy-plane,
then that corresponding output 1 divided by x, the height of the graph above that point,
is whatever the height of your puddle has to be to maintain an area of 1.
So with this visual in mind, for the derivative,
imagine nudging up that value of x by some tiny amount, some tiny dx.
How must the height of this rectangle change so
that the area of the puddle remains constant at 1?
That is, increasing the width by dx adds some new area to the right here.
So the puddle has to decrease in height by some d 1 over x,
so that the area lost off of that top cancels out the area gained.
You should think of that d 1 over x as being a negative amount,
by the way, since it's decreasing the height of the rectangle.
And you know what?
I'm going to leave the last few steps here for you,
for you to pause and ponder and work out an ultimate expression.
And once you reason out what d of 1 over x divided by dx should be,
I want you to compare it to what you would have gotten if you had just
blindly applied the power rule, purely symbolically, to x to the negative 1.
And while I'm encouraging you to pause and ponder,
here's another fun challenge if you're feeling up to it.
See if you can reason through what the derivative of the square root of x should be.
To finish things off, I want to tackle one more type of function,
trigonometric functions, and in particular let's focus on the sine function.
So for this section I'm going to assume that you're already
familiar with how to think about trig functions using the unit circle,
the circle with a radius 1 centered at the origin.
For a given value of theta, like say 0.8, you imagine yourself
walking around the circle starting from the rightmost point
until you've traversed that distance of 0.8 in arc length.
This is the same thing as saying that the angle right here is exactly theta radians,
since the circle has a radius of 1.
Then what sine of theta means is the height of that point above the x-axis,
and as your theta value increases and you walk around the circle
your height bobs up and down between negative 1 and 1.
So when you graph sine of theta versus theta you get this wave pattern,
the quintessential wave pattern.
And just from looking at this graph we can start to
get a feel for the shape of the derivative of the sine.
The slope at 0 is something positive since sine of theta is increasing there,
and as we move to the right and sine of theta approaches its peak that slope goes down
to 0.
Then the slope is negative for a little while,
while the sine is decreasing before coming back up to 0 as the sine graph levels out.
And as you continue thinking this through and drawing it out,
if you're familiar with the graph of trig functions you might guess that this
derivative graph should be exactly cosine of theta,
since all the peaks and valleys line up perfectly with where the peaks and
valleys for the cosine function should be.
And spoiler alert, the derivative is in fact the cosine of theta,
but aren't you a little curious about why it's precisely cosine of theta?
I mean you could have all sorts of functions with peaks and valleys at the same points
that have roughly the same shape, but who knows,
maybe the derivative of sine could have turned out to be some entirely new type of
function that just happens to have a similar shape.
Well just like the previous examples, a more exact understanding
of the derivative requires looking at what the function actually represents,
rather than looking at the graph of the function.
So think back to that walk around the unit circle,
having traversed an arc with length theta and thinking about sine of theta as
the height of that point.
Now zoom into that point on the circle and consider a slight nudge of d theta
along their circumference, a tiny step in your walk around the unit circle.
How much does that tiny step change the sine of theta?
How much does this increase d theta of arc length increase the height above the x-axis?
Well zoomed in close enough, the circle basically looks like a straight line in this
neighborhood, so let's go ahead and think of this right triangle where the hypotenuse
of that right triangle represents the nudge d theta along the circumference,
and that left side here represents the change in height, the resulting d sine of theta.
Now this tiny triangle is actually similar to this larger triangle here,
with the defining angle theta and whose hypotenuse is the radius of the circle with
length 1.
Specifically this little angle right here is precisely equal to theta radians.
Now think about what the derivative of sine is supposed to mean.
It's the ratio between that d sine of theta, the tiny change to the height,
divided by d theta, the tiny change to the input of the function.
And from the picture we can see that that's the ratio between the
length of the side adjacent to the angle theta divided by the hypotenuse.
Well let's see, adjacent divided by hypotenuse,
that's exactly what the cosine of theta means, that's the definition of the cosine.
So this gives us two different really nice ways of
thinking about how the derivative of sine is cosine.
One of them is looking at the graph and getting a loose feel for the shape of
things based on thinking about the slope of the sine graph at every single point.
And the other is a more precise line of reasoning looking at the unit circle itself.
For those of you that like to pause and ponder,
see if you can try a similar line of reasoning to find what the derivative of
the cosine of theta should be.
In the next video I'll talk about how you can take derivatives
of functions who combine simple functions like these ones,
either as sums or products or function compositions, things like that.
And similar to this video the goal is going to be to understand each one
geometrically in a way that makes it intuitively reasonable and somewhat more memorable.