lecture 3

29
Calculus 2 Chapter 3 Applications of partial differentiation 1 3 Applications of partial differentiation 3.1 Stationary points Higher derivatives Let U R 2 and f : U R. The partial derivatives f x and f y are functions of x and y and so we can find their partial deriva- tives. We write f xy to denote f y differentiated with respect to x. Similarly f xx denotes f x differentiated with respect to x, and f yx and f yy denote f x and f y , respectively, differentiated with respect to y. The functions f xx , f xy , f yx and f yy are the second partial derivatives of f . For the other notation for partial derivatives, we write ∂x ∂f ∂x or just 2 f ∂x 2 for f xx , ∂x ∂f ∂y or just 2 f ∂x∂y for f xy , ∂y ∂f ∂x or just 2 f ∂y∂x for f yx and ∂y ∂f ∂y or just 2 f ∂y 2 for f yy . We can also differentiate the second partial derivatives to get the third partial derivatives, and so on. For example, f xyy , or 3 f ∂x∂y 2 , is the third partial derivative obtained from differentiating f yy with respect to x. Example 1 Let f (x, y)=3x 3 y +2xy 2 - 4x 2 y. Then f x (x, y) = 9x 2 y +2y 2 - 8xy; f y (x, y) = 3x 3 +4xy - 4x 2 ; f xx (x, y) = 18xy - 8y; f yx (x, y) = 9x 2 +4y - 8x; f yy (x, y) = 4x; f xy (x, y) = 9x 2 +4y - 8x. Note that, in Example 1, f yx = f xy . This is true for all well-behaved functions. In particular, if f xy and f yx are both continuous on R 2 (or an open subset U of R 2 ) then f yx = f xy on R 2 (U ).

Upload: riffer-diff

Post on 21-Nov-2014

253 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 1

3 Applications of partial differentiation

3.1 Stationary points

Higher derivatives

Let U ⊆ R2 and f : U → R. The partial derivatives fx and fy

are functions of x and y and so we can find their partial deriva-tives. We write fxy to denote fy differentiated with respect to x.Similarly fxx denotes fx differentiated with respect to x, and fyx

and fyy denote fx and fy, respectively, differentiated with respectto y. The functions fxx, fxy, fyx and fyy are the second partialderivatives of f . For the other notation for partial derivatives, we

write∂

∂x

(∂f

∂x

)or just

∂2f

∂x2for fxx,

∂x

(∂f

∂y

)or just

∂2f

∂x∂yfor

fxy,∂

∂y

(∂f

∂x

)or just

∂2f

∂y∂xfor fyx and

∂y

(∂f

∂y

)or just

∂2f

∂y2for

fyy.

We can also differentiate the second partial derivatives to get thethird partial derivatives, and so on. For example, fxyy, or ∂3f

∂x∂y2 , isthe third partial derivative obtained from differentiating fyy withrespect to x.

Example 1 Let f(x, y) = 3x3y + 2xy2 − 4x2y. Then

fx(x, y) = 9x2y + 2y2 − 8xy;

fy(x, y) = 3x3 + 4xy − 4x2;

fxx(x, y) = 18xy − 8y;

fyx(x, y) = 9x2 + 4y − 8x;

fyy(x, y) = 4x;

fxy(x, y) = 9x2 + 4y − 8x.

Note that, in Example 1, fyx = fxy. This is true for all well-behavedfunctions. In particular, if fxy and fyx are both continuous on R2

(or an open subset U of R2) then fyx = fxy on R2 (U).

Page 2: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 2

Example 2 Let z = x cos 2y. Then

∂z

∂x= cos 2y,

∂z

∂y= −2x sin 2y,

∂2z

∂x2= 0,

∂2z

∂y∂x= −2 sin 2y,

∂2z

∂x∂y= −2 sin 2y,

∂2z

∂y2= −4x cos 2y.

Example 3 Let z =xe2x

yn. Find all the possible values of n given

that

3x∂2z

∂x2− xy2 ∂2z

∂y2= 12z.

For z =xe2x

ynwe have

∂z

∂x=

e2x + 2xe2x

yn,

=e2x(1 + 2x)

yn,

∂z

∂y= −nxe2x

yn+1,

∂2z

∂x2=

2e2x(1 + 2x) + e2x × 2

yn,

=4e2x(x + 1)

yn,

∂2z

∂y2=

n(n + 1)xe2x

yn+2.

Thus

3x∂2z

∂x2−xy2 ∂2z

∂y2=

12xe2x(x + 1)

yn−n(n + 1)x2e2x

yn=

xe2x

yn(12(x + 1)− n(n + 1)x) ,

Page 3: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 3

and so

3x∂2z

∂x2− xy2 ∂2z

∂y2= 12z ⇔ xe2x

yn(12(x + 1)− n(n + 1)x) =

12xe2x

yn,

⇔ 12(x + 1)− n(n + 1)x = 12,

(Since the result is true for all x and y.)

⇔ 12x + 12− n(n + 1)x = 12,

⇔ 12− n(n + 1) = 0,

(Since the result is true for all x.)

⇔ n2 + n− 12 = 0,

⇔ (n + 4)(n− 3) = 0,

⇔ n = −4 or n = 3.

Stationary points

Let U ⊆ R2, and let f : U → R. Then (a, b) is a stationary pointof f if the tangent plane at (a, b) is horizontal. That is, the tangentplane is parallel to the (x, y)-plane, and so has the form z = c forsome constant c.

Since the tangent plane at (a, b) passes through the point (a, b, f(a, b)),then if it is horizontal it has the form

z = f(a, b).

Recall from Chapter 1 that the equation of the tangent plane at(a, b) is

f(a, b)− z + fx(a, b)(x− a) + fy(a, b)(y − b) = 0.

Now, if (a, b) is a stationary point then f(a, b)− z = 0, and so

fx(a, b)(x− a) + fy(a, b)(y − b) = 0.

The last equation is true for all x and y. Putting x = a and y anyvalue other than b into this equation gives fy(a, b) = 0. Similarly,putting y = b and x any value other than a into this equationgives fx(a, b) = 0. Hence, if (a, b) is a stationary point of f thenfx(a, b) = 0 and fy(a, b) = 0. It is straightforward to establish theconverse of this result. Thus, to find the stationary points of f , wehave to find the solutions of the equations

fx(a, b) = 0,

fy(a, b) = 0.

Example 4 Find all of the stationary points of

f(x, y) = x2y + 3xy2 − 3xy.

Page 4: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 4

The partial derivatives of f are

fx(x, y) = 2xy + 3y2 − 3y = y(2x + 3y − 3);

