Functions of Several Variables-Taylor's Formula, Maxima-Minima, Lagrange Multiplyer
Functions of Several Variables-Taylor's Formula, Maxima-Minima, Lagrange Multiplyer
October 1, 2024
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 1 / 52
Table of Contents
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 2 / 52
Taylor’s Formula for Two Variables
The first n derivative terms are evaluated at point (a, b). The last term is evaluated
at some point (a + θh, b + θk) on the line segment joining (a, b) and (a + h, b + k),
where 0 < θ < 1.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 3 / 52
If (a, b) = (0, 0) and we treat h and k as independent variables (denoting them
now by x and y ), then (1) assumes the following simpler form.
The first n derivative terms are evaluated at (0, 0). The last term is evaluated at a
point on the line segment joining the origin and (x, y ).
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 4 / 52
Remark
Taylor’s formula provides polynomial approximations of two-variable functions. The
first n derivative terms give the polynomial; the last term gives the approximation
error.
1
f (x, y ) = f (a, b) + (x − a)fx (a, b) + (y − b)fy (a, b) + (x − a)2 fxx (a, b)+
2!
2(x − a)(y − b)fxy (a, b) + (y − b)2 fyy (a, b) + · · · (2)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 5 / 52
Example
Find a quadratic approximation to f (x, y ) = sin x sin y near the origin. How accu-
rate is the approximation if |x| ≤ 0.1 and |y | ≤ 0.1?
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 6 / 52
solution
For n = 2, the Taylor’s formula is
1 2
f (x, y ) = f (0, 0) + xfx (0, 0) + yfy (0, 0) + x fxx (0, 0) + 2xyfxy (0, 0) + y 2 fyy (0, 0)
2!
1 3
+ x fxxx (θx, θy ) + 3x 2 yfxxy (θx, θy ) + 3xy 2 fxyy (θx, θy ) + y 3 fyyy (θx, θy )
3!
Calculating the values of the partial derivatives,
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 7 / 52
Solution cont. . .
1 3
E (x, y ) = x fxxx (θx, θy )+3x 2 yfxxy (θx, θy )+3xy 2 fxyy (θx, θy )+y 3 fyyy (θx, θy )
3!
The third derivatives of f (x, y ) never exceed 1 in absolute value because they are
products of sines and cosines. Also, |x| ≤ 0.1 and |y | ≤ 0.1. Hence
1 8
(0.1)3 + 3(0.1)3 + 3(0.1)3 + (0.1)3 = (0.1)3 = 0.00134
|E (x, y )| ≤
6 6
The error will not exceed 0.00134 if |x| ≤ 0.1 and |y | ≤ 0.1.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 8 / 52
Example
π
Find the Taylor’s formula for f (x, y ) = sin x 2 + y 2 + 4 about the origin to get
the quadratic approximation near the origin.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 9 / 52
solution
The Taylor’s quadratic formula of f (x, y ) at (0, 0) is given by
1 2
f (x, y ) ≈ f (0, 0) + xfx (0, 0) + yfy (0, 0) + x fxx (0, 0) + 2xyfxy (0, 0) + y 2 fyy (0, 0)
2!
Now,
π π 1
f (x, y ) = sin x 2 + y 2 + f (0, 0) = sin = √
4 4 2
2 2 π
fx (x, y ) = 2x cos x + y + fx (0, 0) = 0
4
π
fy (x, y ) = 2y cos x 2 + y 2 + fy (0, 0) = 0
4
2 2 π π √
π
fxx (x, y ) = 2 cos x + y + − 4x 2 sin x 2 + y 2 + fxx (0, 0) = 2 cos = 2
4 4 4
π π π √
fyy (x, y ) = 2 cos x 2 + y 2 + − 4y 2 sin x 2 + y 2 + fyy (0, 0) = 2 cos = 2
4 4 4
π
fxy = −4xy sin x 2 + y 2 + fxy (0, 0) = 0
4
Thus
1 1 √ √ 1
f (x, y ) ≈ √ + ( 2x 2 + 2y 2 ) = √ (1 + x 2 + y 2 )
2 2 2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 10 / 52
Example
Expand f (x, y ) = tan−1 yx in powers of (x − 1) and (y − 1) upto second degree.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 11 / 52
Solution
y
Here f (x, y ) = tan−1
, a = 1 and b = 1. Hence
x
y π
f (x, y ) = tan−1 f (1, 1) = tan−1 (1) =
x 4
−y −1
fx (x, y ) = 2 fx (1, 1) =
x + y2 2
x 1
fy (x, y ) = 2 fy (1, 1) =
x + y2 2
2xy 2 1
fxx (x, y ) = 2 2 2
fxx (1, 1) = =
(x + y ) 4 2
x2 − y2
fxy (x, y ) = 2 fxy (1, 1) = 0
(x + y 2 )2
2xy 2 1
fyy (x, y ) = − 2 2 2
fxx (1, 1) = − = −
(x + y ) 4 2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 12 / 52
Solution Cont. . .
y π 1 1
tan−1 = − (x − 1) − (y − 1) + (x − 1)2 − (y − 1)2 + · · ·
x 4 2 4
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 13 / 52
Practice Problems
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 14 / 52
Extreme Values and Saddle Points
2. f (a, b) is a local minimum value of f if f (a, b) ≤ f (x, y ) for all domain points
(x, y ) in an open disk centered at (a, b).
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 15 / 52
Figure 1: (a) Local Minima (b) Local Maxima
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 16 / 52
Theorem (First Derivative Test for Local Extreme Values)
If f (x, y ) has a local maximum or minimum value at an interior point (a, b) of
its domain and if the first partial derivatives exist there, then fx (a, b) = 0 and
fy (a, b) = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 17 / 52
Definition (Critical Points)
The point (a, b) is a critical point for the multi-variable function f (x, y ), if both
partial derivatives are 0 at the same time.
In other words,
∂
f (x, y ) =0
∂x
(a,b)
and
∂
f (x, y ) = 0.
∂y
(a,b)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 18 / 52
Definition (Saddle Point)
A critical point (a, b) is called saddle point of the function f (x, y ) if in every open
disk centered at (a, b) there are domain points (x, y ) when: f (x, y ) > f (a, b) and
domain points (x, y ) when: f (x, y ) < f (a, b).
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 20 / 52
Example
Find the critical points of the function
f (x, y ) = x 3 y 2 (1 − x − y ).
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 21 / 52
Solution
Given f (x, y ) = x 3 y 2 (1 − x − y ) = x 3 y 2 − x 4 y 2 − x 3 y 3 . Then
fx = 3x 2 y 2 − 4x 3 y 2 − 3x 2 y 3
and
fy = 2x 3 y − 2x 4 y − 3x 3 y 2 .
For critical points, we have
fx = 0 fy = 0
=⇒ 3x 2 y 2 − 4x 3 y 2 − 3x 2 y 3 = 0 =⇒ 2x 3 y − 2x 4 y − 3x 3 y 2 = 0
=⇒ x 2 y 2 (4x + 3y − 3) = 0 (3) =⇒ x 3 y (2x + 3y − 2) = 0 (4)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 22 / 52
Solution
Given f (x, y ) = x 3 y 2 (1 − x − y ) = x 3 y 2 − x 4 y 2 − x 3 y 3 . Then
fx = 3x 2 y 2 − 4x 3 y 2 − 3x 2 y 3
and
fy = 2x 3 y − 2x 4 y − 3x 3 y 2 .
For critical points, we have
fx = 0 fy = 0
=⇒ 3x 2 y 2 − 4x 3 y 2 − 3x 2 y 3 = 0 =⇒ 2x 3 y − 2x 4 y − 3x 3 y 2 = 0
=⇒ x 2 y 2 (4x + 3y − 3) = 0 (3) =⇒ x 3 y (2x + 3y − 2) = 0 (4)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 22 / 52
Example
Find the critical points of the function
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 23 / 52
Solution
Given f (x, y ) = 12x 2 + y 3 − 12xy . Then
fx = 24x − 12y
and
fy = 3y 2 − 12x.
For critical points, we have
fx = 0 fy = 0
=⇒ 24x − 12y = 0 =⇒ 3y 2 − 12x = 0
=⇒ 2x − y = 0 (5) =⇒ y 2 − 4x = 0 (6)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 24 / 52
Theorem (Second Derivative test for Local Extreme Values)
Suppose that f (x, y ) and its first and second partial derivatives are continuous
throughout a disk centered at (a, b) and that fx (a, b) = fy (a, b) = 0. Let r =
fxx (a, b), s = fxy (a, b) and t = fyy (a, b). Then
2
The expression rt − s 2 = fxx (a, b)fyy (a, b) − (fxy (a, b)) is called the discriminant
or Hessian of f (x, y ). It is sometimes easier to remember it in determinant form,
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 25 / 52
Example
Determine the critical points and locate any relative minima, maxima and saddle
points of function f defined by
f (x, y ) = 2x 2 + 2xy + 2y 2 − 6x
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 26 / 52
Solution
Given f (x, y ) = 2x 2 + 2xy + 2y 2 − 6x. Then
fx = 4x + 2y − 6, fy = 2x + 4y ,
fxx = 4, fxy = 2, fyy = 4.
For critical points, we solve the equations fx = 0 and fy = 0 simultaneously
fx = 0 =⇒ 4x + 2y = 6 (7)
fy = 0 =⇒ 2x + 4y = 0 (8)
Solving above two equations we get the critical point (2, −1). Now,
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 27 / 52
Example
Determine the critical points and locate any relative minima, maxima and saddle
points of function f defined by
f (x, y ) = 2x 2 − 4xy + y 4 + 2.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 28 / 52
Solution
Given f (x, y ) = 2x 2 − 4xy + y 4 + 2. Then
fx = 4x − 4y , fy = −4x + 4y 3
fx = 0 =⇒ 4x − 4y = 0 =⇒ x − y = 0. (9)
fy = 0 =⇒ −4x + 4y 3 = 0 =⇒ −x + y 3 = 0 (10)
Solving above equations, we get following critical points
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 29 / 52
For critical point (0, 0):
r = fxx (0, 0) = 4
s = fxy (0, 0) = −4
t = fyy (0, 0) = 0
r = fxx (1, 1) = 4
s = fxy (1, 1) = −4
t = fyy (1, 1) = 12
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 30 / 52
For critical point (−1, −1):
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 31 / 52
Practice Problems I
Determine the critical points and locate any relative minima, maxima and saddle
points for the following functions
1 f (x, y ) = −x 4 − y 4 + 4xy
2 f (x, y ) = x 2 + 3y 2 − 2xy − 8x
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 32 / 52
Practice Problems II
3 f (x, y ) = x 3 − 12x + y 3 + 3y 2 − 9y
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 33 / 52
The Method of Lagrange Multipliers
Assumptions made
The extreme values exist and ∇(g ) ̸= 0.
∇(f ) = λ∇(g )
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 34 / 52
Working Procedure
Find all the values of x, y , z, and λ that simultaneously satisfy the equations
fx
= λgx
∇(f ) = λ∇(g ) = fx iˆ + fy jˆ + fz k̂ = λ(fx iˆ + fy jˆ + fz k̂) = fy = λgy
fz = λgz
and
g (x, y , z) = k.
and then evaluating f at all the points, the values obtained are studied. The largest
of these values is the maximum value of f and the smallest of these values is
minimum value f .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 35 / 52
Example
Find the greatest and smallest values that the function
f (x, y ) = xy
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 36 / 52
Solution
x2 y2
Given f (x, y ) = xy and g (x, y ) = + − 1. Now
8 2
!
x
∇(f ) = λ∇(g ) =⇒ (y iˆ + x j)
ˆ =λ ˆ ˆ
i +y j
4
case-1 If y = 0 then x = λy gives x = 0 but point (0, 0) does not lies on the
x2 y2
ellipse + = 1. Hence y ̸= 0.
8 2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 37 / 52
case-2 If λ = ±2, then from Equation (11), we have x = ±2y . Substituting this
in the equation g (x, y ) = 0 gives
(±2y )2 y 2
+ = 1 =⇒ y 2 = 1 =⇒ y = ±1.
8 2
If y = 1, we have x = ±2 i.e. this gives following critical points
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 38 / 52
Example
Find the maximum and minimum of f (x, y ) = 5x − 3y subject to the constraint
x 2 + y 2 = 136.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 39 / 52
Solution
Given f (x, y ) = 5x − 3y and g (x, y ) = x 2 + y 2 − 136. Now
∇(f ) = λ∇(g ) =⇒ (5 iˆ − 3 j)
ˆ = λ(2x iˆ + 2y j)
ˆ
5 = 2λx
−3 = 2λy
x + y 2 = 136
2
(Given constraint)
Notice that we can’t have λ = 0 since that would not satisfy the first two equations.
So, since we know that λ ̸= 0 we can solve the first two equations for x and y
respectively. This gives,
5 3
x= y =−
2λ 2λ
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 40 / 52
Plugging these into the constraint gives,
25 9 17
2
+ 2 = 2 = 136
4λ 4λ 2λ
We can solve this for λ.
1 1
⇒ λ2 =
λ=±
16 4
Now, that we know λ we can find the points that will be potential maximums
and/or minimums.
If λ = − 14 we get,
x = −10 y =6
1
and if λ = 4 we get,
x = 10 y = −6
Thus, we have the following critical points
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 41 / 52
Here are the minimum and maximum values of the function.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 42 / 52
Example
Find the dimensions of the box with largest volume if the total surface area is 64
cm2 .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 43 / 52
Solution
Let’s set the length of the box to be x, the width of the box to be y and the height
of the box to be z. Let’s also note that because we’re dealing with the dimensions
of a box it is safe to assume that x, y , and z are all positive quantities.
We want to find the largest volume and so the function that we want to optimize
is given by,
f (x, y , z) = xyz
Next, we know that the surface area of the box must be a constant 64. So this is
the constraint. The constraint is given by,
Let
g (x, y , z) = xy + xz + yz − 32.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 44 / 52
Now
∇(f ) = λ∇(g ) =⇒ (yz iˆ + xz jˆ + xy k̂) = λ (y + z) iˆ + (x + z) jˆ + (x + y ) k̂
yz = λ (y + z) (12)
xz = λ (x + z) (13)
xy = λ (x + y ) (14)
xy + xz + yz = 32 (Constraint) (15)
Now note that λ ̸= 0 because if λ = 0 then from Equations (12), (13), (14) and
(15) we get 32 = 0, which is absurd therefore λ ̸= 0.
Equations (12), (13), (14) can be re-written as
1 1 1
+ = (16)
y z λ
1 1 1
+ = (17)
z x λ
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 45 / 52
1 1 1
+ = (18)
x y λ
Solving Equations (16), (17), (18), we get
x = y = z = 2λ
This gives s r
8 32
x =y =z =2 = .
3 3
Thus, the volume of the box is
r r r ! r !3
32 32 32 32
V =f , , =
3 3 3 3
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 46 / 52
Example
Find the maximum and minimum values of f (x, y , z) = xyz subject to the con-
straint x + y + z = 1. Assume that x, y , z ≥ 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 47 / 52
Solution
Given that f (x, y , z) = xyz and g (x, y , z) = x + y + z − 1. Now
yz = λ (19)
xz = λ (20)
xy = λ (21)
x +y +z =1 (22)
Let’s start this solution process off by noticing that since the first three equations
all have λ they are all equal. So, let’s start off by setting equations (19) and (20)
equal.
yz = xz ⇒ z (y − x) = 0 ⇒ z = 0 or y = x
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 48 / 52
So, we’ve got two possibilities here. Let’s start off with by assuming that z = 0.
In this case we can see from either equation (19) or (20) that we must then have
λ = 0. From equation (21) we see that this means that xy = 0. This in turn means
that either x = 0 or y = 0.
So, we’ve got two possible cases to deal with there. In each case two of the variables
must be zero. Once we know this we can plug into the constraint, equation (22),
to find the remaining value.
z = 0, x = 0 : ⇒ y =1
z = 0, y = 0 : ⇒ x =1
So, we’ve got two possible solutions (0, 1, 0) and (1, 0, 0).
Now let’s go back and take a look at the other possibility, y = x. We also have
two possible cases to look at here as well.
This first case isx = y = 0. In this case we can see from the constraint that we
must have z = 1 and so we now have a third solution (0, 0, 1).
The second case is x = y ̸= 0. Let’s set equations (20) and (21) equal.
xz = xy ⇒ x (z − y ) = 0 ⇒ x = 0 or z = y
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 49 / 52
Now, we’ve already assumed that x ̸= 0 and so the only possibility is that z = y .
However, this also means that,
x =y =z
Using this in the constraint gives,
1
3x = 1 ⇒ x=
3
So, the next solution is 31 , 13 , 13 .
yz = xy ⇒ y (z − x) = 0 ⇒ y = 0 or z = x
xz = xy ⇒ x (z − y ) = 0 ⇒ x = 0 or z = y
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 50 / 52
Both of these are very similar to the first situation that we looked at and we’ll leave
it up to you to show that in each of these cases we arrive back at the four solutions
that we already found.
So, we have four solutions that we need to check in the function to see whether we
have minimums or maximums.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 51 / 52
Exercise 1:
A large container in the shape of a rectangular solid must have a volume of 480 m3 .
The bottom of the container costs $5/m2 to construct whereas the top and sides
cost $3/m2 to construct. Use Lagrange multipliers to find the dimensions of the
container of this size that has the minimum cost.
Exercise 2:
A rectangular box without a top (a topless box) is to be made from 12 ft 2 of
cardboard. Find the maximum volume of such a box.
Ans: The maximum volume is 4 ft 3 . The dimensions are 1 × 2 × 2 ft.
Exercise 3:
The temperature on the surface of x 2 + y 2 + 4z 2 = 64 is given by T (x, y , z) =
y 2 + z 2 . Use a Lagrange multiplier to find the points on the surface where the
temperature is a maximum. Find also the maximum temperature at those points.
Exercise 4:
The temperature of a point (x, y , z) in or on the unit sphere is given by T (x, y , z) =
1 + xy + yz. By using the method of Lagrange multipliers, find the tempera-
ture of the hottest point on the sphere. Ans: point ( √15 , √25 , √15 ) and maximum
temperature= 95 .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Functions of two variables October 1, 2024 52 / 52