functions of several variables and partial di erentiationfacstaff.cbu.edu/~wschrein/media/m232...

56
CHAPTER 12 Functions of Several Variables and Partial Dierentiation 1. Functions of Several Variables Definition. A function of two variables is a rule that assigns a real number f (x, y ) to each pair of real numbers (x, y ) in the domain of the function. We write f : D R 2 ! R. Example. f (x, y )= e x cos y Note. This definition easily expands to 3 or more variables. Example. f (x, y, z )= x 2 cos y sin z Domains Unless specifically stated otherwise, the domain of a function of several variables is the set of all values of the variables for which the given expression is defined. Example. f (x, y )= ln(x - 3) p y +2 x 2 - 4 Cannot have x = ±2. Need x> 3. Need y ≥-2. D f = n (x, y ) 2 R 2 : x> 3 and y ≥-2 o 56

Upload: others

Post on 05-Aug-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

CHAPTER 12

Functions of Several Variables and Partial Di↵erentiation

1. Functions of Several Variables

Definition. A function of two variables is a rule that assigns a real numberf(x, y) to each pair of real numbers (x, y) in the domain of the function. Wewrite

f : D ✓ R2 ! R.

Example.f(x, y) = ex cos y

Note. This definition easily expands to 3 or more variables.

Example.f(x, y, z) = x2 cos y sin z

Domains

Unless specifically stated otherwise, the domain of a function of several variablesis the set of all values of the variables for which the given expression is defined.

Example.

f(x, y) =

⇥ln(x� 3)

⇤py + 2

x2 � 4Cannot have x = ±2.

Need x > 3.

Need y � �2.

Df =n

(x, y) 2 R2 : x > 3 and y � �2o

56

Page 2: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

1. FUNCTIONS OF SEVERAL VARIABLES 57

Graphing Functions z = f(x, y) of Two Variables

Maple. See func2var(12.1).mw or func2var(12.1).pdf.

See Matching functions (matchfunctions.jpg).

Contour Plots

A level curve or contour of f(x, y) is the 2-dimensional graph of the equation

f(x, y) = c.

These are obtained from a surface by slicing it with horizontal planes.

A contour plot of f(x, y) is a graph of numerous level curves

f(x, y) = c,

for representative values of c.

A density plot shades each pixel according to the size of the function value atthe point reprsenting the pixel, with di↵erent colors and shades representingdi↵erent function values.

Maple. See contour(12.1).mw or contour(12.1).pdf.

See Matching Functions and Contours (matchcontour.jpg).

See Dali’s Target (Dali.jpg).

Graphing Functions w = f(x, y, z) of 3 Variables

Since we cannot see in 4 dimensions, we can only graph level surfaces of theform

w = f(x, y, z) = c.

Maple. See func3var(12.1).mw or func3var(12.1).pdf.

See Level Surfaces (Level Surfaces.jpg).

Page 3: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

58 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

2. Limits and Continuity

Letd�(x, y), (a, b)

�=p

(x� a)2 + (y � b)2

andd�(x, y, z), (a, b, c)

�=p

(x� a)2 + (y � b)2 + (z � c)2.

Definition. Let f be defined on the interior of a circle centered at (a, b),except possibly at (a, b) itself.

We saylim

(x,y)!(a,b)f(x, y) = L

if for every ✏ > 0 there exists a � > 0 such that

|f(x, y)� L| < ✏

whenever0 < d

�(x, y), (a, b)

�< �.

Note. This means f(x, y) ! L as (x, y) ! (a, b) along any path toward(a, b).

Page 4: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

2. LIMITS AND CONTINUITY 59

Below are some exotic paths for (x, y) ! (0, 0)

Theorem. If lim(x,y)!(a,b)

f(x, y) = L and lim(x,y)!(a,b)

g(x, y) = M , then

(1) lim(x,y)!(a,b)

⇥f(x, y) ± g(x, y)

⇤= L ± M

(2) lim(x,y)!(a,b)

⇥f(x, y)g(x, y)

⇤= LM

(3) lim(x,y)!(a,b)

f(x, y)

g(x, y)=

L

Mprovided M 6= 0.

Note. If a polynomial in two variables is any sum of terms of the formcxnym, then the limit of the polynomial exists everywhere and is found simplyby substitution.

Example.

lim(x,y)!(3,2)

3xy2 + 6xy

2x2y + 4y=

3 · 3 · 4 + 6 · 3 · 2

2 · 9 · 2 + 4 · 2=

36 + 36

36 + 8=

72

44=

18

11

Note.

(1) If f(x, y) ! L1 along a path P1 toward (a, b), and f(x, y) ! L2 6= L1

along a path P2 toward (a, b),then

lim(x,y)!(a,b)

f(x, y)

does not exist (DNE).

Page 5: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

60 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

(2) The simplest paths to try when you suspect a limit does not exist are below.Either find one where a limit does not exist or two with di↵erent limits. If youexpect the limit does exist, use one of these paths to find a value for the limit,then establish that limit by methods to be given below.

(a) vertical lines: x = a, y ! b

(b) horizontal lines: y = b, x ! a

(c) y = g(x) and x ! a while b = g(a)

(d) x = g(y) and y ! b where a = g(b)

Example. Find lim(x,y)!(0,0)

x2 � y2

x2 + y2.

For x = 0 (approaching the origin along the y-axis),

lim(x,y)!(0,0)

x2 � y2

x2 + y2= lim

y!0

�y2

y2= lim

y!0(�1) = �1.

But for y = 0 (approaching the origin along the x-axis),

lim(x,y)!(0,0)

x2 � y2

x2 + y2= lim

x!0

x2

x2= lim

y!0(1) = 1.

Since the limits along the two paths are di↵erent, lim(x,y)!(0,0)

x2 � y2

x2 + y2does not

exist (DNE).

Page 6: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

2. LIMITS AND CONTINUITY 61

Example. Find lim(x,y)!(0,0)

2x2y

x4 + y2.

For x = 0 (approaching the origin along the y-axis),

2x2y

x4 + y2=

0

y2= 0 ! 0 as y ! 0.

For y = 0 (approaching the origin along the x-axis),

2x2y

x4 + y2=

0

x4= 0 ! 0 as x ! 0.

But, along the parabola y = x2,

2x2y

x4 + y2=

2x4

x4 + x4=

2x4

2x4= 1 ! 1 as (x, y) ! (0, 0).

Since we now have di↵erent limits along two paths, lim(x,y)!(0,0)

2x2y

x4 + y2does not

exist (DNE).

Showing that a limit exists

Theorem (2.1). Suppose |f(x, y) � L| g(x, y) for all (x, y) in theinterior of some circle centered at (a, b), except possibly at (a, b).

If lim(x,y)!(a,b)

g(x, y) = 0, then lim(x,y)!(a,b)

f(x, y) = L

Page 7: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

62 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example. Find lim(x,y)!(0,0)

3x2 � y2 + 5

x2 + y2 + 2.

Along the path y = 0 (approaching the origin along the x-axis),

3x2 � y2 + 5

x2 + y2 + 2=

3x2 + 5

x2 + 2! 5

2as x ! 0,

so5

2is the only possible limit. Then, using Theorem 2.1,

