Partial Derivatives PDF
Partial Derivatives PDF
MULTIVARIABLE DERIVATIVES
If f (x) = 5x3 , then f 0 (x) = 5 · 3x2 = 15x2 . In exactly the same way, if you’re given
g(x) = ax3 , and told that a is a constant, then you find that g 0 (x) = a · 3x2 = 3ax2 . If
you are now told that a = 5, you can plug in 5 for a in this latter answer to get what
you got before.
Suppose now that you’re given the function of two variables h(x, y) = yx3 . Since
y is one of the independent variables in h, clearly y is not intended to always be
constant. However, if you’re told to assume that, for some physical or mathematical
reason, y is held constant at the value y = 5, and asked to differentiate h as a function
of x, you would look at h(x, 5) = 5x3 , and differentiate, to once again obtain 15x3 . If,
instead, you’re told to assume that y is held constant at the value y = 7, and asked to
differentiate h as a function of x, you would look at h(x, 7) = 7x3 , and differentiate to
obtain 21x3 .
More generally, you could just be told to assume that y is held constant, without
being told that that constant value is 5 or 7 or anything else specific; then, you can
calculate the derivative of yx3 , with respect to x, thinking of y as a constant; you find
y · 3x2 .
This process of taking the derivative, with respect to a single variable, and holding
constant all of the other independent variables, is called finding (or, taking) a partial
derivative. This is a fundamental mathematical concept that arises in many contexts.
Basics:
∂z ∂f
, , fx (x, y), or f1 (x, y).
∂x ∂x
2.1. PARTIAL DERIVATIVES 19
In the same way, the derivative of f , with respect to y, holding x constant, is called
the partial derivative of f , with respect to y, and is denoted by any of
z = f (x, y) = x2 − y 2 .
∂z ∂f ∂
x2 − y 2 = 2x.
= = fx (x, y) = f1 (x, y) =
∂x ∂x ∂x
20 CHAPTER 2. MULTIVARIABLE DERIVATIVES
Remark 2.1.3. Note that the prime notation for derivatives would be bad when cal-
culating partial derivatives. For instance, (xy 2 + 5y 3 )0 would be totally ambiguous.
The symbol ∂ looks sort of like a backwards lower-case delta, δ. It is usually read
simply as “partial”, and ∂f /∂x is read as “partial f partial x”. Occasionally, the symbol
∂ is referred to as a “round d”.
It’s not wrong to write the partial derivative here, but it could be misleading in some
cases; it might make someone wonder what the others variables are.
Let’s look at the function from the previous example: z = f (x, y) = x2 − y 2 , for
which we found that From the above, we know that fx (0.7, 0.5) = 2(0.7) = 1.4, but how
can we “see” this?
Figure 2.1.1: y = 0.5
cross section of fx (x, y) = 2x and fy (x, y) = −2y.
z = x2 − y 2 .
2.1. PARTIAL DERIVATIVES 21
1.5
z
Consider the partial derivative
1
∂f 0.5
= fx (0.7, 0.5). x
∂x
(0.7,0.5)
-1.5 -1 -0.5 0 0.5 1 1.5
-0.5
-1
y=0.5:
When calculating the partial derivative with respect to x, we hold y constant. This -1.5
means that, if we want to calculate fx (0.7, 0.5), we may first fix y = 0.5, and then Figure 2.1.2: Slope
take the one-variable derivative with respect to x. Graphically, this means that we take of tangent line equals
∂z/∂x.
the y = 0.5 cross section of the hyperbolic paraboloid (recall Section 1.8) defined by
z = x2 − y 2 ; this gives us the graph of z = x2 − 0.25 in the copy of the xz-plane where
y = 0.5.
The partial derivative fx (0.7, 0.5) is then the slope of the tangent line to the graph
of z = x2 − 0.25 at the point where x = 0.7; see Figure 2.1.1 and Figure 2.1.2.
∂f
= fy (−1, 0.7). Figure 2.1.3: x = −1
∂y
(−1,0.7) cross section of
z = x2 − y 2 .
x=-1: z
We know that fy (−1, 0.7) = −2(0.7) = −1.4, and we can see this graphically just as we 1
graph of z = 1 − y 2 in the copy of the yz-plane where x = −1. The partial derivative Figure 2.1.4: Slope
fy (−1, 0.7) is then the slope of the tangent line to the graph of z = 1 − y 2 at the point of tangent line equals
where y = 0.7; see Figure 2.1.3 and Figure 2.1.4. ∂z/∂y.
Example 2.1.6. Now we’ll calculate partial derivatives that are a bit more difficult.
Let’s find the partial derivatives of xy 2 + 5y 3 .
we find
∂
xy 2 + 5y 3 = 1 · y 2 + 0 = y 2 .
∂x
Now, calculate the partial derivative with respect to y, by thinking of x as constant;
we find
∂
xy 2 + 5y 3 = x · 2y + 15y 2 = 2xy + 15y 2 .
∂y
∂f f (x + ∆x, y) − f (x, y)
fx (x, y) = = lim
∂x ∆x→0 ∆x
and
∂f f (x, y + ∆y) − f (x, y)
fy (x, y) = = lim ,
∂y ∆y→0 ∆y
provided that these limits exist. Of course, if the limits don’t exist, we say that the
partial derivatives don’t exist.
Note that this means that the units of ∂f /∂x are the units of f divided by the units of
x, and the units of ∂f /∂y are the units of f divided by the units of y.
These partial rates of change come up often in physical situations. Of course, in lots
of problems, the variable names won’t be x and y.
V = πr2 h,
where r is the radius of the base, and h is the height. Suppose that the cylinder is some
sort of container for which the height can vary, such as the interior of a piston.
What is the instantaneous rate of change of the volume, with respect to the height,
when the height is 0.3 meters, if the radius is held constant at 0.1 meters?
2.1. PARTIAL DERIVATIVES 23
∂V
= πr2 ,
∂h
∂V
= π(0.1)2 = 0.01π m3 /m.
∂h (r,h)=(0.1,0.3)
Note that this result is independent of h, so that, in the end, we don’t need to use
the data that h = 0.3 meters.
The examples so far have all involved functions of two variables. However, of course
the idea of a partial derivative makes sense for a real-valued function of any number of
variables; when you take a partial derivative with respect to one variable, you treat all
of the other independent variables as constants.
For instance, suppose we have a function of three variables w = f (x, y, z). For such
a function, there are partial derivatives with respect to x, y, and z. When you take
a partial derivative with respect to one of x, y, or z, you assume that the other two
independent variables are constant.
w = f (x, y, z) = x sin(yz) + y 2 ez + x3 .
Then, we find:
∂w
= sin(yz) + 0 + 3x2 ,
∂x
24 CHAPTER 2. MULTIVARIABLE DERIVATIVES
∂w
= x(cos(yz))z + 2yez + 0,
∂y
and
∂w
= x(cos(yz))y + y 2 ez + 0.
∂z
We know from single-variable Calculus that if the derivative of a function exists and
is 0 on an open interval, then the function must be constant on the interval. There is a
generalization of this result to Rn , but we must replace “open interval” with “connected
open subset” (recall Definition 1.1.2).
This follows quickly from Theorem 2.1.9. If U is a non-empty connected open subset of Rn , and f is a
Corollary 9.19 and Theorem function on U such that all of the partial derivatives of f exist and are 0 at each
9.21 of [1]. point in U, then f is constant on U.
The condition above that all of the partial derivatives are equal to 0 is equivalent
to the condition that the vector of partial derivatives is equal to 0. For this and other
reasons, the vector of partial derivatives will be of extreme importance throughout this
book, and so we give it a name.
Note that, if the different xi ’s have different units, then the separate entries in the
gradient vector will have different units. Only if all of the xi ’s have the same units can
2.1. PARTIAL DERIVATIVES 25
→ ∂f ∂f
∇f = , = (2x, −2y) = 2 (x, −y) ,
∂x ∂y
and
→
∇f (3, 4) = (6, −8) = 2(3, −4).
→
2 z 2 z
∇w = sin(yz) + 3x , xz cos(yz) + 2ye , xy cos(yz) + y e .
∂f ∂f
= 2x + 5y and = 5x − 8y.
∂x ∂y
We now want to look at the second partial derivatives of f . The first thing to decide
is: how many ways can we take a second partial derivative?
26 CHAPTER 2. MULTIVARIABLE DERIVATIVES
∂2f
∂ ∂f ∂
fxx = 2
= = (2x + 5y) = 2,
∂x ∂x ∂x ∂x
∂2f
∂ ∂f ∂
fxy = = = (2x + 5y) = 5,
∂y∂x ∂y ∂x ∂y
∂2f
∂ ∂f ∂
fyx = = = (5x − 8y) = 5,
∂x∂y ∂x ∂y ∂x
and
∂2f
∂ ∂f ∂
fyy = = = (5x − 8y) = −8.
∂y 2 ∂y ∂y ∂y
The two second partial derivatives fxy and fyx above, the ones with one partial
derivative with respect to x and one with respect to y, are called mixed partial deriva-
tives.
Note that fxy and fyx are equal in this example. While this is not always the case,
it’s true for “most” of the functions that we deal with. More precisely, we need the
continuity condition given in the following theorem.
Theorem 2.1.13. Suppose that f , fx , fy , and fxy exist in an open ball around a
point (x0 , y0 ), and that fxy is continuous at (x0 , y0 ). Then, fyx (x0 , y0 ) exists and
For the proof, see Theorem
5.3.3 in Trench, [2].
fyx (x0 , y0 ) = fxy (x0 , y0 ).
Example 2.1.14. Just because the order of partial differentiation doesn’t (typically)
matter as far as the final resulting higher-order partial derivative is concerned, that
doesn’t mean that calculating the partial derivatives in different orders is equally easy.
2.1. PARTIAL DERIVATIVES 27
∂2h ∂2h
∂ ∂h ∂
5re5s = 5e5s .
= = =
∂s∂r ∂r∂s ∂r ∂s ∂r
More Depth:
Example 2.1.15. Let’s try calculating some more-complicated partial derivatives.
Suppose that
z = f (x, y) = x sin(xy) + 3y 4 .
We want to calculate the partial derivatives ∂f /∂x and ∂f /∂y. Note that x sin(xy) is the
product of two functions of x, which will require the Product Rule when differentiating
with respect to x. However, when we take the partial derivative with respect to y, we
should think of x sin(xy) as being a “constant” times a function of y; hence, we will not
need the Product Rule when applying ∂/∂y.
We find:
∂f ∂ ∂
= x· sin(xy) + sin(xy) · (x) + 0 =
∂x ∂x ∂x
∂
x cos(xy) · (xy) + sin(xy) = [x cos(xy)] · y + sin(xy) = xy cos(xy) + sin(xy),
∂x
and
∂f ∂
sin(xy) + 12y 3 =
= x·
∂y ∂y
28 CHAPTER 2. MULTIVARIABLE DERIVATIVES
∂
x cos(xy) · (xy) + 12y 3 = x cos(xy) · x + 12y 3 = x2 cos(xy) + 12y 3 .
∂y
where k is determined by the number of atoms or molecules of the ideal gas (together
with the ideal gas constant). We shall assume a value of k = 8 N·m/K in this problem.
If the temperature is held constant at 320 K, what is the instantaneous rate of change
of the pressure, with respect to volume, when the volume is 2 m3 ? (This is referred to
as isothermal expansion.)
Solution:
We write P as a function of T and V , and obtain P = 8T V −1 . What we are being
asked for is, precisely, ∂P/∂V , when (T, V ) = (320, 2). We find
∂P
= −8T V −2 Pa/m3 ,
∂V
and so
∂P
= −8(320)(2−2 ) = −640 Pa/m3 .
∂V (T ,V )=(320,2)
Example 2.1.17. Suppose that a company makes video game systems and video games,
and is willing to sell the systems at below what it costs to make them, knowing that they
can make plenty of profit on the games. Their games are backward compatible with
older systems, so that, even if they sell no new systems, they will still have some sales
2.1. PARTIAL DERIVATIVES 29
of the new games. On the other hand, manufacturing, supply, and shipping constraints
imply that, for a large fixed number of systems sold, there is a slight decrease in the
amount of profit per game sold.
Suppose that the company has determined that their profit P , in dollars, on sales
of the new games and systems, is given by
√
P = 20g − 100s − 0.01g s,
where g is the number of new games sold and s is the number of new game systems
sold.
(a) If the company sells no new systems, how much profit do they make per new game
sold?
(b) How many new systems would the company have to sell before they’d start losing
money regardless of how many new games they sell?
(c) Marginal profit means the instantaneous rate of change of the profit. The marginal
profit, per new game sold, is the instantaneous rate of change of the profit, with respect
to the number of new games sold, holding constant the number of new systems sold.
If the company has fixed sales of 250, 000 new game systems, what is the marginal
profit, per new game sold, when the number of new games sold is 1, 000, 000?
(d) If the company immediately sells 10, 000 new games, and never sells another one,
what is the marginal profit per new system sold, when the number of new systems sold
is 10, 000?
Solution:
(a) Selling no new systems means that s = 0, and then the profit is simply P = 20g.
Thus, the company makes a profit of $20 per game, when no systems are sold.
This is so simple that you don’t need to think in terms of partial derivatives. How-
ever, if we want to phrase this in terms of partial derivatives, what we have just found
is that
∂P
= 20
∂g
s=0
dollars per game. This is what you get if you first plug in s = 0.
30 CHAPTER 2. MULTIVARIABLE DERIVATIVES
∂P √
= 20 − 0.01 s
∂g
dollars per game, and then plugged in s = 0 to obtain $20 per game sold.
√
P = 20 − 0.01 s g − 100s.
√
If 20 − 0.01 s were positive, then, if g were big enough, P would be positive.
For the company to lose money, regardless of the value of g, it would have to be the
√
case that 20 − 0.01 s ≤ 0, so that P is negative, no matter how big g is. This is true
√ √
if and only if 20 ≤ 0.01 s, i.e., 2000 ≤ s or, equivalently, 4, 000, 000 ≤ s.
dollars per new game sold, regardless of the number of games sold.
(d) In this part, g is fixed at 10, 000. The marginal profit, per new game system sold,
is
∂P 1 −1/2 0.005g
= −100 − 0.01g s = −100 − √ ,
∂s 2 s
dollars per system sold. As g = 10, 000, when s = 10, 000, we find that the marginal
profit, per new system sold is
(0.005)(10, 000)
−100 − √ = −100.50,
10, 000
dollars per system, i.e., the company loses $100.50 per new system sold.
2.1. PARTIAL DERIVATIVES 31
Example 2.1.18. Suppose that g(x, y) = xey + y 2 tan−1 x. Calculate the dot product
→
∇g(1, 1) · (2, −2).
Solution:
We find
y2
→
y y −1
∇g = e + , xe + 2y tan x ,
1 + x2
and so
→ 1 π 1 π
∇g(1, 1) = e+ , e+2· = e+ , e+ .
2 4 2 2
Therefore,
→ 1 π
∇g(1, 1) · (2, −2) = e + , e + · (2, −2) =
2 2
1 π
2 e+ + (−2) e + = 1 − π.
2 2
In general, partial derivatives make sense for functions of any number of variables,
i.e., for y = f (x1 , x2 , . . . , xn ).
The partial derivative of such an f with respect to xi , where i is one of the indices
from 1 to n, is denoted by
∂y ∂f
, , fxi , or fi ,
∂xi ∂xi
and it simply means the derivative of f , with respect to xi , holding all of the other
independent variables constant.
We now give the general, limit-based, definition of the partial derivative; naturally,
it amounts to fixing all of the variables except one, and using the limit definition of the
derivative in that one changing variable position.
This rigorous definition doesn’t make it any easier for us to calculate partial deriva-
tives; we give it for the sake of completeness and because, this definition, written in
32 CHAPTER 2. MULTIVARIABLE DERIVATIVES
vector notation, generalizes nicely to allow us to define the derivative at a point, with
respect to, or in the “direction of” any vector (which we will look at in Section 2.2).
provided that this limit exists. If the limit fails to exist, then we say that the partial
derivative is undefined.
Recalling that ei denotes the i-th standard basis element (see Section 1.2), and
letting x = (x1 , x2 , . . . , xn ), then the definition above is equivalent to
∂f f (x + hei ) − f (x)
= lim .
∂xi h→0 h
1 1 1 1
= + + ··· + ,
Rnew R1 R2 Rn
that is,
−1
Rnew = R1−1 + R2−1 + · · · + Rn−1 .
Figure 2.1.5: Resistors in Suppose that we have such a parallel resistor element. What is the instantaneous
parallel. rate of change of the resistance in the new resistor element, with respect to one of the
resistances Ri , while holding the other resistances constant?
2.1. PARTIAL DERIVATIVES 33
Solution:
This isn’t too bad. You use the Power Rule and the Chain Rule:
2
R2
∂Rnew −2 Rnew
= − R1−1 + R2−1 + · · · + Rn−1 −Ri−2 = new
= .
∂Ri Ri2 Ri
It is slightly easier, and more elegant, to differentiate implicitly, without ever solving
algebraically for Rnew . That is, you simply take
−1
Rnew = R1−1 + R2−1 + · · · + Rn−1 ,
and take partial derivatives of both sides with respect to Ri , keeping in mind that all
of the other independent variables are constant as far as Ri is concerned, but the
dependent variable Rnew is not constant.
We find
∂Rnew
−2
−Rnew = −Ri−2 ,
∂Ri
and so recover quickly the result that
2
∂Rnew Rnew
= .
∂Ri Ri
Hopefully, you remember from single-variable Calculus that, on an open interval, all
of the anti-derivatives of a function look the same, except that they may differ by a
constant. A similar result is true for multivariable functions; this easy, but important,
result follows quickly from Theorem 2.1.9.
Proof. Simply apply Theorem 2.1.9 to the function f −g, in order to conclude that f −g
is constant on U. The desired conclusion follows.
∂f ∂f
= 3x2 − 5y 2 and = −10xy + 8y 3 .
∂x ∂y
Can we determine f ? The answer is: yes, up to the addition of an arbitrary constant.
First, we’ll undo partial differentiation with respect to x. This is “partial anti-
differentiation” (even though no one ever says that); that is, since ∂f /∂x = 3x2 − 5y 2 ,
we look at the anti-derivative
Z
f = (3x2 − 5y 2 ) dx,
It is customary to write dx in
this “partial anti-derivative”,
not ∂x. If this seems inconsis-
which is with respect to x, holding y constant.
tent to you, we sympathize.
Assuming that y is a constant, we find
Z
f = (3x2 − 5y 2 ) dx = x3 − 5xy 2 + A(y), (2.2)
∂
x3 − 5xy 2 + A(y) = 3x2 − 5y 2 ,
∂x
and so, if we want to allow for every possible anti-derivative, with respect to x, in
Formula 2.2, we must allow for A(y) to be an arbitrary function of y.
2.1. PARTIAL DERIVATIVES 35
f = x3 − 5xy 2 + A(y),
Z
A(y) = 8y 3 dy = 2y 4 + C,
f (x, y) = x3 − 5xy 2 + 2y 4 + C,
You can, of course, take second partial derivatives of functions of more than two
variables, and you can take partial derivatives of higher order than second order. As-
suming existence and continuity of all of the partial derivatives, the order in which you
take the partial derivatives doesn’t matter; all the matters is how many times you take
the partial derivative with respect to each variable. The total number of times that you
take partial derivative is called the order of the partial derivative.
The relevant theorem is:
36 CHAPTER 2. MULTIVARIABLE DERIVATIVES
which are equal to every other 4th order partial derivative that’s with respect to x twice,
and y and z once each.
these just yield the vectors of partial derivatives of the component functions, i.e.,
∂p
= pu = (xu , yu , zu ),
∂u
and
∂p
= pv = (xv , yv , zv ).
∂v
Of course, p could have been a multi-component function from any subset of any
m
R to any subset of any Rn , and we could have done the analogous thing.
In addition, all of our product rules involving multi-component functions from Sec-
tion 1.6 remain true for partial derivatives.
Then,
fr = (cos θ, sin θ) ,
frr = (0, 0) ,
and
frθ = fθr = (− sin θ, cos θ) .
u, −2v 3 + uv, 3v 4 − uv 2 .
p(u, v) =
Calculate the the cross product pu × pv , and determine the (u, v) pairs for which
the cross product equals 0.
Solution:
We quickly calculate
pu = (1, v, −v 2 )
and
0, −6v 2 + u, 12v 3 − 2uv = (−6v 2 + u) 0, 1, −2v .
pv =
Therefore,
h i
(−6v 2 + u) (1, v, −v 2 ) × 0, 1, −2v =
i j k
2 = (−6v 2 + u)(−v 2 i + 2v j + k).
(−6v + u) 1 v −v 2
0 1 −2v
2.1.1 Exercises
Basics:
1. f
More Depth:
2. G
u, −2v 3 + uv, 3v 4 − uv 2 .
p(u, v) =