Partial derivatives are just like derivatives
except that they're for multivariable functions
where derivatives are for single variable
functions. We all know how to take the derivative
of a single variable function because there's
just one variable in that function so when
we take the derivative we take the derivative
with respect to that variable. We take the
derivative of that variable. But how do we
take the derivative when there are multiple
variables inside the same function? So let's
expand a little bit on this idea. What are
partial derivatives used for? Well let's go
back to our understanding of a regular derivative
for a single variable function. So if we have
a function let's say f(x) is equal to x^3.
We could also write this as y equals x^3 and
it would mean the same thing. So we already
know how to take the derivative of a function
like this. If we want to find the derivative
we call the derivative f'(x). And in this
case because of the kind of function that
it is we would simply use power rule to take
the derivative and the derivative of x^3 would
be 3x^2. Now let's go back to the idea of
a derivative. The derivative gives you the
slope of a function at any particular point.
So if I have a function x^3 and I want to
know its slope at a particular point, the
slope being how fast the function is increasing
or decreasing or if it's staying flat, then
I can take the derivative and I can evaluate
the derivative at a particular point. So this
derivative function f'(x) is 3x^2, this is
a model for the rate of change of f(x) anywhere.
So if I wanted to say what is the slope or
what is the rate of change at x equals 2 of
the original function f(x) I would plug x
equals 2 into the derivative and I would say
f'(2) is equal to 3 times 2^2 which is 3 times
4 or 12. So what this tells me is that the
original function f(x) has a slope of positive
12 meaning that it's increasing because the
slope is positive when x is equal to 2. If
I plug a value into the derivative and the
result is negative instead of positive, let's
say I had gotten negative 12 instead of positive
12, that would tell me that the original function
is decreasing. And we care about the slope
because we care about whether the function
is increasing or decreasing or if it's flat.
And if it's increasing or decreasing how fast
it's going up and down. So the derivative
is important to us. So partial derivatives
are the way that we find the derivative of
a multivariable function. This was a single
variable function. We only had x on the right
hand side. But if I instead had something
like f(x,y) is equal to x^2y I now have two
different variables on the right hand side.
Instead of just x I have both x and y in a
multivariable function. So how am I going
to take the derivative of this? I can't just
take the derivative of the x and ignore the
y or take the derivative of the y and ignore
the x. The x^2 and the y, they're tied together,
they affect each other. So I have to have
a special way of taking the derivative of
a function like this one. And that's what
partial derivatives allow us to do. We can
take the partial derivatives of this function
and together those partial derivatives are
going to tell us the slope of the original
function. Those partial derivatives will model
the slope at any particular point. And then
just like we wanted to in this problem look
and see what the slope was at x equals 2,
so we plugged 2 into the derivative function,
we might want to find the slope of this function
at the coordinate point (2,3) and so we could
find partial derivatives, we could plug in
the point (2,3), and those partial derivatives
together would tell us slope of the original
function f(x,y) at the point (2,3). So partial
derivatives just allow us to take the derivative
of a multivariable function and they therefore,
because they are the derivative a multivariable
function, they model how fast that multivariable
function is increasing or decreasing or if
its slope is staying the same. So what exactly
are partial derivatives? What does it mean
when we say partial derivatives, and what
do they look like? Well you're always going
to have the same number of partial derivatives
that you have variables in your function.
So in this example again we have two variables
x and y. Which means that if we want to take
partial derivatives of this function we will
have two partial derivatives. And it's going
to be one for each variable. One partial derivative
for x and one partial derivative for y. So
let's go ahead and take a look at what those
partial derivatives are going to be. So we'll
have two partial derivatives, one with respect
to x and the other with respect to y. And
we'll talk again about what that means in
a second. Let's start with the partial derivative
with respect to x. First of all there are
two ways to express the partial derivative
with respect to x or two ways to write it.
So the first one looks like this f_x and you
might see f_x of x comma y, so with this xy
in parenthesis attached to it, you may see
that. But the shorthand notation is f_x with
this little x. Or this notation here. And
what this means, this symbol right here is
called the partial symbol. You read this symbol
as "partial". So this is partial f / partial
x or the partial derivative of f with respect
to x. So the letter on the top is always the
function, so since this is the function f
we put f on the top. And the variable that
you're taking the derivative with respect
to goes on the bottom. So since we're going
to be taking the derivative with respect to
x, x goes on the bottom. So the partial derivative
of f with respect to x. And here's how you
get that. You look at your original function
and we're going to be taking the derivative
with respect to x. What that means is that
you're going to be differentiating the x-variable
like you would if this were a single variable
function because you're treating y and any
other variables in the function for that matter
as a constant. So this gets a little tricky
but in this function we have x^2 times y.
One trick I like to use is to think of the
other variables as actual constants. So we
say we're treating y as a constant but what
does that really mean? Well let's actually
think about replacing y with a constant, like
for example the number of 3. Or you could
pick 2 or 7, it doesn't matter which constant,
but you can think of it that way. So for example
if y were 3 then this function here would
be x^2 times 3 or 3x^2. So we'd have 3x^2.
And let's keep in mind here that this 3 here
is representing our y. Okay so if we had that,
how would we take the derivative of that?
Well we would use power rule, we would bring
the 2 down in front and we get 3 times 2 and
then we'd have x to the first power because
we'd get 2 minus 1 in the exponent is 1. So
we'd get 3 times 2 x to the first and this
would end up being 6x. That's how we would
find the derivative if we had 3x^2. Well that's
basically exactly what we have because we're
treating y like a constant so it's just like
this 3 sitting out here in front of the x^2.
Which means that all we have to do to find
the derivative is follow this same pattern.
Here we brought the 2 down in front so we
would bring this 2 down in front and we would
get 2x. We'd still have x to the first power
because we would subtract 1 from the exponent
and end up with 1. And the y would just stay
there. So we'd end up with 2xy. Another way
to think about that other than this one here
where you're treating y as a constant, is
to for every term factor any of the other
variables that you're treating as constants
out in front. So if we rewrote this instead
as y multiplied by x^2. This is helpful because
you kind of pull the y outside and you can
just focus on the x^2, what's inside the parentheses,
because this is the only variable you care
about. So then if you were to do it this way
you would say, okay y is a constant I'm just
going to leave it there. The derivative of
x^2 is 2x so I end up with y times 2x or 2xy.
So that's another way to look at it. Now let's
practice again with the partial derivative
with respect to y. So remember we said that
we would have a partial derivative for each
of the variables in our function. So we have
an x and we have a y. We just took the partial
derivative with respect to x. Now we need
to take the partial derivative with respect
to y. So as you might imagine instead of f_x
we can call it f_y and instead of the partial
derivative of f with respect to x we write
that as the partial derivative of f with respect
to y or partial f partial y. And this represents
the partial derivative with respect to y.
And now of course we do the opposite operation.
In this case we treat x as a constant and
we treat y as a variable. So if we use this
method again what we want to do is recognize
that the entire x^2 is a constant so we kind
of want to pull that out in front and rewrite
this as x^2 times y because y is the only
thing we care about. So x^2 is that constant,
it's just going to hang out in front there
and stay. The derivative of y is 1. So our
result then would be x^2 times 1 which is
just x^2. So we end up with x^2. Now these
together it's important to know our our first
order partial derivatives. You can think about
them as first order partial derivatives because
you only took the derivative one time. We
took the derivative one time with respect
to x we took the derivative one time with
respect to y so because we took the derivative
one time these are first order partial derivatives.
And we know that we have all of them because
we had the x variable and the y variable and
we have a partial derivative with respect
to x and a partial derivative with respect
to y. And at this point we want to talk about
second order partial derivatives. So while
this may seem a little intimidating, really
we're just following the same process that
we already took to get to this point with
our first-order partial derivatives. So we're
treating now this 2xy, think about it as a
brand new function. And we want to take the
derivative with respect to both x and y because
our original function had an x and a y which
means we need to take the derivative with
respect to x and y regardless of which variables
still remain in this function. So if I take
the partial derivative with respect to x of
2xy I want to treat y as a constant again
because I'm differentiating with respect to
x. So I could rewrite this, I could pull the
y out in front and get y times 2x. So I let
the y hang out there, it's like a constant
coefficient, I don't have to worry about it.
The derivative of 2x with respect to x is
2. So I'm going to get y times 2 or 2y. So
the derivative with respect to x is 2y. But
how do I write the second order partial derivative
with respect to x? Well just like before there
were two ways to express this in terms of
notation. Again there are two ways to express
second order partial derivatives. So the second
order partial derivative with respect to x,
unsurprisingly, instead of just f_x it would
be f_xx. So the second order partial derivative
with respect to x, which makes sense because
we're taking the partial derivative with respect
to x two times. We took it with respect to
x here and then again with respect to x of
our result. So we took the partial derivative
with respect to x twice so we write f_xx.
Or we could also write this in this notation
here. And here's what that looks like. It'll
be partial^2 f partial x^2. You always have
partial^2 f in the numerator and then partial
x^2 when we take the derivative with respect
to x two times in a row. And both of these
notation mean the same thing. Now what about
this second-order partial derivative here
with respect to y? Well we first took the
derivative with respect to x, now we're taking
the derivative of the result with respect
to y. So first let's just differentiate this
with respect to y. What we want to do is pull
out everything else other than the y out in
front, so we can pull out the 2x and we can
write this as 2x and then y in parentheses.
Well the derivative of y is 1 so we get 2x
times 1 or just 2x. So the derivative here
will be 2x. Now how do we indicate this in
terms of notation? Well again we have both
sets of notation but this one gets a little
tricky. So for this subscription notation
here where we have subscripts we write that
as f_xy. But for this other kind of notation
we still have partial^2 f in our numerator
but in our denominator we have partial y partial
x. And there's something important worth noting
here about how to read partial derivative
notation. So when you use this subscription
notation and you have the subscripts here
you always indicate which partial derivative
you took first, left to right. So in other
words to get here to 2x we first took the
partial derivative with respect to x and then
y which is why we write f_xy, we did x first
then y, it's left to right. But in this notation
here on the bottom it's exactly the opposite.
You indicate which partial derivative you
took first on the right hand side and you
read from right to left. So because this is
x on the right and y on the left and we read
from right to left, this says we took the
derivative first with respect to x and then
y. So they're backwards and depending on which
notation you use you want to make sure that
you get these in the right order. So we'll
look at a second example of that when we do
the second order partial derivatives here.
If we take the second order partial derivative
with respect to y again, we already took the
first order partial derivative with respect
to y, now we want to do y again. That is of
course f_yy or partial^2 f over partial y^2.
And that's going to be equal to... Here the
first order partial derivative with respect
to y was x^2 so our result was x^2. We need
to take the derivative of this with respect
to y. And you might be wondering at this point,
how are we going to do that when we have no
y involved? Well remember we're treating x
like a constant. So let's pretend again that
x is a constant like 3. So I would get 3^2
or 9. So the partial derivative here would
be 9 and now I'm saying, okay what's the partial
derivative of 9 with respect to y? Well remember
from single variable functions the derivative
of a constant is always 0. So the derivative
of that will be 0. And another way to remember
that is if you're taking the partial derivative
of something and the variable that you're
differentiating does not show up in the function,
then the whole function is a constant and
the derivative will of course be 0. So because
we're differentiating this with respect to
y and there's no y there, there's no y present,
then the derivative will be 0. So we can say
here that the derivative is 0. And then finally
this is the last second order partial derivative.
This one we're saying is the partial derivative
with respect to y and then x. So if we were
going to write that in subscription notation
we would say with respect to y and then x.
And if we were going to write it in this notation
we would say partial^2 f / partial partial
we said with respect to y first, so that goes
on the right side, then with respect to x.
So notice how these are exactly opposite of
this notation here. So here with respect to
y and now with respect to x we're taking the
partial derivative of x^2 with respect to
x. And that's no different than a single variable
function. We want a differentiate x, all we
have left is x, that's easy. The derivative
of x^2: 2x. No problem. And now this whole
row here, all four of these derivatives we
call our second order partial derivatives.
Now let's talk about a couple really important
things here. First of all second order partial
derivatives in a function with two variables,
we're always going to have four of them, because
if there's two variables in the original function
you have two first order partial derivatives
and then you're going to double that and you're
going to have four second order partial derivatives.
If we for example took third order partial
derivatives, we would double that again and
there would be eight third order partial derivatives,
two for each of these four. So that's one
thing to know. Another thing to know is that
these two derivatives here in the middle,
let's indicate our results here. So these
two things. These values are always going
to be equal to one another. These two are
called the mixed second order partial derivatives
or the cross second order partial derivatives,
because you're differentiating with respect
to each variable. When we took this path we
went first x then y. When we took this path
we went first y then x. But either way we
differentiated with respect to both variables
which is why they're called the mixed second
order partial derivatives. And you will always
end up with the same value, and as long as
the original function is continuous everywhere
in its domain and all the partial derivatives
are also defined and continuous, then these
mixed second order partial derivatives will
always have the same value. Which means that
you don't actually need to find both of them
unless you're explicitly asked to do so. You
can just find one of them either x then y
or y then x because you know that you're going
to end up with the same value. So that's what
we mean when we say the mixed partial derivatives.
So why is it the case that the mixed partial
derivatives are always equal to one another?
Well it's a little difficult to explain and
certainly difficult to understand, but we're
going to try just to get a little bit of a
visualization here. So let's say that we have
this function and I don't even know the equation
of this function it's just a plane. And it's
defined by these edges here but it intersects
the x-axis at this point here, intersects
the y-axis here, and intersects the z-axis.
So it's a plane and it's kind of tilted back
up top here and then as we go down here it
comes forward toward us or closer to us. And
so then I've drawn in that it creates a little
shadow in the first quadrant of the xy-plane
right here underneath it. So when we talk
about partial derivatives of a function, so
we have the partial derivative with respect
to f of x and the partial derivative with
respect to f of y. These are the first order
partial derivatives of a function. Well what
these mean, the first order partial derivative
with respect to x means slope in the x-direction
or the slope in the direction of x, the slope
toward x. And then of course the partial derivative
with respect to y means slope in the y-direction.
So let's pretend then that I'm interested
in the derivative of this surface at this
point right here. Let's say this is a point
on the surface so the surface is kind of reclining
away from us and that point is just sitting
right on this surface. If I find the partial
derivative with respect to x at that exact
point, what I'm saying is the slope of this
function, this surface, in the direction of
x. Well you can see x is this direction so
if I kind of draw a parallel line I'm saying
the slope in this direction here. If I take
the partial derivative with respect to y,
I'm looking for slope in the y-direction so
this is my y-direction right here. So toward
x the function might be changing at a certain
rate, toward y it might be changing at a different
rate. Even looking at this sort of reclined
plane, if I'm moving toward x or I'm moving
toward y out in the positive direction of
either one of those, then the slope is going
to be negative, the function is decreasing.
Because as I move out in the positive direction
of x or the positive direction of y, the plane,
the surface is moving down toward the negative
direction of z. So both my partial derivatives
should be negative. So I have slope in the
x-direction, slope in the y-direction. The
reason that the mixed second order partial
derivatives are the same, is kind of just
because the derivative remember is an infinitely
small increment. If I just look at an infinitely
small change in the x-direction and an infinitely
small change in the y-direction, the smaller
the change I make until I get to a point where
it's infinitely small, is going to give me
just the general change at this point that
I'm interested in. The slope of the function
overall as opposed to the slope in the x-direction
or slope in the y-direction. Because if I'm
taking an infinitely small increment, I'm
not really moving away from this point out
a distance toward x or out a distance toward
y. I'm just right at that point trying to
get a feel for the slope right there. So when
I take the mixed second order partial derivatives,
I'm taking into account both the change in
the x-direction and the change in the y-direction,
and sort of putting those together to get
the change in general at that exact point.
So hopefully that gives you an idea of why
the mixed partial derivatives are always equal
to one another. Now before we wrap up let's
do one slightly more complicated example.
Let's say we have f(x,y) is equal to e^(xy).
So the first thing we want to do is find first
order partial derivatives. So if we go ahead
and say we're going to have one derivative
here and one derivative here. First we want
to find the partial derivative with respect
to x. So we can go ahead and call that the
partial derivative of f with respect to x
is going to be equal to... Now here we have
to take into account the fact that we have
the exponential function. Remember that the
derivative, when we say the derivative of
e^x, that's always just e^x, the function
itself, right? We differentiate e^x and the
result is still e^x. Well similarly here if
I'm going to differentiate e^(xy) the result
is still going to be e^(xy). Because we know
from single variable calculus that nothing
changes. So my derivative here is still e^(xy).
However just like with single variable calculus
you always have to remember in partial derivative
problems to apply chain rule. And in the case
of the exponential function here e^(xy) when
we take the derivative we get e^(xy) but then
we apply chain rule which means we multiply
by the derivative of the inside function.
The inside function is xy and the derivative
of xy is affected by our partial derivative.
We're taking the partial derivative with respect
to x. So what now is the derivative of xy
with respect to x? Well if we look at that
xy and we're interested in x we can factor
out the y in front. And we can write that
as yx. Now the derivative with respect to
x, y acts like a constant coefficient, it
stays out in front. The derivative of x is
1. So we get y times 1 or just y. Which means
when we apply chain rule we have to multiply
this here by y and we end up with y times
e^(xy). Now if we move over here to the partial
derivative with respect to y we'll see the
same thing play out. So the partial derivative
of f with respect to y is going to be equal
to... The derivative of e^(xy) just like single
variable calculus, when we differentiate that
nothing changes, so we get e^(xy). But then
we have to apply chain rule which means we
have to multiply by the derivative of the
inside function. The inside function is xy
and so we need to multiply by the derivative
of xy. So the derivative of xy with respect
to y, since that's what we're differentiating...
If we look at that we pull the x out in front
and we can call it x times y, taking the derivative
of that with respect to y. Well the x acts
like a constant coefficient out in front and
the derivative of y is 1. So we get x times
1 or just x. Which means we have to multiply
this by x and we get x times e^(xy). Now if
we look at second order partial derivatives,
we'll first take the derivative of this with
respect to x again. So that will be partial^2
f partial x^2, the second order partial derivative
with respect to x. So we have ye^(xy). Your
derivative rules from single variable calculus
all still apply. So because we're taking the
second-order partial derivative with respect
to x, remember that we're treating y as a
constant, so this y out in front here is just
like a constant coefficient, it's like having
3e^(xy). And that 3 can just hang out there
in front and not affect anything, we can just
leave it right where it is. So we can almost
even ignore that. And then again we're just
taking the derivative of e^(xy) with respect
to x. And we already know what that is. We
already took the derivative of e^(xy) with
respect to x and the result was ye^(xy). So
the derivative of this with respect to x will
be ye^(xy). But we have this other y still.
So the final result will be y^2e^(xy). And
then the partial derivative with respect to
x, and then here we took the partial derivative
of x first and then y, it's going to be equal
to... So now we're differentiating this with
respect to y. And because we're doing that,
we now have to apply product rule from single
variable calculus because we have the product
of two functions. We have two functions that
are in terms of y. The first one is y, the
second one is e^(xy). So we need to apply
product rule to take the derivative. We didn't
have to do that here with x because with x,
y was a constant so this y in front here could
just be a constant coefficient in front, we
didn't have to treat it like a variable. But
now we do because we're differentiating with
respect to y. So remember product rule tells
us that we want to take the derivative of
one function first. So we'll take the derivative
of y and the derivative of y with respect
to y is of course 1. Then we multiply that
by the other function without doing anything
to it. So we multiply that by e^(xy). Then
we add to that the opposite situation. This
time we leave y alone and we do nothing to
that, but we multiply by the derivative of
the other function. So the derivative of e^(xy)
with respect to y... Well we actually already
found that. Up here we had e^(xy) and we took
the derivative with respect to y. The result
was xe^(xy) so we can multiply this by xe^(xy).
And when we simplify this here we end up with
e^(xy) plus xye^(xy). We could leave our answer
this way or if we wanted to we could factor
out an e^(xy) and we would get e^(xy) times
1 plus xy. Now I'll let you verify if you
want to that this is the same result you get
when you differentiate this first order partial
derivative with respect to x, because here
we did the partial derivative with respect
to y and then if we took the partial derivative
with respect to x that would be a mixed derivative
equal to this mixed derivative here. So we'll
get this either way. So all we have left then
is the second order partial derivative with
respect to y. So that will be the second order
partial derivative with respect to y which
means we're differentiating xe^(xy) with respect
to y. And again just like over here in this
case we hold x as a constant. So this x out
in front here gets treated like a constant,
it can just be a constant coefficient, we
don't have to use product rule or anything
like that because we're not treating x like
a variable. So then we're just taking the
derivative of e^(xy) with respect to y. Which
again we already did here. We had e^(xy) we
took the derivative with respect to y. So
the derivative of this portion we know is
xe^(xy). But we still have this x hanging
out in front so we have to include it too
and we can say that the second derivative
is then x^2e^(xy). The only other thing to
mention here now that we found all of the
first-order and second-order partial derivatives,
is that at this point you have functions that
model all the first derivatives, all second
derivatives. But a lot of times you're going
to need to find a partial derivative at a
particular point. So for example we're going
to want the partial derivative with respect
to x at the point (2,3) like we talked about
earlier in the video. Or you're going to want
to find the second-order partial derivative
with respect to y at the point (2,3). Well
we have all these functions that model these
derivatives. If we ever want to find the value
of one of these at a particular point, all
we do is we plug in the coordinate point that
we're interested in, into that partial derivative.
So for example if we want to find the value
of the second derivative with respect to x,
then we're looking at the second derivative
here with respect to x. Let's say we want
to find that at the point (2,3). All we do
is we take the same notation here and then
we add in here that we're evaluating this
at the point (2,3). So that's just like saying
evaluate the second-order partial derivative
with respect to x at the point (2,3). And
then we just plug that point in here. So y
is 3, x is 2. So 3^2 is going to give us 9,
and then e to the 2 times 2 is 6 so we get
9e^6. So while you can find these partial
derivatives, all these functions that model
the first and second order partial derivatives.
If you need to evaluate at a particular point
all you do is take that point, plug it into
the function you found, and that will tell
you the value of that partial derivative at
that particular point. I hope that video helped
you and if it did, hit that like button, make
sure to subscribe, and I'll see you in the
next video.