�����3x2 � y2 + 5

x2 + y2 + 2� 5

2

����� =

�����6x2 � 2y2 + 10� 5x2 � 5y2 � 10

2x2 + 2y2 + 4

����� =

�����x2 � 7y2

2x2 + 2y2 + 4

����� =|x2 � 7y2|

|2x2 + 2y2 + 4| x2 + 7y2

4! 0 as (x, y) ! (0, 0),

so

lim(x,y)!(0,0)

3x2 � y2 + 5

x2 + y2 + 2=

5

2.

Example. Find lim(x,y)!(0,0)

3x2|y|x2 + y2

.

Along the path y = 0,3x2|y|x2 + y2

=0

x2= 0 ! 0 as x ! 0, so 0 is the only

possible limit. Then, using Theorem 2.1,�����3x2|y|x2 + y2

� 0

����� =3x2|y|x2 + y2

= 3|y| x2

x2 + y2 3|y|! 0 as (x, y) ! (0, 0),

so

lim(x,y)!(0,0)

3x2|y|x2 + y2

= 0 .

Page 8: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

2. LIMITS AND CONTINUITY 63

Example. Find lim(x,y)!(0,0)

sin(x2 + y2)

x2 + y2.

We use polar coordinates to find the indicated limit, if it exists. Note that(x, y) ! (0, 0) is equivalent to r ! 0. We have

lim(x,y)!(0,0)

sin(x2 + y2)

x2 + y2= lim

r!0

sin(r2)

r2= (by l’Hopitals”s rule)

limr!0

2r cos(r2)

2r= lim

r!0cos(r2) = cos 0 = 1.

Thus lim(x,y)!(0,0)

sin(x2 + y2)

x2 + y2= 1.

Continuity

Definition. Suppose f(x, y) is defined in the interior of a circle centeredat (a, b). We say f is continuous at (a, b) if

lim(x,y)!(a,b)

f(x, y) = f(a, b).

If f(x, y) is not continuous at (a, b), then we call (a, b) a discontinuity of f .

Definition.

(1) An open disk is the interior of a circle, i.e., all points inside but not on thecircle.

Page 9: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

64 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

(2) A closed disk is a circle and its interior.

(3) An interior point of a region R ✓ R2 is the center of an open disk lyingentirely within R.

(4) A point is a boundary point of a region R if every open disk it is the centerof contains points both in and out of R.

Page 10: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

2. LIMITS AND CONTINUITY 65

(5) A closed region is a region that contains all of its boundary points.

(6) An open region contains none of its boundary points.

Definition. If the domain D of a function contains any of its boundarypoints, and if (a, b) is a boundary point of D, f(x, y) is continuous at (a, b) if

lim(x,y)!(a,b)

(x,y)2D

f(x, y) = f(a, b).

Note. If f(x, y) and g(x, y) are continuous at (a, b), then f + g, f � g,

and f · g are continuous at (a, b); if, in addition, g(a, b) 6= 0,f

gis continuous

at (a, b).

Theorem (2.2). Suppose f(x, y) is continuous at (a, b) and g(x) is con-tinuous at f(a, b). Then

h(x, y) = (g � f)(x, y) = g�f(x, y)

�is continuous at (a, b).

Example. Where is f(x, y) = ln(x2 + y2) continuous?

ln is continuous for all positive numbers.

Thus f(x, y) is continuous except at (x, y) = (0, 0).

Example. Where is f(x, y) =1

x2 � ycontinuous?

Since f is a quotient of continuous functions, it is continuous except wherex2 � y = 0, i.e., except along the parabola y = x2.

Note. All of the above transfers neatly to three variables.

Page 11: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

66 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Definition. Let f be defined on the interior of a sphere centered at (a, b, c),except possibly at (a, b, c) itself. We say

lim(x,y,z)!(a,b,c)

f(x, y, z) = L

if for every ✏ > 0 there exists a � > 0 such that

|f(x, y, z)� L| < ✏

whenever0 < d

�(x, y, z), (a, b, c)

�< �.

Example. Find lim(x,y,z)!(0,0,0)

(x + y + z)2

x2 + y2 + z2.

For x = y = 0 (approaching the origin along the z-axis),

lim(x,y,z)!(0,0,0)

(x + y + z)2

x2 + y2 + z2= lim

z!0

z2

z2= lim

z!01 = 1.

But for x = y = z (These are symmetric equations for the line with parametricequations x = t, y = t, and z = t, or vector equation hx, y, zi = h0, 0, 0i +th1, 1, 1i.),

lim(x,y,z)!(0,0,0)

(x + y + z)2

x2 + y2 + z2= lim

x!0

(3x)2

3x2= lim

x!0

9x2

3x2= lim

x!0(3) = 3.

Since the limits along the two paths are di↵erent, lim(x,y,z)!(0,0,0)

(x + y + z)2

x2 + y2 + z2does

not exist (DNE).

Page 12: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

2. LIMITS AND CONTINUITY 67

Example. Find lim(x,y,z)!(0,0,0)

x + y + z

ex2+y2+z2 .

For x = y = 0 (approaching the origin along the z-axis),x + y + z

ex2+y2+z2 =z

ez2 ! 0 as z ! 0,

so 0 is the only possible limit.�����x + y + z

ex2+y2+z2 � 0

����� (by 4 inequality)|x|

ex2+y2+z2 +|y|

ex2+y2+z2 +|z|

ex2+y2+z2

|x|ex2 +

|y|ey2 +

|z|ez2 ! 0 + 0 + 0 = 0 as (x, y, z) ! (0, 0, 0).

Thus lim(x,y,z)!(0,0,0)

x + y + z

ex2+y2+z2 = 0.

Definition. Suppose f(x, y, z) is defined in the interior of a sphere centeredat (a, b, c). Then f is continuous at (a, b, c) if

lim(x,y,z)!(a,b,c)

f(x, y, z) = f(a, b, c).

If f(x, y, z) is not continuous at (a, b, c), then we call (a, b, c) a discontinuityof f .

Example. f(x, y, z) =(x + y + z)2

x2 + y2 + z2is continuous everywhere except at

(0, 0, 0) since it is the quotient of continuous functions. Similarly, f(x, y, z) =x + y + z

ex2+y2+z2 is continuous everywhere since the denominator here is never 0.

Maple. See limit(12.2).mw or limit(12.2).pdf.

Page 13: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

68 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

3. Partial Derivatives

Consider a function f(x, y) defined on a region R 2 R2. Let (a, b) be an interiorpoint of R. The average rate of change as you move horizontally from (a, b) to(a + h, b) is

f(a + h, b)� f(a, b)

h.

The instantaneous rate of change in the x-direction at (a, b) is

@f

@x(a, b) = lim

h!0

f(a + h, b)� f(a, b)

h,

the partial derivative of f with respect to x.

Page 14: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

3. PARTIAL DERIVATIVES 69

The average rate of change as you move vertically from (a, b) to (a, b + h) is

f(a, b + h)� f(a, b)

h.

The instantaneous rate of change in the y-direction at (a, b) is

@f

@y(a, b) = lim

h!0

f(a, b + h)� f(a, b)

h,

the partial derivative of f with respect to y.

Page 15: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

70 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example. Let f(x, y) = x2y2.