fy(x, y) = x2 + 6xy − 3x = x(x + 6y − 3).

Putting fx(x, y) = fy(x, y) = 0 gives

y(2x + 3y − 3) = 0, (1)

x(x + 6y − 3) = 0. (2)

From equation (1) either y = 0 or 2x + 3y = 3. If y = 0 thenequation 2 gives x(x− 3) = 0, and so x = 0, 3. If 2x + 3y = 3 then6y = 6−4x. Thus, in this case, equation 2 gives x(3−3x) = 0, andso x = 0, 1 and y = 1, 1

3, respectively. Thus the stationary points

of f are (0, 0), (3, 0), (0, 1) and (1, 13).

Types of stationary points

There are three main types of stationary point: a local minimum,a local maximum and a saddle point. The following diagrams showa typical graph and contour-plot of these three types.

A local minimum

-2

-1

2

x

1 000 y

-1 -2

1

2

1

3

4

2

y

1

2

x

0

-1

-2 0-1

-2

1

A local maximum

-5

-4

-3

-2

-2-2

-1

-1-1

000

xy

11

22

y

1

2

x

0

-1

-2 0-1

-2

1

Page 5: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 5

A saddle point

-2 -2

-1

-1 -1

-0.5

x y000

11

0.5

2 2

1

y

1

-1

1.5

0.5

x-0.5

00.5-0.5-1.5

-1.5

1-1 1.50

Classifying stationary points

To determine the nature of a stationary point (a, b) of f we firstfind the Hessian matrix,

(fxx fxy

fxy fyy

). Here we are assuming that

fxy = fyx.

We then evaluate the determinant ∆ of the Hessian matrix at thepoint at (a, b). That is, we find the value, at (a, b), of

∆ = det

(fxx fxy

fxy fyy

)= fxxfyy − (fxy)

2.

If ∆ > 0 and fxx > 0 then (a, b) is a local minimum;

If ∆ > 0 and fxx < 0 then (a, b) is a local maximum;

If ∆ < 0 then (a, b) is a saddle point.

If ∆ = 0 then this test provides no information about the natureof the stationary point. Other methods are required to classify thestationary point in this case.

Example 5 Find all of the stationary points of

f(x, y) = x2y + 3xy2 − 3xy,

and determine their nature.

From Example 4 the stationary points of f are (0, 0), (3, 0), (0, 1)and (1, 1

3), fx(x, y) = 2xy + 3y2 − 3y = y(2x + 3y − 3) and

Page 6: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 6

fy(x, y) = x2 + 6xy − 3x = x(x + 6y − 3). Now

fxx = 2y,

fxy = 2x + 6y − 3(= fyx),

fyy = 6x.

Thus

∆ = det

(2y 2x + 6y − 3

2x + 6y − 3 6x

)= 12xy − (2x + 6y − 3)2.

When x = y = 0, ∆ = −9 < 0, and so (0, 0) is a saddle point.When x = 3 and y = 0, ∆ = −9 < 0, and so (3, 0) is a saddle point.When x = 0 and y = 1, ∆ = −9 < 0, and so (0, 1) is a saddle point.When x = 1 and y = 1

3, ∆ = 3 > 0, fxx = 2

3> 0, and so (1, 1

3) is a

local minimum.

Example 6 Find and classify the stationary points of

f(x, y) = xyex+y.

First we find the partial derivatives of f .

fx(x, y) = yex+y + xyex+y = y(x + 1)ex+y,

fy(x, y) = x(y + 1)ex+y.

(Since f is symmetrical in x and y.)

Putting fx(x, y) = fy(x, y) = 0, and using the fact that ex+y 6= 0,gives

y(x + 1) = 0, (3)

x(y + 1) = 0. (4)

From equation (3) either y = 0 or x = −1. If y = 0 then equa-tion (4) gives x = 0. If x = −1 then equation (3) gives y = −1.Thus the stationary points of f are (0, 0), and (−1,−1). Now

fxx = yex+1 + y(x + 1)ex+y = y(x + 2)ex+y,

fxy = (y + 1)ex+y + x(y + 1)ex+y = (y + 1)(x + 1)ex+y,

fyy = x(y + 2)ex+y.

Thus

∆ = det

(y(x + 2)ex+y (y + 1)(x + 1)ex+y

(y + 1)(x + 1)ex+y x(y + 2)ex+y

)

= e2(x+y)(xy(x + 2)(y + 2)− (y + 1)2(x + 1)2

).

When x = y = 0, ∆ = −1 < 0, and so (0, 0) is a saddle point.

When x = y = −1 , ∆ = e−4 > 0, fxx = −e−2 < 0, and so (−1,−1)is a local maximum.

Page 7: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 7

Examples when ∆ = 0

We now consider the problem of classifying a stationary point (a, b)when ∆ = 0 at (a, b). There is no single method for determiningthe nature of (a, b) in this case, although it is often useful to findf(x, y)−f(a, b) in order to determine the behaviour of f near (a, b);an alternative method is to consider how f varies along curves (nor-mally straight lines) passing through (a, b).

Example 7 Find and classify the stationary points of

f(x, y) = x2 + y4 + 1.

First we find the partial derivatives of f .

fx(x, y) = 2x,

fy(x, y) = 4y3.

Putting fx(x, y) = fy(x, y) = 0, gives x = 0, y = 0. Thus the onlystationary points of f is (0, 0). Now

fxx = 2,

fxy = 0,

fyy = 12y2.

Thus

∆ = det

(2 00 12y2

)

= 24y2.

Thus, at (0, 0), ∆ = 0, and so the Hessian gives us no informationabout the nature of this stationary point. However, for (x, y) 6=(0, 0), note that

f(x, y)− f(0, 0) = x4 + y4 + 1− 0− 0− 1,

= x2 + y4 > 0.

Thus f(x, y) > f(0, 0) for all (x, y) 6= (0, 0). Hence (0, 0) is a localminimum.

Example 8 Find and classify the stationary points of

f(x, y) = xy2 − x2y2 + x4 + 3.

First we find the partial derivatives of f .

∂f

∂x= y2 − 2xy2 + 4x3,

∂f

∂y= 2xy − 2x2y.

Page 8: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 8

Putting∂f

∂x=

∂f

∂y= 0 gives

y2 − 2xy2 + 4x3 = 0, (5)

2xy(1− x) = 0. (6)

From equation (6) x = 0, y = 0 or x = 1. If either x = 0 or y = 0then equation (5) gives y = 0 and x = 0, respectively. If x = 1then equation (5) gives y2 = 4, and so y = 2 or y = −2. Thus thestationary points of f are (0, 0), (1, 2) and (1,−2). Now

