Professor Dave here, let’s revisit differentiation.
When we first learned about differentiation,
we saw it as a way to determine the rate of change for a curve given by some function
(f of x). When taking derivatives, the way we expressed the operation was by using this
“prime” symbol, so the derivative of (f of x) was (f prime of x). But there is another
notation, which we have introduced in the past that will now we be used much more frequently.
That looks like this, which is read (D, DX). This can be thought of as a differential operator,
that acts on whatever we put it in front of. So to take the derivative of f, we would put
d/dx in front of it like so. This is also commonly written as (DF, DX). Now don’t
let the new notation confuse you, this is still the same as the derivative of some function
f, which we previously called f prime, it’s just a different way of representing differentiation
that has a few benefits. For example, this differential operator distributes across sums
and differences, so d/dx of the sum of two functions, f and g, is the same as the sum
of df/dx and dg/dx. Meanwhile, when operating on a product of functions, f times g, this
will be the same as the product rule we learned previously. So d/dx(fg) equals (f)(dg/dx)
+ (df/dx)(g). And similarly the quotient rule still applies, so d/dx(f/g) equals [(g)(df/dx)
– (f)(dg/dx)]/g^2. The reason we are reintroducing this notation now is because we will want
to take more derivatives than just those that are with respect to the variable x, so we
need some clear notation that indicates which variable we will be differentiating by.
Now let's say we have a function that depends on both x and y, which we can call f(x,y).
This will end up being a surface in space rather a curve, so how can we interpret the
rate of change for this? What we end up having to do is to find the rate of change in specific
directions independently. If we want the rate of change in the x direction, much like we
have been doing already, we simply differentiate with respect to x while treating y as a constant.
The new notation for this involves using these curvy D’s instead of regular ones, which
gives us this. This is called a “partial derivative”, and it tells us to only treat
x as the variable to differentiate. Similarly, if we wanted the rate of change in the y direction,
this would be a partial derivative with respect to y. In this case, we would treat x as a
constant. Let’s consider an example, f(x,y) = xy^2 + x^3, and find the partial derivatives
with respect to x and y. First, ∂f/∂x. We will take the derivative with respect to
x just like we are used to while treating y as a constant. Remembering our power rule
for derivatives, the first term’s x becomes 1, and treating the y^2 as a constant we are
just left with y^2. Then for the second term we bring down the three and reduce the power
by one, leaving us with 3x^2. So our partial derivative ∂f/∂x becomes y^2 + 3x^2. Now
to find the partial derivative with respect to y, we will treat y as our variable while
treating x as a constant. The first term depends on y^2, so we bring down the two and reduce
the power by one, leaving us with 2y. But this is multiplied by x, which we treat as
a constant, so we get 2xy. The second term does not depend on y, so this is just a constant,
and the derivative of a constant is always zero. So we are left with 2xy for our partial
derivative ∂f/∂y. These are the rates of change in the x and y directions for our
function. We will now introduce a concept that combines
these partial derivatives, and that is called the “gradient”. The gradient of a function
is simply a vector made up of all its partial derivatives in their associated positions.
This means the x direction for ∂f/∂x, the y direction for ∂f/∂y, and so on.
We can write this out as grad f = ∂f/∂x i + ∂f/∂y j. If in three dimensions, that
would be grad f = ∂f/∂x i + ∂f/∂y j + ∂f/∂z k. The components of this gradient
vector are the partial derivatives of the function f, which we can produce in the manner
we just discussed. This vector ends up being the closest thing to a slope that we can get
in higher dimensions. It points in the direction of maximum change of the function, and has
a magnitude equal to the maximum rate of change. There’s also another common way to write
the gradient, involving this upside down triangle, which is referred to as “del”. This del
is a vector of all the partial derivative operators. So in two dimensions it is <∂/∂x,
∂/∂y>, and in three dimensions it is <∂/∂x, ∂/∂y, ∂/∂z>. Writing del in front
of a function f is the same as taking its gradient. Del has a variety of other uses
that we will get into in another lesson, but for now let’s consider one more example
of a function and find its gradient. Consider the function f(x,y,z) = (x^5)(e^2z)/y.
To find the gradient we will need all the partial derivatives, ∂f/∂x, ∂f/∂y,
and ∂f/∂z. Starting with x and treating y and z as constants, following the power
rule we bring down the 5 and subtract one from the exponent, leaving us with (5x^4)(e^2z)/y
for our partial derivative with respect to x. Now differentiating with respect to y and
keeping x and z constant, 1/y is the same as y^-1, so again using the power rule we
bring the -1 out front and subtract one from the exponent to get negative y^-2, which is
the same thing as negative 1 over y^2. Combining this with the constant terms, we get (negative
x^5)(e^2z)/y^2. Finally, we will take the derivative with respect to z while keeping
x and y constant. We must differentiate e^2z, and following the chain rule we simply keep
the e^2z but bring down the derivative of the exponent 2z, which is 2. This gives us
2e^2z, and putting it together with the constant terms we get (2x^5)(e^2z)/y. We now have all
three partial derivatives, so to get the gradient we simply put them into the vector form of
<∂f/∂x, ∂f/∂y, ∂f/∂z>. This gives us (5x^4)(e^2z)/y, (negative x^5)(e^2z)/y^2,
(2x^5)(e^2z)/y as the gradient vector for this function.
You may have noticed during this lesson that we have been using our variables x, y, and
z inside of vectors. We’ll be discussing this concept in depth when we discuss vector
fields in a moment, and we will also be discussing more uses of del. But first, let’s check comprehension.