@f

@x(x, y) = lim

h!0

f(x + h, y)� f(x, y)

h= lim

h!0

(x + h)2y2 � x2y2

h

= limh!0

x2y2 + 2xhy2 + h2y2 � x2y2

h= lim

h!0

2xhy2 + h2y2

h= lim

h!0(2xy2 + hy2) = 2xy2.

Basically, hold y constant and take the derivative with respect to x. We do

similarly for@f

@y(x, y). Then, for example,

@f

@x(3, 2) = 2 · 3 · 22 = 24.

Now let’s estimate@f

@x(3, 2) using h = .1.

@f

@x(3, 2) ⇡ f(3 + .1, 2)� f(3, 2)

.1=

38.44� 36

.1= 24.4.

Notation.@f

@x(x, y) =

@z

@x(x, y)| {z }

traditional notation

= fx(x, y)| {z }modern notation

=@

@x

⇥f(x, y)

⇤| {z }

partial differential operatorz }| {@f

@y(x, y) =

@z

@y(x, y) =

z }| {fy(x, y) =

z }| {@

@y

⇥f(x, y)

⇤Maple. See partderiv.mw or partderiv.pdf for graphic visualization and

estimation from contour diagrams and tables.

Note. These definitions easily expand to 3 or more variables.

Page 16: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

3. PARTIAL DERIVATIVES 71

Example.

@f

@x(xe

pxy) =

@f

@x(xe(xy)1/2) = e(xy)1/2 + xe(xy)1/2

⇣1

2

⌘(xy)�1/2(y) =⇣1

2

⌘ep

xy(2 +p

xy).

Note.x �!

yxykz

�!12z�1/2

(xy)1/2

kz1/2

ks

�!es

e(xy)1/2

k

ez1/2

kes

Example. f(x, y) = x ln(y cos x). Find@f

@x

⇣⇡

3, 1⌘.

@f

@x(x, y) = ln(y cos x) + x

1

y cos x(�y sin x) = ln(y cos x)� x tan x

Note.x �!� sin x

cos xks

�!y

y cos xkyskz

�!1z

ln(y cos x)k

ln(ys)k

ln z

Thus@f

@x

⇣⇡

3, 1⌘

= ln1

2� ⇡

3

p3 = �

⇣ln 2 +

⇡p3

⌘.

Page 17: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

72 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

2nd Order Partial Derivatives

fxx =@

@xfx =

@

@x

@f

@x=

@2f

@x2

fxy =@

@yfx =

@

@y

@f

@x=

@2f

@y@x

fyx =@

@xfy =

@

@x

@f

@y=

@2f

@x@y

fyy =@

@yfy =

@

@y

@f

@y=

@2f

@y2

Note. This method also extends to more variables and higher derivatives.

Example. f(x, y) = x2 + x ln y

fx(x, y) = 2x + ln y

fy(x, y) =x

y

fxx(x, y) = 2

fxy(x, y) =1

y

fyx(x, y) =1

y

fyy(x, y) = � x

y2

Note. Notice that fxy = fyx.

Theorem (3.1). If fxy and fyx are continuous at an interior point (a, b)of their domain, then

fxy(a, b) = fyx(a, b).

Page 18: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

3. PARTIAL DERIVATIVES 73

Visualizing 2nd Order Partial Derivatives

(1) fxx(a, b)

fx(a, b) < 0 since f is decreasing at (a, b) for increasing x.

fxx(a, b) < 0 since the slice through (a, b, 0) k x-axis is concave down at(a, b, f(a, b)).

(2) fxy(a, b)

fx(a, b) < 0 since f is decreasing at (a, b) for increasing x.

fxy(a, b) < 0 since the slope of successive tangent lines is decreasing for yincreasing.

Page 19: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

74 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

(3) fyx(a, b)

fy(a, b) < 0 since f is decreasing at (a, b) for increasing y.

fyx(a, b) < 0 since the slope of successive tangent lines is decreasing for xincreasing.

(4) fyy(a, b)

fy(a, b) < 0 since f is decreasing at (a, b) for increasing y.

fyy(a, b) < 0 since the slice through (a, b, 0) k y-axis is concave down at(a, b, f(a, b)).

Page 20: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

3. PARTIAL DERIVATIVES 75

Determining signs of 2nd order partial derivatives from a contour diagram.

Suppose z = f(x, y).

fx(P ) < 0 since f decreases as x increases (moving right from P ).

fy(P ) > 0 since f increases as y increases (moving up from P ).

fxx(P ) < 0 (green) since f decreases at an increasing rate as x increases. fx

decreases with increasingly closer contours.

Recall. Closer contours mean a more rapid rate of change.

fyy(P ) < 0 (orange) since f increases at a decreasing rate as y increases. fy

decreases with increasingly spread contours.

fxy(P ) > 0 (blue) since f decreases at a decreasing rate as y increases. fx

increases with increasingly spread contours.

fyx(P ) > 0 (red) since f increases at a increasing rate as x increases. fy

increases with increasingly closer contours.

Maple. See 2ndorderpart(12.3).mw or 2ndorderpart(12.3).pdf.

Page 21: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

76 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

4. Tangent Planes and Linear Approximations

Recall the linear approximation to a function f(x) at x = a. This is the tangentline given by

y = f(a) + f 0(a)(x� a).

For values of x near a, we use this equation to approximate f(x).

Similarly, we approximate values of f(x, y) near the point (a, b) by using thetangent plane to the surface z = f(x, y) near the point (a, b, f(a, b)).

But what is the equation of this plane?

Now any vector tangent to the surface at this point lies in the tangent plane.Consider tangent vectors to the surface lying in planes parallel to the x-z andy-z planes. Their cross product would be a normal vector to the plane.

Page 22: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 77

v1 k h1, 0, fx(a, b)i v2 k h0, 1, fy(a, b)i n k hfx(a, b), fy(a, b),�1iWe have

v1 k h1, 0, fx(a, b)i and v2 k h0, 1, fy(a, b)i.So we let

n = v1 ⇥ v2 =

������i j k1 0 fx(a, b)0 1 fy(a, b)

������ = h�fx(a, b),�fy(a, b), 1i.

Theorem (4.1). Suppose that f(x, y) has continuous first partial deriva-tives at (a, b). A normal vector to the tangent plane to z = f(x, y) at (a, b)is then

hfx(a, b), fy(a, b),�1i.Further, an equation of the tangent plane is given by

z � f(a, b) = fx(a, b)(x� a) + fy(a, b)(y � b)

orz = f(a, b) + fx(a, b)(x� a) + fy(a, b)(y � b).

Note. The normal line to the surface at the point (a, b, f(a, b)) is

x = a + fx(a, b)t, y = b + fy(a, b)t, z = f(a, b)� t

orhx, y, zi = ha, b, f(a, b)i + thfx(a, b), fy(a, b),�1i.

Page 23: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

78 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Using the tangent plane, the linear approximation L(x, y) of f(x, y) at (a, b) is

L(x, y) = z = f(a, b) + fx(a, b)(x� a) + fy(a, b)(y � b).

Note. Again, this all extends to 3 or more variables.

Example. Suppose f(x, y) = x2y3. Find the tangent plane at (1, 1, 1).

fx(x, y) = 2xy3 =) fx(1, 1) = 2.