∂2f

∂x2= −2y2 + 12x2,

∂2f

∂x∂y= 2y − 4xy,

∂2f

∂y2= 2x− 2x2.

At the stationary point (0, 0), each of the second derivatives is zero.Thus ∆ = 0 at (0, 0), and so the Hessian gives no information aboutthe nature of this stationary point. However, for (x, y) 6= (0, 0),note that

f(x, y)− f(0, 0) = xy2 − x2y2 + x4.

In particular, for x = y we get

f(x, x)− f(0, 0) = x3 − x4 + x4 = x3.

Since the sign of x3 is the same as the sign of x, it follows thatf(x, x)− f(0, 0) > 0, when x > 0, and f(x, x)− f(0, 0) < 0, whenx < 0. Thus (0, 0) is a saddle point.

The nature of the other stationary points of f can be determinedusing the Hessian. This is left as an exercise.

Example 9 Find the stationary points of z = (x2 + y2)e−x2−y2,

and determine their nature.

The partial derivatives of z are

∂z

∂x= 2xe−x2−y2

+ (x2 + y2)(−2x)e−x2−y2

= 2xe−x2−y2

(1− x2 − y2),

∂z

∂y= 2ye−x2−y2

(1− x2 − y2).

(Since z is symmetrical in x and y.)

Putting∂z

∂x=

∂z

∂y= 0, and using the fact that e−x2−y2 6= 0 gives

x(1− x2 − y2) = 0, (7)

y(1− x2 − y2) = 0. (8)

Page 9: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 9

From equation (7) either x = 0 or x2 + y2 = 1. If x = 0 thenequation (8) gives y(1−y2) = 0, and so y = 0,−1 or 1. Thus (0, 0),(0, 1) and (0,−1) are all stationary points of z. If x2 + y2 = 1 thenequation (8) always holds. Thus every point on the circle x2+y2 = 1is stationary points of z.

From equation (8) either y = 0 or x2 + y2 = 1. The second possi-bility has already been covered above; if y = 0 then equation (7)gives x(1 − x2) = 0, and so x = 0,−1 or 1. Thus (0, 0), (1, 0) and(−1, 0) are all stationary points of z.

Note that all of the points (0, 1), (0,−1), (1, 0) and (−1, 0) lie onthe circle x2 + y2 = 1. Thus the stationary points of z are (0, 0)and every point on the circle x2 + y2 = 1.

Finding the second derivatives of z we get:

∂2z

∂x2= (2e−x2−y2

+ 2x(−2x)e−x2−y2

)(1− x2 − y2) + 2xe−x2−y2

(−2x),

= 2e−x2−y2 ((1− 2x2)(1− x2 − y2)− 2x2

),

= 2e−x2−y2 (1− x2 − y2 − 2x2 + 2x4 + 2x2y2 − 2x2

),

= 2e−x2−y2 (1− 5x2 − y2 + 2x4 + 2x2y2

),

= 2e−x2−y2 (1− 5x2 − y2 + 2x4 + 2x2y2

),

= 2e−x2−y2 (1− 4x2 − (x2 + y2) + 2x2(x2 + y2)

),

∂2z

∂x∂y= (−2y)2xe−x2−y2

(1− x2 − y2) + 2xe−x2−y2

(−2y),

= −4xye−x2−y2

(2− x2 − y2),

∂2z

∂y2= 2e−x2−y2 (

1− 4y2 − (x2 + y2) + 2y2(x2 + y2)),

(Since z is symmetrical in x and y.)

If x2 + y2 = 1 then

∂2z

∂x2= 2e−x2−y2 (

1− 4x2 − (x2 + y2) + 2x2(x2 + y2)),

= 2e−1(1− 4x2 − 1 + 2x2

),

= −4x2e−1,

∂2z

∂x∂y= −4xye−x2−y2

(2− x2 − y2),

= −4xye−1,

∂2z

∂y2= 2e−x2−y2 (

1− 4y2 − (x2 + y2) + 2y2(x2 + y2)),

= 2e−1(1− 4y2 − 1 + 2y2

),

= −4y2e−1.

Page 10: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 10

Thus, in this case,

∆ =∂2z

∂x2

∂2z

∂y2−

(∂2z

∂x∂y

)2

,

=(−4x2e−1

) (−4y2e−1)− (−4xye−1

)2,

= 16x2y2e−2 − 16x2y2e−2 = 0.

Thus the Hessian gives us no information about the nature of thestationary points on the circle x2+y2 = 1. To determine the natureof these stationary points, we consider the behaviour of z on thelines y = ax, where a ∈ R. On such a line

z(x, y) = z(x, ax),

= (x2 + a2x2)e−x2−a2x2

,

= (a2 + 1)x2e−(a2+1)x2

.

Let g(x) = (a2+1)x2e−(a2+1)x2. We make the following observations

about g.

• Since g can be expressed as a function of x2 it is symmetricalabout x = 0. That is, g(x) = g(−x).

• Since a2 + 1 > 0, x2 ≥ 0 and e−(a2+1)x2> 0, g(x) ≥ 0 for all

x ∈ R. Furthermore, g(x) = 0 if and only if x = 0.

• As x → ±∞, g(x) → 0.

From these observations we can deduce that g(x) takes its minimumvalue at x = 0. The value of g(x) then increases as we move awayfrom x = 0 until g reaches a maximum; the value then decreasesand approaches 0 as x approaches ±∞. The following diagramshows g for a typical value of a.

From this we can see that every point on the circle x2 + y2 = 1 isa local maximum of z. We also get that (0, 0) is a local minimum.

Page 11: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 11

The following diagram illustrates the graph of f that clearly showsthe local maxima on the circle x2 + y2 = 1.

-2

-2-1

-1y

x

000

0.05

1

0.1

1

0.15

2

0.2

0.25

2

0.3

0.35

Genralization to functions of several variables

We can generalize the idea of a stationary point to a functionof several variables. Let U ⊆ Rn, and let f : U → R. Then(a1, a2, . . . , an) ∈ U is a stationary point of f if

fx1(a1, a2, . . . , an) = fx2(a1, a2, . . . , an) = · · · = fxn(a1, a2, . . . , an) = 0.

It is also possible to classify the stationary points, but this is beyondthe scope of the course.

Example 10 Find the stationary points of

f(x, y, z) = (x + y + z)2 − 6xyz.

The partial derivatives of f are

fx(x, y, z) = 2(x + y + z)− 6yz,

fy(x, y, z) = 2(x + y + z)− 6xz,

fz(x, y, z) = 2(x + y + z)− 6xy.

