my notes on partial derivatives

3.3. PARTIAL DERIVATIVES
3.3
3.3.1
225
Partial Derivatives
Quick Calculus I Review
dy
You will recall that if y = f (x), then the derivative of f , denoted f 0 (x) or dx
d
or dx f (x) is the instantaneous rate of change of f with respect to x. We list
some facts about the derivative students should know:
1. f 0 (a) = lim
x!a
f (x) f (a)
x a
= lim
h!0
f (a+h) f (a)
h
2. If f is di¤erentiable at a point a ( f 0 (a) exists) then f is continuous at a.
3. f 0 (a) is the slope of the tangent to y = f (x) at x = a.
4. If f 0 (x) > 0 on an interval, then f is increasing on that interval.
5. If f 00 (x) > 0 on an interval, then f is concave up on that interval ( f is
increasing at an increasing rate).
We extend the notion of the derivative to functions of several variables.
3.3.2
De…nitions and Interpretations of Partial Derivatives
If the derivative is the rate of change, a …rst question which arises when dealing
with functions of two or more variable is "rate of change with respect to which
variable"? In other words, when we study how z = f (x; y) is changing, what
kind of change are we talking about? Is it a change with respect to x, to y,
to both? In Calculus I, the graph of a function y = f (x) was often associated
with a path along which you were walking. If the path was climbing, then the
derivative (rate of change of y with respect to x) was positive. If the path was
‡at, then the derivative (rate of change) was 0. Otherwise, it was negative. We
can carry this analogy to functions of several variables. The graph of a function
of two variables, z = f (x; y), is a surface in 3-D. It looks more like a real terrain
than the graph of a function of one variable did. Carrying the analogy, we
could say that as we walk along a path, if we are climbing then the derivative is
positive, if we are going downhill then the derivative is negative and if that path
is ‡at, then the derivative is 0. What is more complex in the case of functions of
several variables is that we can be walking in many (in…nitely many) directions.
We …rst look at what happens if we are walking in a direction parallel to the
x-axis or the y-axis. We will then see what happens when we are walking in
any direction.
Consider the surface given by z = f (x; y) and a point P (a; b; f (a; b)) on the
surface. If we intersect this surface with a plane parallel to the xz-plane through
P , then the equation of this plane is y = b (see …gure 3.5). The intersection of
this plane with the surface is a curve which only depends on x, call it g (x). Its
226
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
equation is z = g (x) = f (x; b). It is the red curve on …gure 3.5. Along this
curve, the rate of change of z with respect to x is
g 0 (x)
g (x + h) g (x)
h
f (x + h; b) f (x; b)
= lim
h!0
h
=
lim
h!0
Geometrically, this corresponds to the slope of this the curve.
Similarly, if we intersect the surface with a plane parallel to the yz-plane
through P , then the equation of this plane is x = a. The intersection of this
plane with the surface is a curve which only depends on y, call it q (y). Its
equation is z = q (y) = f (a; y). It is the green curve on …gure 3.5. The slope of
this curve is q 0 (y). and
q 0 (y)
q (y + h) q (y)
h
f (a; y + h) f (a; y)
= lim
h!0
h
=
lim
h!0
Using the idea above, we de…ne the partial derivatives of f .
De…nition 3.3.1 (partial derivatives) Let f be a function of two variables.
1. The partial derivative of f with respect to x, denoted fx (x; y) is de…ned
to be:
f (x + h; y) f (x; y)
fx (x; y) = lim
h!0
h
2. The partial derivative of f with respect to y, denoted fy (x; y) is de…ned to
be:
f (x; y + h) f (x; y)
fy (x; y) = lim
h!0
h
There are other notations for the partial derivatives.
De…nition 3.3.2 Let z = f (x; y). Then:
1. fx (x; y) = fx =
@f
@x
=
@
@x f
(x; y) =
@z
@x
= f1 = D1 f = Dx f
2. fy (x; y) = fy =
@f
@y
=
@
@y f
(x; y) =
@z
@y
= f2 = D2 f = Dy f
Remark 3.3.3 The subscripts 1 and 2 represent the …rst and second variable
which are x and y. It becomes more relevant when we deal with functions having
n variables, for large n.
Looking at the de…nition of fx (x; y), we see that the variable y is not changing. Only x is changing. So, we are computing how f (x; y) is changing with
respect to x. Geometrically, if we consider the curve C1 at the intersection of
the surface z = f (x; y) with the plane y = c where c is a constant, then such a
3.3. PARTIAL DERIVATIVES
227
curve is simply a function of x since along the curve y = c. The slope of this
curve is fx (x; y) (see …gure 3.5). To be more precise, the slope of this curve
would be fx (x; c). Similarly, fy (x; y) is the slope of the curve C2 at the intersection of the surface z = f (x; y) and the plane x = c. To be more precise, the
slope of this curve would be fy (c; y). Going back to the analogy with walking
on a terrain, fx (x; y) corresponds to the slope of the path along a direction
parallel to the x-axis and fy (x; y) corresponds to the slope of the path along a
direction parallel to the y-axis : In other words, the partial derivatives fx (a; b)
and fy (a; b) give the slope at (a; b) of C1 and C2 where C1 is the curve through
(a; b) at the intersection of z = f (x; y) and the plane y = b and C2 is the curve
through (a; b) at the intersection of z = f (x; y) and the plane x = a.
-4
-4
-2
4z
-2
0
0 0
-50
2
2x
y
-100
4
-150
-200
Figure 3.5: Intersection of a surface with planes parallel to the xz and yx-planes
This de…nition extends to functions of more than two variables. In general,
we have:
De…nition 3.3.4 Let f (x1 ; x2 ; :::; xn ) be a function of n variables. Then,
f (x1 ; x2 ; :; xi + h; ::; xn )
h!0
h
fxi (x1 ; x2 ; :::; xn ) = lim
3.3.3
f (x1 ; x2 ; :; xi ; ::; xn )
Computation
Since partial derivatives are rates of change with respect to one variable only, we
can use the rules of di¤erentiation from Calculus I. More speci…cally, we have:
Proposition 3.3.5 Rules to …nd partial derivatives of z = f (x; y)
228
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
1. To …nd fx , regard y as a constant and di¤ erentiate f (x; y) with respect to
x.
2. To …nd fy , regard x as a constant and di¤ erentiate f (x; y) with respect to
y.
Remark 3.3.6 In the process outlined above, you can use all the rules of differentiation from Calculus I.
Example 3.3.7 Find
@f
@x
and
@f
@y
for f (x; y) = x2 + y 2 + 5xy.
1.
@f
@x
=
@
@x
x2 + y 2 + 5xy = 2x + 5y
2.
@f
@y
=
@
@y
x2 + y 2 + 5xy = 2y + 5x
Example 3.3.8 Find
@f
@x
and
@f
@y
x
1+y
for f (x; y) = sin
1.
@f
@x
=
@
sin
@x
=
cos
=
cos
=
@
sin
@y
=
cos
=
cos
x
1+y
x
1+y
x
1+y
@
x
@x 1 + y
1
1+y
(chain rule)
2.
@f
@y
Example 3.3.9 Find
@z
@x
x
1+y
x
@
1 + y @y
x
1+y
x
(chain rule)
1+y
!
x
2
(1 + y)
if z is de…ned implicitly by
x2 + y 2 + z 2 = 4
Since z is de…ned implicitly, we must use implicit di¤ erentiation.
@
x2 + y 2 + z 2
@x
@z
2x + 2z
@x
@z
@x
=
@
4
@x
=
0
=
x
z
3.3. PARTIAL DERIVATIVES
Example 3.3.10 Find
@z
@x
229
if z is de…ned implicitly by
x3 + y 3 + z 3 + 6xyz = 1
Since z is de…ned implicitly, we must use implicit di¤ erentiation.
@
x3 + y 3 + z 3 + 6xyz
@x
@z
@z
3x2 + 3z 2
+ 6yz + 6xy
@x
@x
@z
2
3z + 6xy
@x
@z
@x
@z
@x
3.3.4
=
@
1
@x
=
0
3 x2 + 2yz
=
3 x2 + 2yz
3 (z 2 + 2xy)
x2 + 2yz
z 2 + 2xy
=
=
Higher Order Derivatives
If f is a function in two variables, so are fx and fy . So, we can di¤erentiate
them. Their partial derivatives will also be functions in several variables, so we
can di¤erentiate them again. Thus, we have the following:
@
@x
@
=
@y
@
=
@y
@
=
@x
(fx )x
= fxx = f11 =
(fy )y
= fyy = f22
(fx )y
= fxy = f12
(fy )x
= fyx = f21
@f
@x
@f
@y
@f
@x
@f
@y
@2f
@2z
=
@x2
@x2
@2f
@2z
=
=
2
@y
@y 2
@2z
@2f
=
=
@y@x
@y@x
2
@ f
@2z
=
=
@x@y
@x@y
=
It is similar for higher order derivatives.
Example 3.3.11 Find the second order partial derivatives for z = f (x; y) =
x3 + y 3 + x2 y 2
1. fx = 3x2 + 2y 2 x
2. fy = 3y 2 + 2x2 y
3. fxx = 6x + 2y 2
4. fyy = 6y + 2x2
5. fxy = 4yx
230
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
6. fyx = 4xy
Remark 3.3.12 You will note that the mixed partials are the same. This is not
an accident. Clairaut, a French mathematician (1713-1765) proved the following
theorem:
Theorem 3.3.13 (Clairaut’s Theorem) Suppose that f is de…ned on a disk
D which contains the point (a; b). If the functions fxy and fyx are both continuous on D, then
fxy (a; b) = fyx (a; b)
3.3.5
Di¤erentiability and Continuity
For functions of one variable, di¤erentiability at x = a simply means that the
derivative exists at x = a, that is lim f (a+h)h f (a) exists. For functions of several
h!0
variables, there are several partial derivatives to consider. We give the result as
a theorem without proof.
Theorem 3.3.14 Consider the function f (x; y). If the partial derivatives fx
and fy are continuous on an open region D, then f is di¤ erentiable at every
point in D.
Another important di¤erence between functions of one variable and functions of several variables is related to the relationship between di¤erentiability
and continuity. For functions of one variable, if f 0 (a) exists then f has to be
continuous at a. For functions f of several variables, it is possible for fx (a; b)
and fy (a; b) to exist and for f not to be continuous at (a; b). For f to be continuous we also need to know that the partials fx and fy are continuous at (a; b)
in other words that f is di¤erentiable at (a; b). We have the following theorem:
Theorem 3.3.15 If f (x; y) is di¤ erentiable at (a; b) that is if fx and fy exist
and are continuous at (a; b) then f is also continuous at (a; b).
3.3.6
Partial Di¤erential Equations
A partial di¤erential equation is an equation which involves an unknown function and some of its partial derivatives. Such equations arise in many applications in physics, chemistry, economics, ... We mention two such equations
here.
The Heat Equation:
@u
=k
@t
@2u @2u
+ 2
@x2
@y
u (x; y; t) gives the heat of an isotropic, homogeneous plate as a function
of the position on the plate: (x; y) and time: t. k is a constant which
3.3. PARTIAL DERIVATIVES
231
depends on the medium. In 3
D, the heat equation becomes
@2u @2u @2u
+ 2 + 2
@x2
@y
@z
@u
=k
@t
In this case u (x; y; z; t) gives the heat of an isotropic, homogeneous 3 D
object as a function of the position on the object: (x; y; z) and time: t.
Laplace Equation:
@2u @2u
+ 2 =0
@x2
@y
Solutions of this equation are called harmonic functions. They play a
role in problems related to heat conduction, ‡uid ‡ow.
The wave equation is:
@2u
@2u
= a2 2
2
@t
@x
It describes the motion of a waveform. Examples of waveforms include an
ocean wave, a sound wave, a wave traveling along a vibrating string. The
equation written above corresponds to the vibration of a string. u (x; t)
gives the displacement of a string x units from one end of the string at
time t. In the case of an ocean wave, the function would be of the form
u (x; y; t) and the wave equation would be
@2u
= a2
@t2
@2u @2u
+ 2
@x2
@y
The constant a is related to the vibrating medium.
Example 3.3.16 Show that u (x; y) = e
@u
@x
@2u
@x2
=
x
e
sin y satis…es Laplace equation.
x
sin y
= e
x
sin y
= e
x
cos y
and
@u
@y
@2u
@y 2
=
e
x
sin y
Therefore
@2u @2u
+ 2
@x2
@y
= e
=
0
x
sin y
e
x
sin y
232
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
Example 3.3.17 Show that u (x; t) = sin (x
ux
=
uxx
=
at) satis…es the wave equation.
cos (x
at)
sin (x
at)
at)
and
ut
=
a cos (x
utt
=
a2 sin (x
at)
Therefore
utt
a2 uxx
a2 sin (x
=
=
3.3.7
at)
a2 ( sin (x
at))
0
Partial Derivatives with Maple
Let f denote a function of one of more variables. Maple can …nd the partial
derivatives of any order of f . The table below explains the syntax to use.
Partial Syntax
Other Syntax
fx
di¤(f; x)
fxx
di¤(f; x; x)
di¤(f; x$2)
fxxx
di¤(f; x; x; x)
di¤(f; x$3)
fxy
di¤(f; x; y)
fxxy
di¤(f; x; x; y)
fyxyx
di¤(f; x; y; x; y)
See the accompanying Maple worksheet for examples.
3.3.8
We use
Partial Derivatives With Scienti…c Notebook or Workplace
@
@2 @2
@2
@
or
for …rst order partial derivatives. We use
,
,
,
2
2
@x
@y
@x @y @y@x
@2
for second order derivatives and so on.
@x@y
Example 3.3.18 Find
@f
@x
and
@f
@y
x
1+y
@ sin
@x
for f (x; y) = sin
=
x
1+y
1
x
cos
y+1
y+1
and
@ sin
x
1+y
@y
=
x
(y + 1)
2
cos
x
y+1
which is what we found earlier when we did it by hand.
3.3. PARTIAL DERIVATIVES
233
Example 3.3.19 Find all the second order derivatives of f (x; y) = x3 + y 3 +
x2 y 2
@ 2 x3 + y 3 + x2 y 2
= 2y 2 + 6x
@x2
@ 2 x3 + y 3 + x2 y 2
= 2x2 + 6y
@y 2
@ 2 x3 + y 3 + x2 y 2
= 4xy
@y@x
@ 2 x3 + y 3 + x2 y 2
= 4xy
@x@y
3.3.9
Problems
1. Find
@f
@x
and
@f
@y
for f (x; y) = 2x2
3y
2. Find
@f
@x
and
@f
@y
for f (x; y) = x2
1 (y + 2).
3. Find
@f
@x
and
@f
@y
4. Find
@f
@x
and
@f
@y
5. Find
@f
@x
and
@f
@y
for f (x; y) = (xy 1) .
p
for f (x; y) = x2 + y 2 .
6. Find
@f
@x
and
7. Find
@f
@x
8. Find
4.
2
for f (x; y) =
1
x+y .
@f
@y
for f (x; y) =
x+y
xy 1 .
and
@f
@y
for f (x; y) = ex+y+1 .
@f
@x
and
@f
@y
for f (x; y) = ln (x + y).
9. Find
@f
@x
and
@f
@y
for f (x; y) = sin2 (x
10. Find
@f
@x
and
@f
@y
for f (x; y) = xy .
11. Find
@f
@x
and
@f
@y
for f (x; y) =
12. Find
@f @f
@x , @y
and
@f
@z
13. Find
@f @f
@x , @y
and
@f
@z
14. Find
@f @f
@x , @y
and
@f
@z
15. Find
@f @f
@x , @y
and
@f
@z
for f (x; y; z) = ln (x + 2y + 3z).
16. Find
@f @f
@x , @y
and
@f
@z
2
2
2
for f (x; y; z) = e (x +y +z ) .
Ry
x
3y).
g (t) dt where g is continuous for all t.
for f (x; y; z) = 1 + xy 2 2z 2 .
p
for f (x; y; z) = x
y2 + z2 .
for f (x; y; z) = sin
1
(xyz).
234
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
17. Find
@f @f
@x , @y
@f
@z
and
for f (x; y; z) = tan (x + 2y + 3z).
18. Find all …rst order partials for f (t; ) = cos (2 t
).
19. Find all …rst order partials for f ( ; ; ) = sin cos .
20. Find all …rst order partials for f (P; V; ; v; g) = P V +
V v2
2g .
21. Find all second order partials for f (x; y) = x + y + xy.
22. Find all second order partials for f (x; y) = x2 y + cos y + y sin x.
23. Find all second order partials for f (x; y) = ln (x + y).
24. Verify that fxy = fyx for f (x; y) = ln (2x + 3y).
25. Verify that fxy = fyx for f (x; y) = xy 2 + x2 y 3 + x3 y 4 .
26. Find the value of
@z
@x
(1; 1; 1) given that xy + z 3 x
27. Show that f (x; y; z) = x2 + y 2
@2f
@2f
@2f
@x2 + @y 2 + @z 2 = 0.
2yz = 0.
2z 2 satis…es Laplace equation that is
cos 2x satis…es Laplace equation that is
@2f
@x2
+
29. Show that f (x; t) = sin (x + ct) satis…es the wave equation that is
@2f
@t2
=
28. Show that f (x; y; z) = e
2
@ f
@y 2
2y
= 0.
2
c2 @@xf2 .
30. Show that f (x; t) = sin (x + ct)+cos (2x + 2ct) satis…es the wave equation
2
2
that is @@t2f = c2 @@xf2 .
3.3.10
1. Find
Answers
@f
@x
and
@f
@y
for f (x; y) = 2x2
3y
4.
fx (x; y) = 4x
and
fy (x; y) =
2. Find
@f
@x
and
@f
@y
for f (x; y) = x2
3
1 (y + 2).
fx (x; y) = 2x (y + 2)
and
fy (x; y) = x2
1
3.3. PARTIAL DERIVATIVES
3. Find
@f
@x
and
@f
@y
235
for f (x; y) = (xy
2
1) .
fx (x; y) = 2y (xy
1)
fy (x; y) = 2x (xy
p
for f (x; y) = x2 + y 2 .
1)
and
4. Find
@f
@x
and
@f
@y
fx (x; y) = p
and
5. Find
@f
@x
and
@f
@y
x
x2
y
fy (x; y) = p
2
x + y2
for f (x; y) =
1
x+y .
1
fx (x; y) =
(x + y)
and
@f
@x
and
@f
@y
for f (x; y) =
2
(x + y)
x+y
xy 1 .
fx (x; y) =
y2 + 1
(xy
and
fy (x; y) =
7. Find
@f
@x
and
@f
@y
2
1
fy (x; y) =
6. Find
+ y2
2
1)
x2 + 1
(xy
1)
for f (x; y) = ex+y+1 .
fx (x; y) = ex+y+1
and
fy (x; y) = ex+y+1
8. Find
@f
@x
and
@f
@y
for f (x; y) = ln (x + y).
fx (x; y) =
1
x+y
fy (x; y) =
1
x+y
and
2
236
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
9. Find
@f
@x
and
@f
@y
for f (x; y) = sin2 (x
fx (x; y) = 2 sin (x
3y).
3y) cos (x
3y)
and
fy (x; y) =
10. Find
@f
@x
and
@f
@y
6 sin (x
3y) cos (x
3y)
for f (x; y) = xy .
fx (x; y) = yxy
1
and
fy (x; y) = xy ln x
11. Find
@f
@x
and
@f
@y
for f (x; y) =
Ry
x
g (t) dt where g is continuous for all t.
fx (x; y) =
g (x)
and
fy (x; y) = g (y)
12. Find
@f @f
@x , @y
and
@f
@z
for f (x; y; z) = 1 + xy 2
2z 2 .
fx (x; y; z) = y 2
and
fy (x; y; z) = 2xy
and
fz (x; y; z) =
13. Find
@f @f
@x , @y
and
@f
@z
4z
p
for f (x; y; z) = x
y2 + z2 .
fx (x; y; z) = 1
and
y
fy (x; y; z) = p
2
y + z2
and
14. Find
@f @f
@x , @y
and
@f
@z
fz (x; y; z) = p
for f (x; y; z) = sin
fx (x; y; z) = q
z
y2
1
+ z2
(xyz).
yz
1
2
(xyz)
3.3. PARTIAL DERIVATIVES
237
and
fy (x; y; z) = q
and
fz (x; y; z) = q
15. Find
@f @f
@x , @y
and
@f
@z
and
@f
@z
2
(xyz)
xy
1
2
(xyz)
fx (x; y; z) =
1
x + 2y + 3z
fy (x; y; z) =
2
x + 2y + 3z
fz (x; y; z) =
3
x + 2y + 3z
and
@f @f
@x , @y
1
for f (x; y; z) = ln (x + 2y + 3z).
and
16. Find
xz
2
2
2
for f (x; y; z) = e (x +y +z ) .
fx (x; y; z) =
2
2
2
2xe (x +y +z )
fy (x; y; z) =
2
2
2
2ye (x +y +z )
fz (x; y; z) =
2
2
2
2ze (x +y +z )
and
and
17. Find
@f @f
@x , @y
and
@f
@z
for f (x; y; z) = tan (x + 2y + 3z).
fx (x; y; z) = sec2 (x + 2y + 3z)
and
fy (x; y; z) = 2 sec2 (x + 2y + 3z)
and
fz (x; y; z) = 3 sec2 (x + 2y + 3z)
18. Find all …rst order partials for f (t; ) = cos (2 t
ft (t; ) =
2 sin (2 t
)
and
f (t; ) = sin (2 t
).
)
238
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
19. Find all …rst order partials for f ( ; ; ) = sin cos .
f ( ; ; ) = sin cos
and
f ( ; ; ) = cos cos
and
f ( ; ; )=
sin sin
20. Find all …rst order partials for f (P; V; ; v; g) = P V +
V v2
2g .
fP = V
and
fV = P +
and
v2
2g
f =
V v2
2g
fv =
V v
g
and
and
V v2
2g 2
fg =
21. Find all second order partials for f (x; y) = x + y + xy.
fx = 1 + y
and
fy = 1 + x
So
fxx = fyy = 0
and
fxy = fyx = 1
22. Find all second order partials for f (x; y) = x2 y + cos y + y sin x.
fx = 2xy + y cos x
and
fy = x2
sin y + sin x
So
fxx = 2y
y sin x
and
fyy =
cos y
and
fxy = fyx = 2x + cos x
3.3. PARTIAL DERIVATIVES
239
23. Find all second order partials for f (x; y) = ln (x + y).
fx =
1
x+y
fy =
1
x+y
and
So
fxx =
1
2
(x + y)
and
fyy =
1
2
(x + y)
and
fxy = fyx =
1
2
(x + y)
24. Verify that fxy = fyx for f (x; y) = ln (2x + 3y).
fx =
2
2x + 3y
fy =
3
2x + 3y
and
So
fxy =
and
fyx =
6
2
(2x + 3y)
6
2
(2x + 3y)
25. Verify that fxy = fyx for f (x; y) = xy 2 + x2 y 3 + x3 y 4 .
fx = y 2 + 2xy 3 + 3x2 y 4
and
fy = 2xy + 3x2 y 2 + 4x3 y 3
So
fxy = 2y + 6xy 2 + 12x2 y 3
and
fyx = 2y + 6xy 2 + 12x2 y 3
240
CHAPTER 3. FUNCTIONS OF SEVERAL VARIABLES
26. Find the value of
@z
@x
(1; 1; 1) given that xy + z 3 x
2yz = 0.
@z
y + z3
=
@x
2y 3z 2 x
Therefore
@z
(1; 1; 1)
@x
=
=
27. Show that f (x; y; z) = x2 + y 2
@2f
@2f
@2f
@x2 + @y 2 + @z 2 = 0.
Just perform the computation.
28. Show that f (x; y; z) = e
2y
2
1
2
2z 2 satis…es Laplace equation that is
cos 2x satis…es Laplace equation that is
@2f
@y 2
@2f
@x2
+
@2f
@t2
=
= 0.
Just perform the computation.
29. Show that f (x; t) = sin (x + ct) satis…es the wave equation that is
2
c2 @@xf2 .
Just perform the computation.
30. Show that f (x; t) = sin (x + ct)+cos (2x + 2ct) satis…es the wave equation
2
2
that is @@t2f = c2 @@xf2 .
Just perform the computation.