fy(x, y) = 3x2y2 =) fy(1, 1) = 3.

Since f(1, 1) = 1, the equation of the tangent plane at (1, 1, 1) is

z = 1 + 2(x� 1) + 3(y � 1)

orz = 2x + 3y � 4.

Then the linear approximation at (1, 1) is

L(x, y) = 2x + 3y � 4.

Now f(1.1, 1.1) = 1.61051, and

L(1.1, 1.1) = 2.2 + 3.3� 4 = 1.5

is an approximation with error= 0.11051.

Page 24: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 79

Increments and Di↵erentials

Recall that the increment �y of f(x) at x = a is

�y = f(a + �x)� f(a),

and for �x “small,”�y ⇡ dy = f 0(a)�x.

For z = f(x, y), we define the increment of f at (a, b) to be

�z = f(a + �x, b + �y)� f(a, b).

Page 25: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

80 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

�z = f(a + �x, b + �y)� f(a, b) =⇥f(a + �x, b + �y)� f(a, b + �y)

⇤+⇥f(a, b + �y)� f(a, b)

⇤=

fx(u, b + �y)⇥(a + �x)� a

⇤+ fy(a, v)

⇥(b + �y)� b

⇤(by MVT) =

fx(u, b + �y)�x + fy(a, v)�y =nfx(a, b) +

⇥fx(u, b + �y)� fx(a, b)| {z }

✏1

⇤o�x+

nfy(a, b) +

⇥fy(a, v)� fy(a, b)| {z }

✏2

⇤o�y =

fx(a, b)�x + fy(a, b)�y| {z }dz

+ ✏1�x + ✏2�y| {z }error

.

Since fx and fy are continuous,

✏1 ! 0 and ✏2 ! 0 as (�x, �y) ! (0, 0).

Page 26: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 81

Theorem (4.2). Suppose z = f(x, y) is defined on a rectangular region

R =�(x, y)|x0 < x < x1, y0 < y < y1

and fx and fy are defined on R and are continuous at (a, b) 2 R. Thenfor

(a + �x, b + �y) 2 R,

�z = f(a + �x, b + �y)� f(a, b) = fx(a, b)�x + fy(a, b)�y + ✏1�x + ✏2�y

where ✏1 and ✏2 are functions of �x and �y that tend to 0 as (�x, �y) !(0, 0).

Example. f(x, y) = x3 � 3xy.

�z = f(x + �x, y + �y)� f(x, y)

= (x + �x)3 � 3(x + �x)(y + �y)� (x3 � 3xy)

= x3 + 3x2�x + 3x(�x)2 + (�x)3 � 3xy � 3x�y

� 3y�x� 3�x�y � x3 + 3xy

= (3x2 � 3y)| {z }fx

�x + (�3x)| {z }fy

�y + (3x�x + (�x)2)| {z }✏1

�x + (�3�x)| {z }✏2

�y

Letting dx = �x and dy = �y, the di↵erential of z is

dz = fx(x, y)dx + fy(x, y)dy.

This is called the total di↵erential and we use it to approximate �z, i.e.,

�z ⇡ dz when dx = �x and dy = �y are small.

Definition. Let z = f(x, y). f is di↵erentiable at (a, b) if

�z = fx(a, b)�x + fy(a, b)�y + ✏1�x + ✏2�y

where both ✏1 and ✏2 are functions of �x and �y and

✏1 ! 0 and ✏2 ! 0 as (�x, �y) ! (0, 0).

We say f is di↵erentiable on a region R ✓ R2 if f is di↵erentiable at everypoint of R.

Page 27: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

82 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Problem (Page 861 #40).

The table here gives wind chill (how cold it feels outside) as a function oftemperature (degrees Fahrenheit) and wind speed (mph). We can think of thisas a function w(t, s). Using the table above, estimate the linear approximationof wind chill at (10, 15) and use it to estimate the wind chill at (12, 13).

(1) We estimate the linear approximation of wind chill at (10, 15):

wt(10, 15) ⇡ �5� (�32)

20� 0=

27

20= 1.35

ws(10, 15) ⇡ �25� (�9)

20� 10=�16

10= �1.6

Thenw(t, s) ⇡ L(t, s) = �18 + 1.35 (t� 10)| {z }

dt

�1.6 s� 15| {z }ds| {z }

⇡ dw

,

so

L(12, 13) = �18 + 1.35(2)� 1.6(�2)

= �18 + 5.9|{z}⇡ dw

= �12.1

There is a rise of approximately 5.9 degrees in wind chill.

Page 28: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 83

Example. Consider the solid obtained when rotating the following regionabout the x-axis. Note that the region is composed of a right triangle and aquarter-circle.

(1) Compute the volume V (x, y) of this solid.

V =1

3⇡r2h| {z }cone

+1

2

⇣4

3⇡r3

⌘| {z }

hemisphere| {z }general formula

=1

3⇡(22)(3) +

1

2

4

3⇡(23)| {z }

specific case

=28

3⇡ ⇡ 29.3215

(2)Find the volume V (x, y) of a similar solid created by rotating a region withhorizontal dimension x and vertical dimension y instead of 3 and 2.

V =1

3⇡x2y +

2

3⇡x3

(3) Oh yeah — we forgot to tell you in (1) that the “2” and the “3” were reallyjust rounded-o↵ numbers. The actual quantities can be o↵ by up to 0.5 in eachdirection. Use linear approximation to estimate the maximum possible error inyour answer to (1).

|dx| 0.5, |dy| 0.5

dV (x, y) = Vx(x, y)dx + Vy(x, y)dy

Vx(x, y) =2

3⇡xy + 2⇡x2 =) Vx(3, 2) =

2

3⇡(3)(2) + 2⇡(32) = 22⇡ ⇡ 69.1150

Vy(x, y) =1

3⇡x2 =) Vy(3, 2) =

1

3⇡(32) = 3⇡ ⇡ 9.4248

|dV (3, 2)| 69.1150(.5) + 9.4248(.5) = 39.2699

Page 29: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

84 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Extending to 3 variables

Definition. The linear approximation to f(x, y, z) at (a, b, c) is

L(x, y, z) = f(a, b, c)+fx(a, b, c)(x�a)+fy(a, b, c)(y�b)+fz(a, b, c)(z�c).

Also, if w = f(x, y, z),

�w = f(x + �x, y + �y, z + �z)� f(x, y, z)

⇡ fx(x, y, z)dx + fy(x, y, z)dy + fz(x, y, z)dz.

Maple. See linapprox(12.4).mw or linapprox(12.4).pdf.

9.4. Polar CoordinatesCartesian and polar coordinates for a point P in the plane:

We have

x = r cos(✓)

y = r sin(✓)

r = ±p

x2 + y2 or r2 = x2 + y2

tan(✓) =y

xor ✓ = arctan

⇣y

x

Page 30: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 85

Example.

(1) r = 2 =) ±p

x2 + y2 = 2 =) x2 + y2 = 4.

This is a circle of radius 2.

(2) ✓ =⇡

3=) tan

3=

y

x=)

p3 =

y

x=) y =

p3x.

This is a line through the origin with slopep