Putting fx(x, y, z) = fy(x, y, z) = fz(x, y, z) gives

x + y + z = 3yz, (9)

x + y + z = 3xz, (10)

x + y + z = 3xy. (11)

Combining equations (9) and 10) gives

3yz = 3xz.

Page 12: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 12

Thus either z = 0 or x = y.

If z = 0 then equations (9)–(11) reduce to x+y = 0 and x+y = 3xy.From this we get x = y = 0, and so (0, 0, 0) is a stationary pointof f .

If x = y then equations (9)–(11) reduce to 2x + z = 3xz and2x + z = 3x2. From this we get xz = x2 , and so either x = 0 orx = z. If x = 0 we get x = y = z = 0, giving the stationary pointfound earlier. If x = z and x 6= 0 then 2x+z = 3xz and 2x+z = 3x2

reduce to x = x2, and so x = 1. This gives x = y = z = 1, and so(1, 1, 1) is a stationary point of f .

Thus the stationary points of f are (0, 0, 0) and (1, 1, 1).

Exercises 3.1

1. Let f(x, y) = 3x3y2 − 5xy3 + 3x2y4 − y5. Find ∂2f∂x∂y

.

2. Determine all of the values of n such that z = 2xy + xny2n

satisfies

2x2 ∂2z

∂x2− y2 ∂2z

∂y2+ 18z = 36xy.

3. Find, and classify, the stationary points of

g(x, y) =1

2x2y − 2xy +

2

3y3.

4. Determine the nature of the non-zero stationary points of thefunction f given in Example 8.

5. Find the stationary points of

f(x, y, z) = x3 − 3x + y3 − 3yz + 2z2.

3.2 Lagrange multipliers

Let U ⊆ R2 and let f, g : U → R. We now consider the problemof finding the maximum and minimum values of f subject to theconstraint g(x, y) = 0.

Method 1 Suppose we can rewrite g(x, y) = 0 in the form y =h(x), for some function h. Then we can just find the maximum andminimum values of F (x) = f(x, h(x)) using the method for calculusof functions of one variable.

Page 13: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 13

Example 11 Find the maximum and minimum values of

f(x, y) = x3 + 3xy2 + 2xy,

subject to the constraint x + y = 4.

Here g(x, y) = x + y − 4, and g(x, y) = 0 gives y = 4 − x. (Soh(x) = 4− x.) Thus

F (x) = f(x, 4− x),

= x3 + 3x(4− x)2 + 2x(4− x),

= x3 + 3x(16− 8x + x2) + 8x− 2x2,

= 4x3 − 26x2 + 56x.

Differentiating F with respect to x we get F ′(x) = 12x2−52x+56,and so

F ′(x) = 0 ⇔ 12x2 − 52x + 56 = 0,

⇔ 3x2 − 13x + 14 = 0,

⇔ (3x− 7)(x− 2) = 0,

⇔ x = 2, 73.

For x = 2, y = 2 and F (2) = 40, and for x = 73, y = 5

3and

F (73) = 3925

27. Thus the maximum and minimum values of f(x, y) =

x3 + 3xy2 + 2xy, subject to the constraint x + y = 4, are 40 and3925

27, respectively.

Method 2 The local maximum and minimum of f(x, y) subjectto the constraint g(x, y) = 0 correspond to the stationary points of

L(x, y, λ) = f(x, y)− λg(x, y).

The variable λ is call a Lagrange multiplier.

Example 12 Consider the problem from Example 11. Heref(x, y) = x3 + 3xy2 + 2xy and g(x, y) = x + y − 4. So we let

L(x, y, λ) = x3 + 3xy2 + 2xy − λ(x + y − 4).

Now

∂L

∂x= 3x2 + 3y2 + 2y − λ,

∂L

∂y= 6xy + 2x− λ,

∂L

∂λ= −(x + y − 4).

Page 14: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 14

Putting ∂L∂x

= ∂L∂y

= ∂L∂λ

= 0 gives

3x2 + 3y2 + 2y = λ, (12)

6xy + 2x = λ, (13)

x + y − 4 = 0. (14)

From equations (12) and (13) we get

3x2 + 3y2 + 2y = 6xy + 2x.

We can now use equation (14) to eliminate y form the previousequation. After simplification this gives

12x2 − 52x + 56 = 0

The solutions can now be found as in Example 11.

Note that in Example 12 we did not need to find λ in order to findthe solution to the problem.

Lagrange multipliers are particularly useful when it is difficult (orjust algebraically messy!) to rewrite g(x, y) = 0 in the formy = h(x).

Example 13 Find the maximum and minimum values off(x, y) = xy3 on the circle x2 + y2 = a2, where a is a positive realnumber.

Let g(x, y) = x2 +y2−a2. Then we want to find the maximum andminimum values of f(x, y) subject to the constraint g(x, y) = 0.Let

L(x, y, λ) = xy3 − λ(x2 + y2 − a2).

Then

∂L

∂x= y3 − 2λx,

∂L

∂y= 3xy2 − 2λy,

∂L

∂λ= −x2 − y2 + a2.

Putting ∂L∂x

= ∂L∂y

= ∂L∂λ

= 0 gives

y3 − 2λx = 0, (15)

3xy2 − 2λy = 0, (16)

x2 + y2 = a2. (17)

Page 15: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 15

Multiplying equation (15) by y, and equation (16) by x gives

y4 − 2λxy = 0, (18)

3x2y2 − 2λxy = 0, (19)

and so subtracting equation (19) from equation (18) we get

y4 − 3x2y2 = 0.

Thusy2(y2 − 3x2) = 0,

and so either y = 0 or y2 = 3x2.

If y = 0 then equation (17) gives x2 = a2, and so x = ±a.

If y2 = 3x2 then equation (17) gives 4x2 = a2. Thus x = ±a2, and

for each value of x, y = ±√

3a2

.

From the preceding calculations, the stationary points of L have

(x, y) = (a, 0), (−a, 0),(

a2,√

3a2

),(

a2,−

√3a2

),(−a

2,√

3a2

)or

(−a

2,−

√3a2

).

Now f(a, 0) = f(−a, 0) = 0, f(

a2,√

3a2

)= f

(−a

2,−

√3a2

)= 3

16

√3a4,

and f(

a2,−

√3a2

)= f

(−a

2,√

3a2

)= − 3

16

√3a4.

Thus the maximum and minimum values of f(x, y) = xy3 on thecircle x2 + y2 = a2 are 3

16

√3a4 and − 3

16

√3a4, respectively.

Example 14 Find the point on the line 3x+2y = 5 that is closestto the point (3, 1).

