At the beginning of this semester,
we learned about one of the six pillars
of calculus.
The idea that what goes up has to
stop before coming down.
Now that we've learned about
derivatives, we can make this
a bit more precise.
Let's suppose we've got a function,
f(x) is the function, and it's got
a local maximum.
And it's got a local maximum 
at a spot, x = c.
That's where it reaches 
the top of the arc.
At that point, either the derivative
is 0 or the derivative doesn't exist.
The exact same thing goes for
local minimum. At the bottom
of the arc, either the derivative is 0
or the derivative doesn't exist.
Let's see why that is.
Let's imagine that we've got a function.
We've got a function here.
Somewhere in the middle, actually
around there, there's a spot where
we have a local maximum.
Let's try to compute the derivative.
So by definition, the derivative
is a limit.
And for that limit to exist,
it has to exist from the right
and it also has to exist from the left.
But f(c) is a local maximum.
All of the points nearby have
function values that are less than or
equal to f(c). So if x is bigger than c,
this is a limit of negative things 
because f(x) is less than f(c),
divided by positive numbers.
And the limit of negative or positive,
negative numbers can't be positive.
It can be zero. You can have negative
numbers that get closer and closer
and closer to zero. 
But it can't be positive.
On the other hand, on the other side,
f(x) - f(c) is still negative but if x is
less than c, than x - c is also negative.
Negative divided by a negative 
is a positive. So the limit has to
be positive.
If the limit exists, the limit has to be
less than or equal to zero.
And it has to be greater than or
equal to zero.
What's the only way for something
to be less than or equal to zero
and greater or equal to zero?
It has to be zero.
So if f'(c) exists, then f'(c) is zero.
Now it might not exist. 
You can have a local maximum
at a point where it hits a corner,
there's no derivative here, that's fine.
You can have a situation where 
a function is even discontinuous.
There's a local maximum but
there's no derivative.
But what you can't have is a 
derivative that's positive or
a derivative that's negative.
If a derivative exists, it's gotta
be zero.