3.

Note.

(2,⇡

4) = (�2,

5⇡

4) = (�2,�3⇡

4),

i.e., there are multiple representations for each point in polar coordinates.

Page 31: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

86 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example.

(1) Find the rectangular representation of (r, ✓) = (�2, ⇡3).

x = �2 cos⇣⇡

3

⌘= �2 · 1

2= �1

y = �2 sin⇣⇡

3

⌘= �2 ·

p3

2= �

p3

Thus the Cartesian coordinates are (�1,�p

3).

(2) Find all polar representations of (2,�1).

r2 = x2 + y2 = 4 + 1 = 5 =) r = ±p

5.

We note the point is in the fourth quadrant.

tan ✓ =y

x= �1

2=) ✓ = arctan

⇣� 1

2

⌘is in the fourth quadrant.

Thus the polar representations are

(p

5, arctan⇣� 1

2

⌘+ 2k⇡) or (�

p5, arctan

⇣� 1

2

⌘+ (2k + 1)⇡), k 2 Z.

(3) Convert r = 2 sin ✓ to a rectangular equation.

r = 2 sin ✓ =) r2 = 2r sin ✓ =) x2 + y2 = 2y.

Maple. See polar(9.4).mw or polar(9.4).pdf.

Page 32: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

4. TANGENT PLANES AND LINEAR APPROXIMATIONS 87

9.5. Calculus and Polar CoordinatesSuppose r = f(✓). Then

x = r cos ✓ = f(✓) cos(✓) and y = r sin ✓ = f(✓) sin(✓)

are parametric equations for the graph. Then, at ✓ = a,

dy

dx

�����✓=a

=dyd✓(a)dxd✓ (a)

.

From the product rule,

dx

d✓= f 0(✓) cos ✓ � f(✓) sin ✓ and

dy

d✓= f 0(✓) sin ✓ + f(✓) cos ✓.

Thusdy

dx

�����✓=a

=f 0(a) sin a + f(a) cos a

f 0(a) cos a� f(a) sin a.

Example. Find the slope of the tangent line to r = sin 4✓ at ✓ =⇡

16.

f(✓) = sin 4✓ =) f 0(✓) = 4 cos 4✓

dy

dx

�����✓= ⇡

16

=2p

2 sin ⇡16 +

p2

2 cos ⇡16

2p

2 cos ⇡16 �

p2

2 sin ⇡16

=4 sin ⇡

16 + cos ⇡16

4 cos ⇡16 � sin ⇡

16

⇡ .4724

Page 33: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

88 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

5. The Chain Rule

Example.

(1) Sally runs twice as fast as Patty.

Patty runs 5 times as fast as Joey.

How much faster does Sally run than Joey?

Let s(t) = Sally’s position at time t,

p(t) = Patty’s position at time t,

j(t) = Joey’s position at time t.

ds

dj=

ds

dp· dp

dj= 2 · 5 = 10 is the chain rule.

(2) y = esin(3x). Finddy

dx.

dy

dx=

dy

dw· dw

dz· dz

dx= ew · cos z · 3 = 3esin(3x) cos(3x)

Page 34: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

5. THE CHAIN RULE 89

Problem. Findd

dt

⇥f(x, y)

⇤if x and y are functions of t.

Let g(t) = f(x(t), y(t)). Then

d

dt

⇥f(x(t), y(t))

⇤= g0(t) = lim

�t!0

g(t + �t)� g(t)

�t

= lim�t!0

f�x(t + �t), y(t + �t)

�� f

�x(t), y(t)

��t(

Let �x = x(t + �t)� x(t), �y = y(t + �t)� y(t),

�z = f�x(t + �t), y(t + �t)

�� f

�x(t), y(t)

�)

= lim�t!0

�z

�t(Recall �z = @f

@x�x + @f@y�y + ✏1�x + ✏2�y

where ✏1, ✏2 ! 0 as (�x, �y) ! (0, 0)

)

= lim�t!0

@f@x�x + @f

@y�y + ✏1�x + ✏2�y

�t

=@f

@xlim

�t!0

�x

�t+

@f

@ylim

�t!0

�y

�t+ lim

�t!0✏1 lim

�t!0

�x

�t+ lim

�t!0✏2 lim

�t!0

�y

�t.

Now lim�t!0

�x

�t= lim

�t!0

x(t + �t)� x(t)

�t=

dx

dt. Similarly, lim

�t!0

�y

�t=

dy

dt.

lim�t!0

�x = lim�t!0

⇥x(t + �t)� x(t)

⇤= 0 since x(t) is continuous. Similarly,

lim�t!0

�y = 0. Thus, since (�x, �y) ! (0, 0) as �t ! 0, we have

lim�t!0

✏1 = lim�t!0

✏2 = 0. Then

d

dt

⇥f(x(t), y(t))

⇤=

@f

@x· dx

dt+

@f

@y· dy

dt+ 0 · dx

dt+ 0 · dy

dt

=@f

@x· dx

dt+

@f

@y· dy

dt

Page 35: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

90 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Theorem (5.1 – Chain Rule). If z = f�x(t), y(t)

�, where x(t) and y(t)

are di↵erentiable and f(x, y) is a di↵erentiable function of x and y, then

dz

dt=

d

dt

⇥f(x(t), y(t))

⇤=

@f

@x

�x(t), y(t)

�dx

dt+

@f

@y

�x(t), y(t)

�dy

dt

We can use a tree diagram to illustrate this.

x and y are intermediate variables. Thendz

dtis the sum of all products of

derivatives along each path to t.

Page 36: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

5. THE CHAIN RULE 91

Example. z = f(x, y) =x

y, x = sin t, y = cos t. Find

dz

dt.

First approach:

z =x

y=

sin t

cos t= tan t =) dz

dt= sec2 t.

Second approach:

dz

dt=

@z

@x

dx

dt+

@z

@y

dy

dt=

1

ycos t +

x

y2sin t = 1 + tan2 t = sec2 t.

We now extend the Chain Rule further.

Page 37: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

92 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Theorem (5.2 – Chain Rule). Suppose z = f(x, y) where f is a di↵eren-tiable function of x and y and where x = x(s, t) and y = y(s, t) both havefirst order partial derivatives. Then

@z

@s=

@z

@x· @x

@s+

@z

@y· @y

@s

and@z

@t=

@z

@x· @x

@t+

@z

@y· @y

@t.

Page 38: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

5. THE CHAIN RULE 93

Example. Suppose z = f(x, y) with x = r cos ✓, y = r sin ✓. Find fr, frr.

We have@x

@r= cos ✓ and

@y

@r= sin ✓.

fr = fx · @x

@r+ fy ·

@y

@r= fx cos ✓ + fy sin ✓

frr =@

@r(fr) =

@

@r

�fx cos ✓ + fy sin ✓

=@

@r(fx) cos ✓ +

@

@r(fy) sin ✓

=⇣

fxx@x

@r+ fxy

@y

@r| {z }Use fx for f in diagram above

⌘cos ✓ +

⇣fyx

@x

@r+ fyy

@y

@r| {z }Use fy for f in diagram above

⌘sin ✓

=⇣fxx cos ✓ + fxy sin ✓

⌘cos ✓ +