The distance between a general point (x, y) and the point (3, 1) is

√(x− 3)2 + (y − 1)2.

We want to find the minimum value of this distance subject to theconstraint 3x+2y−5 = 0. In fact, it is easier to minimize the squareof the distance, and so we minimize f(x, y) = (x − 3)2 + (y − 1)2,subject to the given constraint.

Let L(x, y, λ) = (x− 3)2 + (y − 1)2 − λ(3x + 2y − 5). Then

∂L

∂x= 2(x− 3)− 3λ,

∂L

∂y= 2(y − 1)− 2λ,

∂L

∂λ= −3x− 2y + 5.

Page 16: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 16

Putting ∂L∂x

= ∂L∂y

= ∂L∂λ

= 0 gives

2(x− 3)− 3λ = 0, (20)

2(y − 1)− 2λ = 0, (21)

3x + 2y = 5. (22)

Multiplying equation (20) by 2, and equation (21) by 3 gives

4(x− 3)− 6λ = 0,

6(y − 1)− 6λ = 0.

Thus 4(x − 3) = 6(y − 1). Multiplying out the brackets in thisequation, and simplifying the result gives

2x− 3y = 3. (23)

Multiplying equation (22) by 3, and equation (23) by 2 gives

9x + 6y = 15,

4x− 6y = 6.

Adding the last two equations together we get 13x = 21, and sox = 21

13. Using equation (23) with x = 21

13we get y = 1

13. Thus the

point (2113

, 113

) on the line on the line 3x + 2y = 5 is closest to thepoint (3, 1).

Although not required, the distance of the point (2113

, 113

) to the point(3, 1) is

√f

(21

13,

1

13

)=

√(21

13− 3

)2

+

(1

13− 1

)2

,

=

√324

169+

144

169

=

√468

169,

=

√36

13=

6√13

.

Lagrange multipliers with more than one constraint

Let U ⊆ Rn, and let f, g1, g2, . . . , gm : U → R. To find the maxi-mum and minimum values of f(x1, x2, . . . , xn), subject to the con-straints

g1(x1, x2, . . . , xn) = 0,

g2(x1, x2, . . . , xn) = 0,...

gm(x1, x2, . . . , xn) = 0,

Page 17: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 17

we find the stationary points of

L(x1, x2, . . . , xn, λ1, λ2, . . . , λm) = f(x1, x2, . . . , xn)− λ1g1(x1, x2, . . . , xn)

−λ2g2(x1, x2, . . . , xn)− · · · − λmgm(x1, x2, . . . , xn).

The introduced variables λ1, λ2, . . . , λm are called Lagrange mul-tipliers.

Example 15 Find the maximum and minimum values of x + zat the points where the plane 4x + y + z = 34 and the cylinderx2 + y2 = 40 intersect.

Here we want to find the maximum and minimum values off(x, y, z) = x + z, subject to the constraints g1(x, y, z) = 0 andg2(x, y, z) = 0, where g1(x, y, z) = 4x + y + z − 34 andg2(x, y, z) = x2 + y2 − 40. Let

L(x, y, z, λ, µ) = x + z − λ(4x + y + z − 34)− µ(x2 + y2 − 40).

Then

∂L

∂x= 1− 4λ− 2µx,

∂L

∂y= −λ− 2µy,

∂L

∂z= 1− λ,

∂L

∂λ= −(4x + y + z − 34),

∂L

∂µ= −(x2 + y2 − 40).

Putting ∂L∂x

= ∂L∂y

= ∂L∂z

= ∂L∂λ

= ∂L∂µ

= 0 gives

4λ + 2µx = 1, (24)

λ + 2µy = 0, (25)

λ = 1, (26)

4x + y + z = 34, (27)

x2 + y2 = 40. (28)

From equation (26), λ = 1. Substituting this value of λ into equa-tions (24) and (25) gives 2µx = −3 and 2µy = −1, respectively.Multiplying the second of these equations by 3 gives 6µy = −3, andso

2µx = −3 = 6µy.

Now µ 6= 0 (otherwise equation (25) gives λ = 0, contrary to λ = 1)and so x = 3y. Substituting x = 3y into equation (28) gives 10y2 = 40.

Page 18: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 18

Thus y2 = 4, and so y = ±2. When y = 2, x = 6, and when y = −2,x = −6. From equation (27),

z = 34− 4x− y.

Thus when y = 2 and x = 6, z = 8, and when y = −2 and x = −6,z = 60. Now f(6, 2, 8) = 14 and f(−6,−2, 60) = 54. Thus themaximum and minimum values of x + z at the points where theplane 4x + y + z = 34 and the cylinder x2 + y2 = 40 intersect are54 and 14, respectively.

Example 16 Find the maximum and minimum values off(x, y, z) = xy + 4z subject to the constraints x + y + z = 0 andx2 + y2 + z2 = 24.

Let

L(x, y, z, λ, µ) = xy + 4z − λ(x + y + z)− µ(x2 + y2 + z2 − 24).

Then

∂L

∂x= y − λ− 2µx,

∂L

∂y= x− λ− 2µy,

∂L

∂z= 4− λ− 2µz,

∂L

∂λ= −(x + y + z),

∂L

∂µ= −(x2 + y2 + z2 − 24).

Putting ∂L∂x

= ∂L∂y

= ∂L∂z

= ∂L∂λ

= ∂L∂µ

= 0 gives

y − 2µx = λ, (29)

x− 2µy = λ, (30)

4− 2µz = λ, (31)

x + y + z = 0, (32)

x2 + y2 + z2 = 24. (33)

From equations (29) and (30) we get

y − 2µx = λ = x− 2µy.

Thusy − x = 2µ(x− y),

and so either x = y or µ = −12. We now consider these two possi-

bilities separately.

Page 19: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 19

If x = y then equation (32) gives 2x + z = 0, and so z = −2x.Then equation (33) gives x2 + x2 + 4x2 = 24, and so x2 = 4. Hencex = ±2, and so

x = ±2, y = ±2, z = ∓4.

If µ = −12

then equations (29) and (31) give x+y = λ and z+4 = λ,respectively. Thus

x + y = λ = z + 4,

and so

x + y − z = 4. (34)

Subtracting equation (34) from equation (32) gives 2z = −4, andso z = −2. Adding equations (34) and (32) gives 2(x + y) = 4, andso y = 2− x. Putting y = 2− x and z = −2 into equation (33) weget

x2 + (2− x)2 + (−2)2 = 24 ⇔ x2 + (4− 4x + x2) + 4 = 24,

⇔ x2 − 2x− 8 = 0,

⇔ (x− 4)(x + 2) = 0,

⇔ x = −2, 4.

When x = −2, y = 4 and z = −2, and when x = 4, y = −2 andz = −2.

From the preceding calculations we have found four stationarypoints of L, namely (2, 2,−4), (−2,−2, 4), (−2, 4,−2) and (4,−2,−2).Now f(2, 2,−4) = −12, f(−2,−2, 4) = 20, f(−2, 4,−2) = −16 andf(4,−2,−2) = −16. Thus the maximum and minimum values off(x, y, z), subject to the given constraints, are 20 and −16, respec-tively.

Exercises 3.2

1. Find the maximum and minimum values of f(x, y) = xy onthe ellipse 18x2 + 2y2 = 25.

2. Find the maximum and minimum values of 2x + y on theellipse x2 + xy + 4y2 + 2x + 16y + 7 = 0.

3. Find the maximum and minimum values of xy2 on the circlex2 + y2 = 1.

4. Find the minimum distance from the origin to a point on thecurve where the plane 2y + 4z = 15 and the surfacez2 = 4(x2 + y2) intersect.

Page 20: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 20

3.3 The chain rule

In this section we generalize the chain rule for functions of onevariable to functions of more than one variable. First we extendour idea of a real function.

Multivariable functions

Let U ⊆ Rn. A (multivariable) function f : U → Rm deter-mines for each point x = (x1, x2, . . . , xn) of U a unique pointy = (y1, y2, . . . , ym) of Rm. We write f(x1, x2, . . . , xn) = (y1, y2, . . . , ym)or f(x) = y.

Each coordinate of y is uniquely determined by (x1, x2, . . . , xn).That is, each coordinate of y can be thought of as a function of(x1, x2, . . . , xn). So there are functions f1, f2, . . . , fm : U → Rm

such that

f(x1, x2, . . . , xn) = (f1(x1, x2, . . . , xn), f2(x1, x2, . . . , xn), . . . , fm(x1, x2, . . . , xn)),

or f(x) = (f1(x), f2(x), . . . , fm(x)).

Example 17 Let f : R2 → R2, with f(x, y) = (x2y, x + 3y). Heref1(x, y) = x2y and f2(x, y) = x+3y. An alternative way of definingf is to write f(x, y) = (f1, f2) where f1(x, y) = x2y andf2(x, y) = x + 3y.

Example 18 Let f : R → R3, with f(t) = (t, cos t, sin t). Func-tions of one variable from R to Rm, like this one (that has m = 3),define a parametric curve in Rm. If we plot the function f as tvaries we obtain a spiral going round the x-axis, as illustrated inthe following diagram.

Example 19 Let f : R3 → R2, with f(x, y, z) = (u, v), whereu = x + y − z and v = 2x− y − 2z.

Let U ⊆ Rn, and let f : U → Rm with f(x) = f1(x), f2(x), . . . , fm(x)).

Then the derivative of f at x, denoted by f ′(x) ordf

dx, is the m×n

matrix whose (i, j)th entry is∂fi

∂xj

. That is,

f ′(x) =

∂f1

∂x1

∂f1

∂x2· · · ∂f1

∂xn

∂f2

∂x1

∂f2

∂x2· · · ∂f2

∂xn...

......

∂fm

∂x1

∂fm

∂x2· · · ∂fm

∂xn

.

Page 21: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 21

Example 20 Let f : R2 → R2, with f(x, y) = (x2y, x + 3y). Heref1(x, y) = x2y and f2(x, y) = x + 3y, and

f ′(x, y) =

(∂f1

∂x∂f1

∂y

∂f2

∂x∂f2

∂y

)=

(2xy x2

1 3

).

Example 21 Let f : R→ R3, with f(t) = (t, cos t, sin t). Then

f ′(t) =

ddt

(t)ddt

(cos t)ddt

(sin t)

=

1− sin tcos t

.

Example 22 Let f : R3 → R2, with f(x, y) = (u, v), where u =x + y − z and v = 2x− y − 2z. Then

f ′(x, y, z) =

(∂u∂x

∂u∂y

∂u∂z

∂v∂x

∂v∂y

∂v∂z

)=

(1 1 −12 −1 −2

).

Simple cases of the chain rule

In this section we consider three simple cases of the chain rule, andillustrate them with an example.

Case 1 For U ⊆ R2 and V ⊆ R, let g : U → R and f : V → Rand let F : U → R with

F (x, y) = (f ◦ g)(x, y) = f(g(x, y)).

Then

∂F

∂x=

df

dg

∂g

∂x,

∂F

∂y=

df

dg

∂g

∂y.

Example 23 Let F (x, y) = (x2 +3xy− y2)4. Then F (x, y) = f(g)where g = x2 + 3xy − y2 and f = g4. Thus

∂F

∂x=

df

dg

∂g

∂x,

= 4g3(2x + 3y),

= 4(x2 + 3xy − y2)3(2x + 3y).

∂F

∂y=

df

dg

∂g

∂y,

= 4g3(3x− 2y),

= 4(x2 + 3xy − y2)3(3x− 2y).

Page 22: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 22

Example 24 Let f : R→ R and let z = f(x2 + y2). Show that

y∂z

∂x= x

∂z

∂y.

Let g(x, y) = x2 + y2. Then z(x, y) = f(g(x, y)). Thus

∂z

∂x=

df

dg

∂g

∂x,

= 2xdf

dg.

∂z

∂y=

df

dg

∂g

∂y,

= 2ydf

dg.

Hence

y∂z

∂x= 2xy

df

dg= x

∂z

∂y.

Case 2 For U ⊆ R and V ⊆ R2, let g : U → R2, with g(t) =(u(t), v(t)), and f : V → R and let F : U → R with

F (t) = (f ◦ g)(t) = f(g(t)).

ThendF

dt=

∂f

∂u

du

dt+

∂f

∂v

dv

dt.

Example 25 Let F (t) = u2 + v2, where u = t cos t and v = sin t.Then F (t) = f(g(t)) where g(t) = (u(t), v(t)) and f(u, v) = u2+v2.Thus

dF

dt=

∂f

∂u

du

dt+

∂f

∂v

dv

dt,

= 2u(cos t− t sin t) + 2v cos t,

= 2t cos t(cos t− t sin t) + 2 sin t cos t,

= 2 cos t(t cos t− t2 sin t + sin t).

Case 3 For U ⊆ R2 and V ⊆ R2, let g : U → R2, with g(x, y) =(u(x, y), v(x, y)), and f : V → R, and let F : U → R with

F (x, y) = (f ◦ g)(x, y) = f(g(x, y)).