⇣fyx cos ✓ + fyy sin ✓

⌘sin ✓

= fxx cos2 ✓ + 2fxy sin ✓ cos ✓ + fyy sin2 ✓

Page 39: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

94 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Problem (Page 870 #32).

The wave equation for the displacement u(x, t) of a vibrating string of length Lis a2uxx = utt , 0 < x < L, for some constant a2. Make the change of variables

X =x

Land T =

a

Lt to simplify the equation.

ux = uXdX

dx=

1

LuX

ut = uTdT

dt=

a

LuT

uxx =@

@x

�ux

�=

@

@x

⇣ 1

LuX

⌘=

1

L

@

@x

�uX

�=

1

L

⇣uXX

dX

dx

⌘=

1

L2uXX

utt =@

@t

�ut

�=

@

@t

⇣a

LuT

⌘=

a

L

@

@t

�uT

�=

a

L

⇣uTT

dT

dt

⌘=

a2

L2uTT

Then

a2uxx = utt =) a2⇣ 1

L2uXX

⌘=

a2

L2uTT =) uXX = uTT .

Assuming that X and T are dimensionless, find the dimensions of a2.

If x is in ft and t is in sec, a2 is insec2

ft2.

Page 40: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

5. THE CHAIN RULE 95

Implicit Di↵erentiation

Suppose F (x, y, z) = 0 implicitly defines a function z = f(x, y) where f is

di↵erentiable. Find@z

@xand

@z

@y.

Let

w = F (x, y, z) =) @w

@x= Fx

@x

@x+ Fy

@y

@x+ Fz

@z

@x.

Now, since w = 0,@w

@x= 0. Also,

@x

@x= 1 and

@y

@x= 0. Then

0 = Fx + Fz@z

@x.

If Fz 6= 0,@z

@x= �Fx

Fz.

Similarly,@z

@y= �Fy

Fz.

Theorem (Implicit Function Theorem). If Fx, Fy, and Fz are continuousinside a sphere containing (a, b, c) where F (a, b, c) = 0 and Fz(a, b, c) 6= 0,then F (x, y, z) = 0 implicitly defines z as a function of x and y near(a, b, c).

Page 41: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

96 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Problem (Page 870 #24). Suppose 3yz2 � e4x cos 4z � 3y2 = 4. Find@z

@x

and@z

@y.

F (x, y, z) = 3yz2 � e4x cos 4z � 3y2 � 4 = 0

Fx = �4e4x cos 4z, Fy = 3z2 � 6y, Fz = 6yz + 4e4x sin 4z

@z

@x= �Fx

Fz=

4e4x cos 4z

6yz + 4e4x sin 4z

@z

@y= �Fy

Fz=

�3z2 + 6y

6yz + 4e4x sin 4z

Maple. See chainrule(12.5).mw or chainrule(12.5).pdf.

Page 42: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

6. THE GRADIENT AND DIRECTIONAL DERIVATIVES 97

6. The Gradient and Directional Derivatives

The partial derivatives fx and fy measure rates of change in directions parallelto the x- and y-axes. What about other directions?

Suppose we want the instantaneous rate of change of f(x, y) at P (a, b) in thedirection given by the unit vector u = hu1, u2i. Let Q(x, y) be any point onthe line through P (a, b) in the direction of u. Then�!PQ k u =) �!

PQ = hu =) �!PQ = hx�a, y�bi = hu = hhu1, u2i = hhu1, hu2i.

Then

x� a = hu1 and y � b = hu2 =) x = a + hu1 and y = b + hu2.

Then the average rate of change from P to Q is

f(a + hu1, b + hu2)� f(a, b)

h.

Definition. The directional derivative of f(x, y) at the point (a, b) and inthe direction of the unit vector u = hu1, u2i is

Duf(a, b) = limh!0

f(a + hu1, b + hu2)� f(a, b)

hprovided the limit exists.

Note. If u = h1, 0i, Duf(a, b) = fx(a, b), and if u = h0, 1i, Duf(a, b) =fy(a, b).

Page 43: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

98 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

How to easily calculate directional derivatives.

Letg(h) = f(a + hu1, b + hu2) =) g(0) = f(a, b).

Then

Duf(a, b) = limh!0

f(a + hu1, b + hu2)� f(a, b)

h= lim

h!0

g(h)� g(0)

h= g0(0).

Now let

x = a + hu1 and y = b + hu2 =) g(h) = f(x, y) =)

g0(h) =@f

@x

dx

dh+

@f

@y

dy

dh=

@f

@xu1 +

@f

@yu2

If h = 0,

Duf(a, b) = g0(0) =@f

@x(a, b)u1 +

@f

@y(a, b)u2.

Theorem (6.1). If f(x, y) is di↵erentiable at (a, b) and u = hu1, u2i isany unit vector,

Duf(a, b) = fx(a, b)u1 + fy(a, b)u2.

Example. f(x, y) = x3 + y2,u =D3

5,�4

5

E, (a, b) = (2, 1).

fx = 3x2, fy = 2y, fx(2, 1) = 12, fy(2, 1) = 2.

Duf(2, 1) = 12⇣3

5

⌘+ 2

⇣�4

5

⌘=

28

5.

Definition. The gradient of f(x, y) is the vector-valued function

rf(x, y) =D@f

@x,@f

@y

E=

@f

@xi +

@f

@yj = hfx, fyi

provided both partial derivatives exist.

Theorem (6.2). If f is a di↵erentiable function of x and y and u isany unit vector,

Duf(x, y) = rf(x, y) · u.

Page 44: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

6. THE GRADIENT AND DIRECTIONAL DERIVATIVES 99

Properties of the gradient vector.

Suppose ✓ is the angle between rf(a, b) and u.

Then

Duf(a, b) = rf(a, b) · u = krf(a, b)k · kuk cos ✓ = krf(a, b)k · cos ✓.

Note that Duf(a, b) is maximized when ✓ = 0 or cos ✓ = 1. Also, ✓ = 0 =)rf(a, b) and u are in the same direction =) u =

rf(a, b)

krf(a, b)k .

Further, Duf(a, b) is minimized when ✓ = ⇡ or cos ✓ = �1, i.e., Duf(a, b) and

u have opposite directions =) u = � rf(a, b)

krf(a, b)k .

Finally, ✓ =⇡

2=) cos ✓ = 0 =) Duf(a, b) = 0 =) rf(a, b) ? u =) u

is tangent to the level curve at (a, b) since f is constant on level curves andrf(a, b) is orthogonal to the level curve at (a, b).

Page 45: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

100 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Theorem (6.3). Suppose f is a di↵erentiable function of x and y at(a, b). Then

(1) the maximum rate of change of f at (a, b) is krf(a, b)k, occurring inthe direction of the gradient;

(2) the minimum rate of change of f at (a, b) is �krf(a, b)k, occurringin the direction opposite the gradient;

(3) the rate of change of f at (a, b) is 0 in the directions orthogonal torf(a, b);

(4) the gradient rf(a, b) is orthogonal to the level curve f(x, y) = c at thepoint (a, b) where f(a, b) = c.