Then

∂F

∂x=

∂f

du

∂u

∂x+

∂f

dv

∂v

∂x,

∂F

∂y=

∂f

∂u

∂u

∂y+

∂f

dv

∂v

∂y.

Page 23: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 23

Example 26 Let u = x2y and v = xy3 and let F (x, y) = 2u + v2.Then F (x, y) = f(g(x, y)) where f(u, v) = 2u + v2 and g(x, y) =(u, v) = (x2y, xy3). Thus

∂F

∂x=

∂f

du

∂u

∂x+

∂f

dv

∂v

∂x,

= 2(2xy) + 2vy3,

= 4xy + 2xy6,

= 2xy(2 + y5).

∂F

∂y=

∂f

du

∂u

∂y+

∂f

dv

∂v

∂y,

= 2x2 + 2v(3xy2),

= 2x2 + 6x2y5,

= 2x2(1 + 3y5).

Two general cases of the chain rule

Here we consider two general cases of the chain rule.

General case 1 Suppose u1, u2, . . . , un are functions of a singlevariable t, and g is a function of n variables. LetG(t) = g(u1, u2, . . . , un). Then G is a function of t and

dG

dt=

∂g

∂u1

du1

dt+

∂G

∂u2

du2

dt+ · · ·+ ∂g

∂un

dun

dt.

Example 27 Let u = t2, v =√

t and w = 1t, and let

G(t) = g(u, v, w) = uvw

. Then

dG

dt=

∂g

∂u

du

dt+

∂g

∂v

dv

dt+

∂g

∂w

dw

dt,

=( v

w

)(2t) +

( u

w

)(1

2t−

12 ) +

(−uv

w2

) (− 1

t2

),

= 2t2√

t +1

2t

52 + t2

√t,

=7

2t

52 .

Note that in Example 27, G(t) = uvw

= t2√

t1t

= t3√

t = t72 , and so

dGdt

= 72t

52 . Thus, in this example, it is easier to find G as a function

of t and then differentiate it with respect to t, rather than use thechain rule.

Page 24: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 24

General case 2 Suppose u1, u2, . . . , un are functions of m vari-ables x1, x2, . . . , xn, and h is a function of n variables. LetH(x1, x2, . . . , xm) = h(u1, u2, . . . , un). Then H is a function ofx1, x2, . . . , xm and, for each i, with 1 ≤ i ≤ m,

∂H

∂xi

=∂h

∂u1

∂u1

∂xi

+∂h

∂u2

∂u2

∂xi

+ · · ·+ ∂h

∂un

∂un

∂xi

Example 28 Let h = uv + uw + vw, where u = y2, v = x2 + 2xyand w = x2 − 2xy. Then, using the chain rule, we get

∂h

∂x=

∂h

∂u

∂u

∂x+

∂h

∂v

∂v

∂x+

∂h

∂w

∂w

∂x,

= (v + w)(0) + (u + w)(2x + 2y) + (u + v)(2x− 2y),

= 2(x2 − 2xy + y2)(x + y) + 2(x2 + 2xy + y2)(x− y),

= 2(x− y)2(x + y) + 2(x + y)2(x− y),

= 2(x− y)(x + y)(x− y + x + y),

= 4x(x− y)(x + y).

Similarly,

∂h

∂y=

∂h

∂u

∂u

∂y+

∂h

∂v

∂v

∂y+

∂h

∂w

∂w

∂y,

= (v + w)(2y) + (u + w)(2x) + (u + v)(−2x),

= (2x2)(2y) + (x2 − 2xy + y2)(2x) + (x2 + 2xy + y2)(−2x),

= 4x2y + 2x(x− y)2 − 2x(x + y)2,

= 4x2y + 2x((x− y)2 − (x + y)2

),

= 4x2y + 2x ((2x)(−2y)) ,

= 4x2y − 8x2y,

= −4x2y.

Here we have used the identity:A2 −B2 = (A + B)(A−B).

Example 29 Let f be a function of two variables x and y, withx = r cos θ and y = r sin θ. Find ∂f

∂xand ∂f

∂yin terms of r, θ, ∂f

∂rand

∂f∂θ

.

Using the chain rule gives

∂f

∂r=

∂f

∂x

∂x

∂r+

∂f

∂y

∂y

∂r= cos θ

∂f

∂x+ sin θ

∂f

∂y.

Similarly,

∂f

∂θ=

∂f

∂x

∂x

∂θ+

∂f

∂y

∂y

∂θ= −r sin θ

∂f

∂x+ r cos θ

∂f

∂y.

Thus

∂f

∂r= cos θ

∂f

∂x+ sin θ

∂f

∂y, (35)

∂f

∂θ= −r sin θ

∂f

∂x+ r cos θ

∂f

∂y. (36)

Page 25: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 25

Multiplying equation (35) by r cos θ and equation (36) by sin θ gives

r cos θ∂f

∂r= r cos2 θ

∂f

∂x+ r cos θ sin θ

∂f

∂y, (37)

sin θ∂f

∂θ= −r sin2 θ

∂f

∂x+ r cos θ sin θ

∂f

∂y. (38)

Subtracting equation (38) from equation (37) gives

r cos θ∂f

∂r− sin θ

∂f

∂θ= r(cos2 θ + sin2 θ)

∂f

∂x.

Now, since cos2 θ + sin2 θ = 1, we get

∂f

∂x= cos θ

∂f

∂r− sin θ

r

∂f

∂θ.

Using a similar method, or by substituting for ∂f∂x

in either equa-tion (35) or equation (36), we get

∂f

∂y= sin θ

∂f

∂r+

cos θ

r

∂f

∂θ.

Example 30 (Euler’s Theorem on homogeneous functions.)

A function f : R2 → R is homogeneous of degree n if, for allx, y, λ ∈ R,

f(λx, λy) = λnf(x, y).

For example, f(x, y) = xy is homogeneous of degree 2 since

f(λx, λy) = (λx)(λy) = λ2xy = λ2f(x, y).

Suppose that g : R2 → R is homogeneous of degree n. For x, y ∈ R,let G : R→ R where

G(λ) = g(λx, λy) = g(u, v),

u = λx and v = λy.

By the chain rule

dG

dλ=

∂g

∂u

du

dλ+

∂g

∂v

dv

dλ,

= x∂g

∂u+ y

∂g

∂v.

However, since g is homogeneous of degree n, G(λ) = λng(x, y).Thus

dG

dλ= nλn−1g(x, y).

Comparing the two expressions for dGdλ

gives

nλn−1g(x, y) = x∂g

∂u+ y

∂g

∂v. (39)

Page 26: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 26

Equation (39) is true for all λ. If we put λ = 1 then u = x, v = y,and equation (39) gives

ng(x, y) = x∂g

∂x+ y

∂g

∂y.

This result is known as Euler’s Theorem on homogeneous functions.

Exercises 3.3

1. Let g(x, y) = x2 + 2xy − y2, x = 3t − 1 and y = t2. Use the

chain rule to finddg

dt.

2. Let f : R→ R, and let z = f(xy).

(a) Show that x∂z

∂x− y

∂z

∂y= 0.

(b) Verify the result in part (a) for the particular case whenf(t) = 2t3 − t2 + 3t.

3. Let F be a function of u and v, where u = x2+y2 and v = xy.

Find∂F

∂uand

∂F

∂vin terms of x, y,

∂F

∂xand

∂F

∂y.

4. Let g(x, y) =3xy3 − 2x2y2

4x + 5y.

(a) Show that g is homogeneous of degree 3.

(b) Verify Euler’s Theorem on homogeneous functions byevaluating x ∂g

∂x+ y ∂g

∂ydirectly.

3.4 Taylor series

Let U ⊆ R, and let f : U → R such that the derivative, and all thehigher derivatives, of f exist on U . For h ∈ U ,

f(x) = f(h)+(x−h)f ′(h)+(x− h)2

2!f ′′(h)+· · ·+(x− h)n

n!f (n)(h)+· · · .

This is the Taylor series of f centred at h. If the series is trun-cated after n + 1 terms we get the Taylor polynomial or Taylorapproximation of f , of degree n, centred at h.

If we replace x with x + h throughout in the Taylor series of f , weget the following alternative way of expressing the Taylor series off centred at h:

f(x + h) = f(h) + xf ′(h) +x2

2!f ′′(h) + · · ·+ xn

n!f (n)(h) + · · · .

Page 27: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 27

The following are the Taylor series of some standard functions. Thefirst three are centred at 0, and are valid for all x ∈ R; the othertwo are centred at 1, and are valid for x ∈ R with |x| < 1.

ex = 1 + x +x2

2!+

x3

3!+ · · ·+ xn

n!+ . . . ,

sin x = x− x3

3!+

x5

5!− x7

7!+ · · ·+ (−1)n x2n+1

(2n + 1)!+ . . . ,

cos x = 1− x2

2!+

x4

4!− x6

6!· · ·+ (−1)n x2n

(2n)!+ . . . ,

ln(x + 1) = x− x2

2+

x3

3− x4

4+ · · ·+ (−1)n+1xn

n+ · · · ,

(1 + x)α = 1 + αx +α(α− 1)x2

2!+

α(α− 1)(α− 2)x3

3!+ · · ·

· · ·+ α(α− 1) . . . (α− n + 1)xn

n!+ · · · .

Now let U ⊆ R2, and let f : U → R such that the partial deriva-tives, and all the higher partial derivatives, of f exist and are con-tinuous on U . For (X,Y ) ∈ U ,

f(X + h, Y + k) = f(X, Y ) + (hfx(X, Y ) + kfy(X,Y )) +

+1

2!

(h2fxx(X, Y ) + 2hkfxy(X, Y ) + k2fyy(X, Y )

)+

+1

3!

(h3fxxx(X, Y ) + 3h2kfxxy(X,Y ) + 3hk2fxyy(X,Y )+

k3fyyy(X,Y ))

+ · · ·

· · ·+ 1

n!

n∑i=0

(n

i

)hn−ikif (n−i,i)(X, Y ) + · · · ,

where

(n

i

)=

n!

i!(n− i)!, and f (r,s) denotes the (r + s)th partial The notation f (r,s) is my own

creation and maybenon-standard. I have not foundany standard notation in anybooks!

derivative of f found by differentiating r times with respect to xand s times with respect to y.

This is the Taylor series of f centred at (X,Y ). If the seriesis truncated after n + 1 terms we get the Taylor polynomial orTaylor approximation of f , of degree n, centred at (X, Y ).

Example 31 Expand x2y + 3y − 2 in powers of x− 1 and y + 2.

Let f(x, y) = x2y + 3y − 2. Putting x = 1 + h and y = −2 + k wecan obtain the required expansion by finding the Taylor series of f

Page 28: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 28

centred at (1,−2). Now

fx(x, y) = 2xy,

fy(x, y) = x2 + 3,

fxx(x, y) = 2y,

fxy(x, y) = 2x,

fyy(x, y) = 0,

fxxx(x, y) = 0,

fxxy(x, y) = 2,

fxyy(x, y) = 0,

fyyy(x, y) = 0,

and all higher derivatives are 0. Thus

f(x, y) = f(1 + h,−2 + k),

= f(1,−2) + hfx(1,−2) + kfy(1,−2)

+1

2!

(h2fxx(1,−2) + 2hkfxy(1,−2) + k2fyy(1,−2)

)

+1

3!

(3h2kfxxy(1− 2)

),

= −10− 4h + 4k +1

2

(−4h2 + 4hk + 0k2)

+1

6(6h2k),

= −10− 4h + 4k − 2h2 + 2hk + h2k,

= −10− 4(x− 1) + 4(y + 2)− 2(x− 1)2 + 2(x− 1)(y + 2) + (x− 1)2(y + 2),

since h = x− 1 and k = y + 2.

Example 32 Find the Taylor approximation of degree 1 for

f(x, y) =12

x2 + xy + y2

centred at (2,2). Use your answer to estimate f(2.1, 1.8).

The partial derivatives of f are

fx(x, y) = − 12(2x + y)

(x2 + xy + y2)2,

fy(x, y) = − 12(x + 2y)

(x2 + xy + y2)2.

Now, f(2, 2) = 1, fx(2, 2) = −12

and fy(2, 2) = −12. Thus

f(2 + h, 2 + k) = f(2, 2) + hfx(2, 2) + kfy(2, 2),

= 1− 1

2h− 1

2k.

Page 29: Lecture 3

Calculus 2 Chapter 3 Applications of partial differentiation 29

Using this Taylor approximation for f with h = 0.1 and k = −0.2we get

f(2.1, 1.8) = f(2 + h, 2 + k),

≈ 1− 1

2× 0.1− 1

2× (−0.2),

= 1.05.

Note that f(2.1, 1.8) ≈ 1.04987, so the approximation given by theTaylor is quite good in this case.

Exercises 3.4 1. Find the Taylor polynomial of degree 2 of

g(x, y) =xy + 1

x + 2centred at the point (0, 0). Use your an-

swer to estimate g(0.1, 0.2).