Problem (Page 881 #58). At a certain point on a mountain, a surveyorsights due west and measures a 4� rise, then sights due north and measures a3� rise. Find the direction of steepest ascent and compute the degree rise inthat direction.

We let z = f(x, y) and assume we are at the point (x0, y0, z0) on the mountain.

fx(x0, y0) = � tan 4� and fy(x0, y0) = tan 3�

Thenrf(x0, y0) = h� tan 4�, tan 3�i ⇡ h�0.06993, 0.05241i,

somewhat NW.

krf(x0, y0)k ⇡ 0.08739.

Then ✓ ⇡ arctan 0.08739 ⇡ 4.49.

Page 46: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

6. THE GRADIENT AND DIRECTIONAL DERIVATIVES 101

Extending to three variables:

Definition. The directional derivative of f(x, y, z) at the point (a, b, c)and in the direction of the unit vector u = hu1, u2, u3i is

Duf(a, b, c) = limh!0

f(a + hu1, b + hu2, c + hu3)� f(a, b, c)

hprovided the limit exists.

The gradient of f(x, y, z) is the vector-valued function

rf(x, y, z) =D@f

@x,@f

@y,@f

@z

E=

@f

@xi +

@f

@yj +

@f

@zk = hfx, fy, fzi

provided all the partial derivatives exist.

Theorem (6.4). If f is a di↵erentiable function of x, y, and z and u =is any unit vector,

Duf(x, y, z) = rf(x, y, z) · u.

Here also rf(a, b, c) points in the direction of maximum increase, which iskrf(a, b, c)k at (a, b, c).

If u is in the tangent plane to the level surface f(x, y, z) = k at (a, b, c), then

Duf(a, b, c) = rf(a, b, c) · u = 0 =)rf(a, b, c) ? u.

Theorem (6.5). Suppose f(x, y, z) has continuous partial derivatives at(a, b, c) and rf(a, b, c) 6= 0. Then rf(a, b, c) is a normal vector to thetangent plane to the surface f(x, y, z) = k at the point (a, b, c). Further,the equation of the tangent plane is

fx(a, b, c)(x� a) + fy(a, b, c)(y � b) + fz(a, b, c)(z � c) = 0

orrf(a, b, c) · hx� a, y � b, z � ci = 0.

Page 47: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

102 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example. f(x, y, z) = x2 � y

z2and S is the level surface F (x, y, z) = 0.

(a) Find unit vectors u1 and u2 in the directions of maximum increase at (0, 0, 1)and (1, 1, 1).

rf(x, y, z) =D

2x,� 1

z2,2y

z3

E.

rf(0, 0, 1) = h0,�1, 0i = u1.

rf(1, 1, 1) = h2,�1, 2i and kh2,�1, 2ik =p

9 = 3 =) u2 =D2

3,�1

3,2

3

E.

(b) Find tangent planes to S at (0, 0, 1) and (1, 1, 1).

fx(a, b, c)(x� a) + fy(a, b, c)(y � b) + fz(a, b, c)(z � c) = 0

at (0, 0, 1):�1(y � 0) = 0 or y = 0.

at (1, 1, 1):

2(x� 1)� (y � 1) + 2(z � 1) = 0 or 2x� y + 2z � 3 = 0.

(c) Find points on S where the normal vector is parallel to the x-y plane.

rf(x, y, z) k x-y plane =)rf(x, y, z) ? k (= u) =)

rf(x, y, z) · k =2y

z3= 0 =) y = 0 =)

(since F (x, y, z) = x2 � y

z2= 0) x2 = 0 =) x = 0.

Thus points of the form (0, 0, z) where z 6= 0.

Maple. See graddirect(12.6).mw or graddirect(12.6).pdf

Page 48: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

7. EXTREMA OF FUNCTIONS OF SEVERAL VARIABLES 103

7. Extrema of Functions of Several Variables

The graph below is for the function

z = xe�x22 �

y33 +y.

It appears to be a plain with a mountain and a valley.

Definition. We call f(a, b) a local maximum of f if there is an open diskR centered at (a, b) for which f(a, b) � f(x, y) for all (x, y) 2 R. f(a, b)is a local minimum of f if there is an open disk R centered at (a, b) forwhich f(a, b) f(x, y) for all (x, y) 2 R. In either case, f(a, b) is calleda local extremum of f .

From the figure above, it appears that the surface has horizontal tangent planesat local extrema, provided such tangent planes exist. Also, recalling rf(a, b)indicates the path of greatest increase and �rf(a, b) the path of greatestdecrease from (a, b), rf(a, b) = 0 if it exists.

Definition. The point (a, b) is a critical point of f(x, y) if (a, b) is in thedomain of f and rf(a, b) = 0 or does not exist.

Theorem (7.1). If f(x, y) has a local extremum at (a, b), then (a, b) isa critical point of f .

Page 49: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

104 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example (7.1). z = xe�x22 �

y33 +y.

fx = e�x22 �

y33 +y + x(�x)e�

x22 �

y33 +y = (1� x2)e�

x22 �

y33 +y.

fy = x(�y2 + 1)e�x22 �

y33 +y.

Nowfx = 0 () x = ±1 and fy = 0 () x = 0 or y = ±1.

Thus, for rf(a, b) = 0,

(x, y) = (1, 1), 1,�1), (�1, 1), or (�1,�1).

From the previous graph and the contour plot, we have a local maximum at(1, 1) and a local minimum at (�1, 1). At the other two points we have saddlepoints.

Notice the concentric “circles” near the local maximum and minimum and thehyperbolic-looking curves near saddle points.

Page 50: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

7. EXTREMA OF FUNCTIONS OF SEVERAL VARIABLES 105

Example. f(x, y) = ax2 + bxy + cy2.

fx = 2ax + by and fy = bx + 2cy.

fxx = 2a, fxy = b, and fyy = 2c.

Clearly, (0, 0) is a critical point (there may be others).

Let D = fxxfyy � f 2xy = 4ac� b2.

For a 6= 0,

f(x, y) = ahx2 +

b

axy +

c

ay2i

= ah⇣

x +by

2a

⌘2+⇣c

a� b2

4a2

⌘y2i

=)

f(x, y) = ah⇣

x +b

2ay⌘2

+⇣4ac� b2

4a2

⌘y2i.

1) D > 0 =) the expression in brackets is � 0.

a) a > 0 =) local minimum at (0, 0) since f(x, y) � 0 and f(0, 0) = 0(upward opening elliptic paraboloid).

b) a < 0 =) local maximum at (0, 0) since f(x, y) 0 and f(0, 0) = 0(downward opening elliptic paraboloid).

2) D < 0 =) saddle point at (0, 0), no maximum or minimum, graph like thatof z = x2 � y2.

3) D = 0 =) f(x, y) = a⇣x +

b

2ay⌘2

and the graph is a parabolic cylinder.

Every point on the line x +b

2ay = 0 is a local maximum (a < 0) or local

minimum (a > 0)

Page 51: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

106 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Theorem (7.2 – 2nd Derivative Test). Suppose f(x, y) has continuoussecond-order derivatives in some open disk containing the point (a, b) andthat rf(a, b) = 0. Define the discriminant D for the points (a, b) by

D(a, b) = fxx(a, b)fyy(a, b)�⇥fxy(a, b)

⇤2.

(1) If D(a, b) > 0 and fxx(a, b) > 0, then f has a local minimum at (a, b).

(2) If D(a, b) > 0 and fxx(a, b) < 0, then f has a local maximum at (a, b).

(3) If D(a, b) < 0, then f has a saddle point at (a, b).

(4) If D(a, b) = 0, then no conclusion can be drawn.

Example. f(x, y) = 3x2y + y3 � 3x2 � 3y2 + 2.

fx = 6xy � 6x = 6x(y � 1) = 0 () x = 0 or y = 1.

For x = 0, fy = 0 =) 3y(y � 2) = 0 =) y = 0 or y = 2.

Thus (0, 0) and (0, 2) are critical points.

For y = 1, fy = 0 =) 3x2 � 3 = 3(x + 1)(x� 1) = 0 =) x = ±1.

Thus (1, 1) and (�1, 1) are critical points.

Now fxx = 6y � 6, fyy = 6y � 6, fxy = 6x =) D = 36(y � 1)2 � 36x2.

At (0, 0): D = 36, fxx = �6 =) local maximum with f(0, 0) = 2.

At (0, 2): D = 36, fxx = 6 =) local minimum with f(0, 2) = �2.

At (±1, 1): D = �36 =) saddle point with f(±1, 1) = 0.

Page 52: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

7. EXTREMA OF FUNCTIONS OF SEVERAL VARIABLES 107

Problem (Page 892 #18). f(x, y) = 2y(x + 2)� x2 + y4 � 9y2.

fx = 2y � 2x and fy = 2x + 4 + 4y3 � 18y.

rf = h0, 0i =) 2y � 2x = 0 and 2x + 4 + 4y3 � 18y = 0.

First equation =) x = y. Substituting into second equation =)4x3 � 16x + 4 = 0 =) x ⇡ �2.1149, 0.2541, 1.8608.

Then critical points are (�2.1149,�2.1149), (0.2541, 0.2541), and (1.8608, 1.8608).

fxx = �2, fyy = 12y2 � 18, fxy = 2 =) D = �24y2 + 32.

At (�2.1149,�2.1149): D ⇡ �75.348 =) saddle point.

At (0.2541, 0.2541): D ⇡ 30.4504 and fxx < 0 =) local maximum.

At (1.8608, 1.8608): D ⇡ �51.1024 =) saddle point.

Page 53: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

108 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Problem. The following data show the age and income for a small numberof people. Use the linear model to predict the income of a 45-year-old and ofan 80-year-old. Comment on how accurate you think the model is.

IncomeAge in $1000’s ax + b Residuals24 30 24a + b 24a + b� 3032 34 32a + b 32a + b� 3440 52 40a + b 40a + b� 5256 82 56a + b 56a + b� 82

We want to find the line y = ax + b such that the sum of the squares of theresiduals is minimized. The residuals are the vertical distances from the pointsto the regression line.

We wish to minimize

f(a, b) = (24a + b� 30)2 + (32a + b� 34)2 + (40a + b� 52)2 + (56a + b� 82)2.

fa = 48(24a + b� 30) + 64(32a + b� 34) + 80(40a + b� 52) + 112(56a + b� 82)

=) fa = 12672a + 304b� 16960

fb = 2(24a + b� 30) + 2(32a + b� 34) + 2(40a + b� 52) + 2(56a + b� 82)

=) fb = 304a + 8b� 396

Solving rf = 0 means solving

(12672a + 304b = 16960

304a + 8b = 396

)to get a ⇡ 1.71

and b ⇡ �15.37.

Thus the regression line is y = 1.71x � 15.37. We have y(45) = $61, 580 andy(80) = $121, 430. This model has value only for x between 24 and 56.

Page 54: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

7. EXTREMA OF FUNCTIONS OF SEVERAL VARIABLES 109

Definition.

(1) f(a, b) is the absolute maximum of f on the region R if f(a, b) � f(x, y)for all (x, y) 2 R. f(a, b) is the absolute minimum of f on the region R iff(a, b) f(x, y) for all (x, y) 2 R.

(2) A region R 2 R2 is bounded if there is a disk that completely contains R.

Theorem (7.3 – Extreme Value Theorem). Suppose f(x, y) is continu-ous on the closed, bounded region R 2 R2. Then f has both an absoluteminimum and maximum on R. Further, an absolute extremum may onlyoccur at a critical point in R or at a point on the boundary of R.

Practical Procedure:

(1) Find all critical points of f in R.

(2) Find maximum and minimum values of f on the boundary of R.

(3) Compare values.

Page 55: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

110 12. FUNCTIONS OF SEVERAL VARIABLES AND PARTIAL DIFFERENTIATION

Example. Find the absolute maximum and minimum values of

f(x, y) = 2 + 2x + 2y � x2 � y2

on the triangular area bounded by x = 0, y = 0, and y = 9� x.

fx = 2� 2x and fy = 2� 2y.

rf = 0 =) x = 1 and y = 1 =) (1, 1) is a critical point and f(1, 1) = 4 .

On y = 0: f(x, y) = 2 + 2x� x2 = g(x).

g0(x) = 2� 2x = 0 =) x = 1 and g(1) = f(1, 0) = 3 .

Also, f(0, 0) = 2 and f(9, 0) = �61 .

On x = 0: f(x, y) = 2 + 2y � y2 = g(y).

By symmetry, f(0, 1) = 3 and f(0, 9) = �61 .

On y = 9� x:

f(x, y) = 2 + 2x + 2(9� x)� x2 � (9� x)2 = �2x2 + 18x� 61 = g(x).

g0(x) = �4x + 18 = 0 =) x =9

2is a critical point and f

⇣9

2,9

2

⌘= �41

2.

Thus the absolute maximum is f(1, 1) = 4 and the absolute minimum isf(0, 9) = f(9, 0) = �61.

Page 56: Functions of Several Variables and Partial Di erentiationfacstaff.cbu.edu/~wschrein/media/M232 Notes/M232C12.pdf · functions of several variables and partial differentiation (2)

7. EXTREMA OF FUNCTIONS OF SEVERAL VARIABLES 111

Example. A delivery company accepts only boxes whose length and girth(perimeter of a cross section) do not sum over 108 inches. Find the dimensionsthat provide the largest volume.

Let x, y, z, V represent length, width, height, and volume, respectively.

It should be clear that the volume is maximized when the sum of the lengthand girth is 108. Otherwise, one could get more volume by simply increasingthe length. Thus

x + 2y + 2z = 108 =) 0 < x = 108� 2y � 2z.

V = xyz =) V (y, z) = (108� 2y � 2z)yz = 108yz � 2y2z � 2yz2.

Since x, y, z > 0, there are no boundary values.

Vy = 108z � 4yz � 2z2 = (108� 4y � 2z)z

Vz = 108y � 2y2 � 4yz = (108� 2y � 4z)y

rf = 0 =) 108� 4y � 2z = 0 and 108� 2y � 4z = 0 =)(4y + 2z = 108

2y + 4z = 108

)=) x = y = 18.

V (18, 18) = 11, 664.

Thus (18, 18) gives the maximum volume and the dimensions are 36⇥ 18⇥ 18.

Maple. See extrema(12.7).mw or extrema(12.7).pdf