0% found this document useful (0 votes)
13 views37 pages

Multi-Variable Calculus Lecture Notes

The lecture notes cover multi-variable calculus, focusing on limits, continuity, and partial derivatives of functions with multiple variables. It includes definitions, examples, and theorems related to limits in two dimensions, demonstrating how to evaluate limits and the conditions for continuity. The notes also discuss directional derivatives and the implications of partial derivatives on function behavior at specific points.

Uploaded by

anishmandia2007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views37 pages

Multi-Variable Calculus Lecture Notes

The lecture notes cover multi-variable calculus, focusing on limits, continuity, and partial derivatives of functions with multiple variables. It includes definitions, examples, and theorems related to limits in two dimensions, demonstrating how to evaluate limits and the conditions for continuity. The notes also discuss directional derivatives and the implications of partial derivatives on function behavior at specific points.

Uploaded by

anishmandia2007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Calculus lecture notes 1

Lecture notes
Calculus

Chapter-3

Multi Variable Calculus

Prof. K. Sreenadh
Department of Mathematics
IIT Delhi
2 K. Sreenadh

1 Limits in two variable


The aim of studying the functions depending on several variables is to understand the func-
tions which has several input variables and one or more output variables. For example, the
following are Real valued functions of two variables x, y:

(1) f (x, y) = x2 + y 2 is a real valued function defined over R2 .

xy
(2) f (x, y) = x2 +y 2
is a real valued function defined over R2 \{(0, 0)}

The real world problems like temperature distribution in a medium is a real valued function
with more than 2 variables. The temperature function at time t and at point (x, y) has
3 variables. For example, the temperature distribution in a plate, (unit square) with zero
temperature at the edges and initial temperature (at time t = 0)T0 (x, y) = sin πx sin πy, is
2
T (t, x, y) = e−π kt sin πx sin πy.

Another important problem of physics is Sound waves and water waves. The function u(x, t) =
A sin(kx − ωt) represents the traveling wave of the initial wave front sin kx. The Optimal cost
functions, for example a manufacturing company wants to optimize the resources, for their
produce, like man power, capital expenditure, raw materials etc. The cost function depends
on these variables. Earning per share for Apple company (2005-2010) has been modeled by
z = 0.379x − 0.135y − 3.45 where x is the sales and y is the share holders equity.
Let R2 denote the set of all points (x, y) : x, y ∈ R. The open ball of radius r with center
(a, b) is n o
p
Br ((a, b)) = (x, y) : (x − a)2 + (y − b)2 < r .

Definition 1.0.1. A point (a, b) is said to be an interior point of a subset Ω of R2 if there


exists r such that Br ((a, b)) ⊂ A. A subset Ω is called open if each point of Ω is an interior
point of Ω. A subset Ω is said to be closed in its set compliment (IR2 \ Ω) is an open subset
of R2 .

For example,

(1). The open ball of radius δ: Bδ ((0, 0)) = {(x, y) ∈ R2 : x2 + y 2 < 1} is an open set

(2). Union of open balls is also an open set.


n p o
(3). The closed ball of radius r : Br ((0, 0)) = (x, y) : |x|2 + |y|2 ≤ r is a closed set.

A sequence {(xn , yn )} is said to converge to a point (x, y) in R2 if for every ϵ > 0, there exists
N ∈ N such that
p
|xn − x|2 + |yn − y|2 < ϵ, for all n ≥ N.
Calculus lecture notes 3

Definition 1.0.2. Let Ω be a open set in R2 , (a, b) ∈ Ω and let f be a real valued function
defined on Ω except possibly at (a, b). Then the limit lim f (x, y) = L if for any ϵ > 0
(x,y)→(a,b)
there exists δ > 0 such that
p
(x − a)2 + (y − b)2 < δ =⇒ |f (x, y) − L| < ϵ.
 
1
Example 1.0.3. Consider the function f (x, y) = xy sin x2 +y 2 . This function is not defined

at (0, 0). since sin is bounded function, it is easy to see by back calculation

x2 + y 2 δ2
|f (x, y) − 0| = |x||y| ≤
< .
2 2

Therefore, given any ϵ > 0, we can choose δ such that δ < 2 ϵ to have
p
x2 + y 2 < δ =⇒ |f (x, y) − 0| < ϵ.

Therefore lim f (x, y) = 0.


(x,y)→(0,0)

Theorem 1.0.4. If the limit exists, then it is unique.

Proof. Indeed, if L1 and L2 are two limits, then for ϵ > 0, by definition there exists δ1 and
δ2 . By choosing δ = min{δ1 , δ2 }, and by triangle inequality, we get

|L1 − L2 | ≤ |L1 − f (x, y)| + |f (x, y) − L2 | < ϵ + ϵ = 2ϵ.

Since ϵ is arbitrary, we get L1 = L2 .

First guess for L: Simultaneous limits: As a first guess we use the simultaneous limit for
the value of L. That is,  
lim lim f (x, y) = L1 (say).
x→0 y→0

Such L1 may or may not be the limit. But if the limit exist then L1 is the limit. However
simultaneous limits may not exist.
4xy 2
Example 1.0.5. Consider the function f (x, y): f (x, y) = .
x2 + y 2
This function is defined in R2 \{(0, 0)}. So we need a value of L to verify the definition. We
see that the simultaneous limit is 0. So L = 0 is a candidate to be the limit. So, let ϵ > 0 be
given, then
4|xy 2 | p
≤ 4|x| ≤ 4 x2 + y 2 < 4δ.
x2 + y 2
Therefore we can choose δ = 4ϵ . For such δ, |f (x, y) − 0| < ϵ. The continuity of the function
can be seen from the plot given below in Figure 1 (generated using wolfram web-site)
4 K. Sreenadh

Therefore, if limit exists then simultaneous limit (if exists) will be equal to the limit. However

Figure 1:

at times simultaneous limit may not exist but limit may exist. For example,

Example 1.0.6. The function



x sin( 1 ) + y sin( 1 ) xy ̸= 0
xy xy
f (x, y) =
0 xy = 0

In this case we can easily see that simultaneous limits does not exist. But limit along
x = y will be zero. So this can be our choice for obtaining δ. By back calculation,

1 1 p
x sin( ) + y sin( ) ≤ |x| + |y| ≤ 2 x2 + y 2 < 2δ < e
xy xy

So given any ϵ > 0, we can choose δ = ϵ/2.

Example 1.0.7. Finding limit through polar coordinates:


x3
Consider the function f (x, y) = 2 .
x + y2

This function is defined in R2 \{(0, 0)}. Taking x = r cos θ, y = r sin θ, we get

|f (r, θ)| = |r cos3 θ| ≤ r → 0 as r → 0.

Using the triangle inequality (as in one variable limit), one can show that if limit exists, then
it is unique. That is, the limit is independent of choice of path connecting (x, y) and (a, b).
Geometrically, a piece of surface cannot lie in two different strips.

Example 1.0.8. Example of function which has different limits along different straight lines.
xy
Consider the function f (x, y) = 2 .
x + y2
Calculus lecture notes 5

Figure 2:

m
Then along the straight lines y = mx, we get f (x, mx) = 1+m 2 . See this in the plot blow

in figure 3, the height from through each line appraching the origin is different. Hence limit
does not exist.

Figure 3:

Example 1.0.9. Example of function which has different limits along different curves: Con-
sider the function f (x, y):
x4 − y 2
f (x, y) = 4
x + y2
1−m2
Then along the curves y = mx2 , we get f (x, mx2 ) = 1+m2
. Hence limit does not exist.

Example 1.0.10. Example function where polar coordinates seem to give wrong conclusions
2x2 y
Consider the function f (x, y) = 4 .
x + y2
6 K. Sreenadh

Taking the path, y = mx2 , we see that the limit does not exist at (0, 0). Now taking x =
r cos θ, y = r sin θ, we get
2r cos2 θ sin θ
f (r, θ) = 2 .
r cos4 θ + sin2 θ
For any r > 0, the denominator is > 0. For each fixed r and taking θ → 0, we see it tends to

Figure 4:

0. Since | cos2 θ sin θ| ≤ 1, we tend to think for a while that this limit goes to zero as r → 0.
However we know that the limit along the path y = x2 is 1. So So taking this path in the
sin θ
polar form, we get the path r sin θ = r2 cos2 θ, (i.e., r = cos 2 θ ). Along this path r → 0 as

θ → 0. Along this, we get


2 sin2 θ
f (r, θ) = = 1.
2 sin2 θ
Therefore the limit does not exist. Also see the above figure 4, where one could see the
presence of sharp corners as one approaches origin from different sides.

2 Continuity and Partial derivatives

Let f be a real valued function defined in a ball around (a, b). Then

Definition 2.0.1. f is said to be continuous at (a, b) if

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


(x,y)→(a,b)

In other words,
f (a + h, b + k) → f (a, b) as (h, k) → (0, 0).
Calculus lecture notes 7

Example 2.0.2. The function



 √ xy x2 + y 2 ̸= 0
f (x, y) = x2 +y 2

0 x=y=0

Let ϵ > 0. Then |f (x, y) − 0| = |x| √ |y| ≤ |x|. So if we choose δ = ϵ, then |f (x, y)| ≤ ϵ.
2 x +y 2

Figure 5:

Therefore, f is continuous at (0, 0).

Partial Derivatives: The partial derivative of f with respect to x at (a, b) is defined as

∂f 1
fx (a, b) = (a, b) = lim (f (a + h, b) − f (a, b)) .
∂x h→0 h

similarly, the partial derivative with respect to y at (a, b) is defined as

∂f 1
fy (a, b) = (a, b) = lim (f (a, b + k) − f (a, b)) .
∂y k→0 k

In other words, if we treat the variable y as constant, and differentiate with respect to x,
we get the partial derivative with respect to x. When computing a partial derivative with
respect to x, we are looking at the instantaneous rate of change of f with respect to x, if
we keep the variable y constant. Roughly speaking, we are asking: how does increasing x a
tiny bit affect the value of the function f ? The partial derivatives may be used as follows:
If fx (a, b) > 0 then we may say that at the point (a, b) if we move along positive x-direction
then the function f increases.

Example 2.0.3. Consider the function f (x, y) = x2 y. Then

∂f f (a + h, b) − f (a, b)
(a, b) = lim
∂x h→0 h
(a + h)2 b − a2 b
= lim = 2ab + lim hb = 2ab.
h→0 h h→0
8 K. Sreenadh

Example 2.0.4. Consider the function



 xy (x, y) ̸≡ (0, 0)
2 2
f (x, y) = x +y
0 (x, y) ≡ (0, 0)

As noted earlier, this is not a continuous function, but

f (h, 0) − f (0, 0) 0−0


fx (0, 0) = lim = lim = 0.
h→0 h h→0 h

and
f (0, k) − f (0, 0) 0−0
fy (0, 0) = lim = lim = 0.
k→0 k k→0 k
Also for a continuous function, partial derivatives need not exist. For example f (x, y) =
|x| + |y|. This is a continuous function at (0, 0). Indeed, for any ϵ > 0, we can take δ < ϵ/2.
But partial derivatives do not exist at (0, 0)
Sufficient condition for continuity:

Theorem 2.0.5. Suppose one of the partial derivatives exist at (a, b) and the other partial
derivative is bounded in a neighborhood of (a, b). Then f (x, y) is continuous at (a, b).

Proof. Let fy exists at (a, b). Then

f (a, b + k) − f (a, b) = kfy (a, b) + ϵ1 k,

where ϵ1 → 0 as k → 0. Since fx exists and bounded in a neighborhood of at (a, b),

f (a + h, b + k) − f (a, b) =f (a + h, b + k) − f (a, b + k) + f (a, b + k) − f (a, b)


=hfx (a + θh, b + k) + kfy (a, b) + ϵ1 k
≤hM + k|fy (a, b)| + ϵ1 k
→ 0 as h, k → 0.

3 Directional derivatives

Let p̂ = p1 î + p2 ĵ be any unit vector. Then the directional derivative of f (x, y) at (a, b) in
the direction of p̂ is

f (a + sp1 , b + sp2 ) − f (a, b)


Dp̂ f (a, b) = lim .
s→0 s

Example 3.0.1. Find the directional derivative of f (x, y) at P (1, 2) in the direction of unit
vector p = √12 î + √12 ĵ for the function f (x, y) = x2 + xy.
Calculus lecture notes 9

From the definition,

f (1 + √s , 2 + √s ) − f (1, 2)
2 2
Dp̂ f (1, 2) = lim
s→0 s
√ √
 
1 2 1 1
= lim s + s(2 2 + √ ) = 2 2 + √
s→0 s 2 2

Next we would like to see if the existence of partial derivatives guarantee the existence of
directional derivatives in all directions. The answer is negative. For example, take

 xy x2 + y 2 ̸= 0
2 2
f (x, y) = x +y .
0 x=y=0

Let →

p = (p1 , p2 ) such that p21 + p22 = 1. Then the directional derivative along p is

f (hp1 , hp2 ) − f (0, 0) p1 p2


Dpbf (0, 0) = lim = lim
h→0 h h→0 h(p21 + p22 )

exist if and only if p1 = 0 or p2 = 0.


Also, the existence of all directional derivatives does not guarantee the continuity of the
function. For example

Example 3.0.2. The function



x2 y

x4 +y 2
(x, y) ̸≡ (0, 0)
f (x, y) = .
0 x=y=0

has directional derivatives in all directions at (0, 0) but is not continuous at (0, 0).

Let →

p = (p1 , p2 ) such that p21 + p22 = 1. Then the directional derivative along p is

f (sp1 , sp2 ) − f (0, 0)


Dpbf (0, 0) = lim
s→0 s
s3 p21 p2 p21 p2
= lim = if p2 ̸= 0
s→0 s(s4 p4 2 2
1 + s p2 ) p22

In case of p2 = 0, we can compute the partial derivative w.r.t y to be 0. Therefore all the
directional derivatives exist. But this function is not continuous (y = mx2 and x → 0). ///

Recall the left and right derivatives concept we do in one variable. So we may ask the question
if all directional derivatives are equal at a point then is function continuous at that point.
The next example shows that it is not.
10 K. Sreenadh

Example 3.0.3. Show that the function defined by


 3√
 x |y| (x, y) ̸= (0, 0)
x4 +y 2
f (x, y) =
0 (x, y) ≡ (0, 0)

It is not difficult to show that this function is not continuous. The directional derivative is
p p
1 s3 p1 |s| |p2 |
Dp̂ f (0, 0) = lim
s→0 s s2 (s2 p4 + p22 )
p p1
p1 |s| |p2 |
= lim = 0.
s→0 (s2 p4 2
1 + p2 )

So the concept of differentiability of a function is stronger than directional derivative.

4 Differentiability

First let us recall the concept of differentiability in one variable case. A function defined in
an interval containing x = a is said to be differentiable if the following limit exists

f (a + h) − f (a)
lim = f ′ (a).
h→0 h

However we cannot write this for functions defined in R2 as we do not know how to divide by
say (h, k). But the above definition can equivalently written as: f is differentiable at x = a
if there exists a constant f ′ (a) (say) such that

f (a + h) − f (a) = hf ′ (a) + ϵh

where ϵ → 0 as h → 0. So this motivates us to the following generalization:


Let D be an open subset of R2 . Then we may think of defining a function f (x, y) : D → R is
differentiable at a point (a, b) of D if there exists C1 , C2 and ϵ1 = ϵ(h, k), ϵ2 = ϵ2 (h, k) such
that
f (a + h, b + k) − f (a, b) = hC1 + kC2 + hϵ1 + kϵ2 ,

where ϵ1 , ϵ2 → 0 as (h, k) → (0, 0).


Suppose if the above holds for a function f , then by taking k = 0 in the above definition, we
have
f (a + hb) − f (a, b) = hC1 + ϵ1 h

taking h → 0, we obtain C1 = fx (a, b). Similarly C2 = fy (a, b). So we may define the
differentiability as
Calculus lecture notes 11

Definition 4.0.1. A function f : D → R is differentiable at a point (a, b) of D if

f (a + h, b + k) − f (a, b) − hfx (a, b) − kfy (a, b) = hϵ1 + kϵ2

where ϵ1 , ϵ2 → 0 as (h, k) → (0, 0).

Example 4.0.2. Consider the function f (x, y) = x2 + y 2 + xy. Then fx (0, 0) = fy (0, 0) = 0.
Also

f (h, k) − f (0, 0) − hfx (0, 0) − kfy (0, 0) = h2 + k 2 + hk = 0h + 0k + ϵ1 h + ϵ2 k

where ϵ1 = h + k, ϵ2 = k. Therefore f is differentiable at (0, 0).

Example 4.0.3. Show that the following function f (x, y) is is not differentiable at (0, 0)

x sin 1 + y sin 1 , xy ̸= 0
x y
f (x, y) =
0 xy = 0

Figure 6:

p
Using the boundedness of sin and cos, we get |f (x, y)| ≤ |x| + |y| ≤ 2 x2 + y 2 implies that
f is continuous at (0, 0). Also

f (h, 0) − f (0, 0)
fx (0, 0) = lim = 0.
h→0 h

f (0, k) − f (0, 0)
fy (0, k) = lim = 0.
k→0 k
If f is differentiable, then there exists ϵ1 , ϵ2 such that

f (h, k) − f (0, 0) = ϵ1 h + ϵ2 k
12 K. Sreenadh

where ϵ1 , ϵ2 → 0 as h, k → 0. Now taking h = k, we get

1
f (h, h) = (ϵ1 + ϵ2 )h =⇒ 2h sin = h(ϵ1 + ϵ2 ).
h

So as h → 0, we get sin h1 → 0, a contradiction.

p
Example 4.0.4. Show that the function f (x, y) = |xy| is not differentiable at the origin.

Easy to check the continuity (take δ = ϵ).

0−0
fx (0, 0) = lim = 0, and similar calculation shows fy (0.0) = 0
h→0 h

So if f is differentiable at (0, 0), then there exist, ϵ1 , ϵ2 such that

f (h, k) = ϵ1 h + ϵ2 k.

Taking h = k, we get
|h| = (ϵ1 + ϵ2 )h.

This implies that (ϵ1 + ϵ2 ) ̸→ 0.

Notations:

1. ∆f = f (a + h, b + k) − f (a, b), the total variation of f

2. df = hfx (a, b) + kfy (a, b), the total differential of f .



3. ρ = h2 + k 2

Then we have the following Equivalent condition for differentiability:


∆f − df
Theorem 4.0.5. f is differentiable at (a, b) ⇐⇒ lim = 0.
ρ→0 ρ
Proof. Suppose f (x, y) is differentiable. Then, there exists ϵ1 , ϵ2 such that

f (a + h, b + k) − f (a, b) = hfx (a, b) + kfy (a, b) + hϵ1 + kϵ2 ,

where ϵ1 , ϵ2 → 0 as (h, k) → (0, 0).


Therefore, we can write
∆f − df h k
= ϵ1 ( ) + ϵ2 ( ),
ρ ρ ρ

where df = hfx (a, b) + kfy (a, b) and ρ = h2 + k 2 . Now since | hρ | ≤ 1, kρ ≤ 1 we get

∆f − df
lim = 0.
ρ→0 ρ
Calculus lecture notes 13

∆f −df
On the other hand, if limρ→0 ρ = 0, then

∆f = df + ϵρ, ϵ → 0 as h, k → 0.

We may write ϵρ as

ϵρ ϵρ
ϵρ = |h| + |k|
|h| + |k| |h| + |k|
ϵρ sgn(h) ϵρ sgn(k)
= h+ k
|h| + |k| |h| + |k|

ϵρ sgn(h) ϵρ sgn(k)
Therefore, we can take ϵ1 = |h|+|k| and ϵ2 = |h|+|k| .


x2 y 2

x2 +y 2
(x, y) ̸≡ (0, 0)
Example 4.0.6. Consider the function f (x, y) = .
0 x=y=0

Figure 7:

Partial derivatives exist at (0, 0) and fx (0, 0) = 0, fy (0, 0) = 0. By taking h = ρ cos θ, k =


ρ sin θ, we get
∆f − df h2 k 2 ρ4 cos2 θ sin θ
= 3 = = ρ cos2 θ sin θ.
ρ ρ ρ3
∆f −df
Therefore, ρ ≤ ρ → 0 as ρ → 0. Therefore f is differentiable at (0, 0).


x2 y

x2 +y 2
(x, y) ̸≡ 0
Example 4.0.7. Consider f (x, y) = .
0 x=y=0
Partial derivatives exist at (0, 0) and fx (0, 0) = fy (, 0) = 0. By taking h = ρ cos θ, k = ρ sin θ,
we get
∆f − df h2 k ρ3 cos2 θ sin θ
= 3 = = cos2 θ sin θ.
ρ ρ ρ3
The limit does not exist. Therefore f is NOT differentiable at (0, 0).
14 K. Sreenadh

The following theorem is on Sufficient condition for differentiability:

Theorem 4.0.8. Suppose fx (x, y) and fy (x, y) exist in an open neighborhood containing (a, b)
and both functions are continuous at (a, b). Then f is differentiable at (a, b).

Proof. Since ∂f ∂y is continuous at (a, b), there exists a neighborhood N (say) of (a, b) at every
point of which fy exists. We take (a + h, b + k), a point of this neighborhood so that (a +
h, b), (a, b + k) also belongs to N .
We write

f (a + h, b + k) − f (a, b) = {f (a + h, b + k) − f (a + h, b)} + {f (a + h, b) − f (a, b)}.

Consider a function of one variable ϕ(y) = f (a + h, y).


Since fy exists in N, ϕ(y) is differentiable with respect to y in the closed interval [b, b + k] and
as such we can apply Lagrange’s Mean Value Theorem, for function of one variable y in this
interval and thus obtain


ϕ(b + k) − ϕ(b) = kϕ (b + θk), 0 < θ < 1
= kfy (a + h, b + θk)

f (a + h, b + k) − f (a + h, b) = kfy (a + h, b + θk), 0 < θ < 1.

Now, if we write

fy (a + h, b + θk) − fy (a, b) = ϵ2 (a function of h, k)

then from the fact that fy is continuous at (a,b). we may obtain

ϵ2 → 0 as (h, k) → (0, 0).

Again because fx exists at (a, b) implies

f (a + h, b) − f (a, b) = hfx (a, b) + ϵ1 h,

where ϵ1 → 0 as h → 0. Combining all these we get

f (a + h, b + k) − f (a, b) = k[fy (a, b) + ϵ2 ] + hfx (a, b) + ϵ1 h


= hfx (a, b) + kfy (a, b) + ϵ1 h + ϵ2 k

where ϵ1 , ϵ2 are functions of (h, k) and they tend to zero as (h, k) → (0, 0).
This proves that f (x, y) is differentiable at (a, b).
Calculus lecture notes 15

Remark 4.1. The above proof still holds if fy is continuous and fx exists at (a, b).

There are functions which are Differentiable but the partial derivatives need not be continuous.
For example,

Example 4.0.9. Consider the function



x3 sin 1 + y 3 sin 1 xy ̸= 0
x2 y2
f (x, y) =
0 xy = 0.

Figure 8:

Then 
3x2 sin 1 − 2 cos 1 xy ̸= 0
x2 x2
fx (x, y) =
0 xy = 0
f (h,0)−f (0,0)
Also fx (0, 0) = limh→0 h = 0. So partial derivatives are not continuous at (0, 0).

1 1
f (∆x, ∆y) = (∆x)3 sin 2
+ (∆y)3 sin
(∆x) (∆y)2
= 0 + 0 + ϵ1 ∆x + ϵ2 ∆y

1 1
where ϵ1 = (∆x)2 sin (∆x) 2
2 and ϵ2 = (∆y) sin (∆y)2 . It is easy to check that ϵ1 , ϵ2 → 0. So f

is differentiable at (0, 0).

There are continuous functions for which directional derivatives exist in any direction, but
the function is not differentiable. For example,

Example 4.0.10. Consider the function


 p
 y x2 + y 2 y ̸= 0
f (x, y) = |y|
0 y = 0.
16 K. Sreenadh

Chain rule:

Partial derivatives of composite functions: Let z = F (u, v) and u = ϕ(x, y), v = ψ(x, y).
Then z = F (ϕ(x, y), ψ(x, y)) as a function of x, y. Suppose F, ϕ, ψ have continuous partial
derivatives, then we can find the partial derivatives of z w.r.t x, y as follows: Let x be increased
by ∆x, keeping y constant. Then the increment in u is ∆x u = u(x + ∆x, y) − u(x, y) and
similarly for v. Then the increment in z is (as z is differentiable as a function of u, v )

∂F ∂F
∆x z := z(x + ∆x, y + ∆y) − z(x, y) = ∆x u + ∆x v + ϵ1 ∆x u + ϵ2 ∆x v
∂u ∂v

Now dividing by ∆x

∆x z ∂F ∆x u ∂F ∆x v ∆x u ∆x v
= + + ϵ1 + ϵ2
∆x ∂u ∆x ∂v ∆x ∆x ∆x

Taking ∆x → 0, we get

∂z ∂F ∂u ∂F ∂v ∂u ∂v
= + + ( lim ϵ1 ) + ( lim ϵ2 )
∂x ∂u ∂x ∂v ∂x ∆x→0 ∂x ∆x→0 ∂x
∂F ∂u ∂F ∂v
= +
∂u ∂x ∂v ∂x

similarly, one can show


∂z ∂F ∂u ∂F ∂v
= + .
∂y ∂u ∂y ∂v ∂y
2 ∂z
Example 4.0.11. Let z = ln(u2 + v 2 ), where u = ex+y and v = x2 + y. Then find ∂x at
x = 1, y = 1.
From the above Chain rule, taking F (u, v) = ln(u2 + v 2 ) and differentiating F with u, Fu =
2u 2
u2 +v
, Fv = u21+v . Also, ux = ex+y and vx = 2x. Therefore,

∂z 2u x+y2 2x
= 2 e + 2
∂x u +v u +v

At x = 1, y = 1, we have u = e2 , v = 2. Therefore,

∂z 2e2 2 2
= 4
e + 4 at x = 1, y = 1.
∂x 2+e e +2

Derivative of Implicitly defined function

Theorem 4.0.12. Let y = y(x) be defined as F (x, y) = 0, where F, Fx , Fy are continuous at


dy
(x0 , y0 ) and Fy (x0 , y0 ) ̸= 0. Then dx = − FFxy at (x0 , y0 ).

Proof. Increase x by ∆x, then y receives ∆y increment and F (x + ∆x, y + ∆y) = 0. Also

0 = ∆F = Fx ∆x + Fy ∆y + ϵ1 ∆x + ϵ2 ∆y
Calculus lecture notes 17

where ϵ1 , ϵ2 → 0 as ∆x → 0. This is same as

∆y Fx + ϵ1
=−
∆x Fy + ϵ2

dy
Now taking limit ∆x → 0, we get dx = − FFxy .

dy
Example 4.0.13. Find dx for the function y = y(x) defined implicitly as ey − ex + xy = 0.
Taking F (x, y) = ey − ex + xy, we obtain by differentiang partially with respect to x and y,

Fx = −ex + y, Fy = ey + x.

dy ex −y
Therefore, dx = ey +x .

Theorem 4.0.14. If f (x, y) is differentiable, then the directional derivative in the direction
p̂ at (a, b)is
Dp̂ f (a, b) = ∇f (a, b) · p̂.

Proof. Let p̂ = (p1 , p2 ). Then from the definition,

f (a + sp1 , b + sp2 ) − f (a, b) f (x(s), y(s)) − f (x(0), y(0))


lim = lim
s→0 s s→0 s

where x(s) = a + sp1 , y(s) = b + sp2 .


From the chain rule,

f (x(s), y(s)) − f (x(0), y(0)) ∂f dx ∂f dy


lim = (a, b) + (a, b) = ∇f (a, b) · (p1 , p2 ).
s→0 s ∂x ds ∂y ds

///
The above proposition is again only sufficient condition. That is The formula Dp̂ f = ∇f · p̂
can still hold even when function f is NOT differentiable. for example
 p
2
 x y |y|

(x, y) ̸≡ (0, 0)
f (x, y) = x4 + y 2

0 (x, y) ≡ (0, 0)

In this case it is easy to check from the definition that all directional derivatives at the origin
are equal to zero. But the function is not differentiable at the origin. To show this take the
polar coordinates x = r cos θ, y = r sin θ to see that
p
∆f − df √ sin2 θ cos θ | sin θ|
= r 2 .
r r cos2 θ + sin2 θ
18 K. Sreenadh

sin θ
Taking r = cos θ and taking θ → 0, we see that the above limit approaches infinity. ///

Definition 4.0.15. Gradient: The gradient of a function f (x, y) at the point (a, b) is the
vector
∇u = fx î + fy ĵ at (a, b).

Using the directional derivatives, we can also find the Direction of maximum rate of change.
Dp̂ f = ∇f · p̂ = |∇f | cos θ where θ is the angle between ∇u and p̂. So the function f increases
most rapidly when cos θ = 1 or when p̂ is the direction of ∇f . The directional derivative in
∇f
the direction |∇f | is equal to |∇f |. So the maximal rate of change of f is |∇f |.
Similarly, f decreases most rapidly in the direction of −∇f . The derivative in this direction
is Dp̂ f = −|∇f |. Finally, the direction of no change is when θ = π2 . i.,e., p̂ ⊥ ∇f .

Example 4.0.16. Find the direction in which f = x2 /2 + y 2 /2 increases and decreases most
rapidly at the point (1, 1). Also find the direction of zero change at (1, 1).

The function f is differentiable as fx = x, fy = y are continuous function. Therefore

Dp̂ f = (x, y) · p̂ = xp1 + yp2 = p1 + p2 at (1, 1)

The direction of maximum change is ∇f . Therefore for direction of maximal change we take

1 1 1
p̂ = (xî + y ĵ) = √ î + √ ĵ at (1, 1).
x2 +y 2
2 2

Hence the maximum change at (1, 1) is 2. Also the direction of zero change is

1 −1 1
p̂ = p (−y, x) = √ î + √ ĵ, at (1, 1).
2
x +y 2 2 2

5 Tangents and Normal to Level curves


Let f (x, y) be differentiable and consider the level curve f (x, y) = c. Let ⃗r(t) = g(t)î + h(t)ĵ
be its parametrization. For example f (x, y) = x2 + y 2 has x(t) = a cos t, y(t) = a sin t as
level curve x2 + y 2 = a2 , which is a circle of radius a. For any curve C with position vector
⃗r(t) = x(t)î + y(t)ĵ, the direction

1
(⃗r(t + ∆t) − ⃗r(t))
∆t

represents the direction of tangent. Therefore taking limit ∆t → 0 we get

1
⃗r ′ (t) = lim (⃗r(t + ∆t) − ⃗r(t)) = x′ (t)î + y ′ (t)ĵ.
∆t→0 ∆t
Calculus lecture notes 19

That is, ⃗r ′ (t) represents the tangential direction. To get the normal direction, differentiating
the equation f (x(t), y(t)) = a2 with respect to t, we get

dx dy
fx + fy = 0.
dt dt

Now since →−
r ′ (t) = x′ (t)î + y ′ (t)ĵ is the tangent to the curve, we can infer from the above
equation that ∇f is the direction of Normal. Hence we have

Equation of Normal at (a, b) is

x = a + fx (a, b)t, y = b + fy (a, b)t, t ∈ R

Equation of Tangent is
(x − a)fx (a, b) + (y − b)fy (a, b) = 0.
x2
Example 5.0.1. Find the normal and tangent to 4 + y 2 = 2 at (−2, 1).

Figure 9:

We find ∇f = x2 î + 2y ĵ (−2,1) = −î + 2ĵ. Therefore, the Tangent line through (−2, 1) is
−(x + 2) + 2(y − 1) = 0.

Tangent Plane and Normal lines


Let →−r (t) = g(t)î + h(t)ĵ + k(t)k̂ is a smooth level curve(space curve) of the level surface
f (x, y, z) = c. Then differentiating f (x(t), y(t), z(t)) = c with respect to t and applying chain
rule, we get
∇f (a, b, c) · (x′ (t), y ′ (t), z ′ (t)) = 0

This is same as
∇f · ⃗r ′ (t) = 0.
20 K. Sreenadh

Now note that the vector ∇f in the above equation will be same for any curve ⃗r(t). In other
words the only vector ∇(a, b, c) will work for any curve ⃗r(t). That is this vector is normal to
tangents of all curves passing through the point (a, b, c). Therefore the equation of Normal
line at (a, b, c) is

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

and the equation of Tangent plane

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

Example 5.0.2. Find the tangent plane and normal line of f (x, y, z) = x2 + y 2 + z − 9 = 0
at (1, 2, 4).

Figure 10:

From the given function, we obtain the gradient

∇f = 2xî + 2y ĵ + k̂ =⇒ ∇f (1, 2, 4) = 2î + 4ĵ + k̂

Hence the tangent plane is

2(x − 1) + 4(y − 2) + (z − 4) = 0

The normal line is


x = 1 + 2t, y = 2 + 4t, z = 4 + t

///

Example 5.0.3. Find the tangent line to the curve of intersection of two surfaces f (x, y, z) =
x2 + y 2 − 2 = 0, g(x, y, z) = x + z − 4 = 0.
Calculus lecture notes 21

Figure 11:

The intersection of these two surfaces is an an ellipse on the plane g = 0. The direction
of normal to g(x, y, z) = 0 at (1, 1, 3) is î + k̂ and normal to f (x, y, z) = 0 is 2î + 2ĵ. The
required tangent line is orthogonal to both these normals. So the direction of tangent is

v = ∇f × ∇g = 2î − 2ĵ − 2k̂.

Tangent through (1, 1, 3) is x = 1 + 2t, y = 1 − 2t, z = 3 − 2t. ///


Linearization: Let f be a differentiable function in a rectangle containing (a, b). The lin-
earization of a function f (x, y) at a point (a, b) where f is differentiable is the function

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

The approximation f (x, y) ∼ L(x, y) is the standard linear approximation of f (x, y) at (a, b).
Since the function is differentiable,

E(x, y) = f (x, y) − L(x, y) = ϵ1 (x − a) + ϵ2 (y − b)

where ϵ1 , ϵ2 → 0 as x → a, y → b. The error of this approximation is

M
|E(x, y)| ≤ (|x − a| + |y − b|)2 .
2

where M = max{|fxx |, |fxy |, |fyy |}.

Example 5.0.4. Find the linearization and error in the approximation of f (x, y, z) = x2 −
xy + 12 y 2 + 3 at (3, 2).

We obtain from the given function,

f (3, 2) = 8, fx (3, 2) = 4, fy (3, 2) − 1.

So
L(x, y) = 8 + 4(x − 3) − (y − 2) = 4x − y − 2
22 K. Sreenadh

Also max{|fxx |, |fxy |, |fyy |} = 2 and

|E(x, y)| ≤ (|x − 3| + |y − 2|)2 .

6 Taylor’s theorem
∂ ∂f ∂ ∂f
It is not always true that the second order mixed derivatives fxy = ∂x ( ∂y ) and fyx = ∂y ( ∂x )
are equal. The following is the example

 xy(x2 −y2 ) , x ̸= 0, y ̸= 0
x2 +y 2
Example 6.0.1. f (x, y) = .
0 x=y=0

Figure 12:

Then
f (h, k) − f (h, 0) 1 hk(h2 − k 2 )
fy (h, 0) = lim = lim =h
k→0 k k→0 k h2 + k 2
Also fy (0, 0) = 0. Therefore,

fy (h, 0) − fy (0, 0)
fxy (0, 0) = lim
h→0 h
h−0
= lim =1
h→0 h

Now
f (h, k) − f (0, k) 1 hk(h2 − k 2 )
fx (0, k) = lim = lim = −k
h→0 h h→0 h h2 + k 2
and
fx (0, k) − fx (0, 0)
fyx (0, 0) = lim = −1.
h→0 k
///
The following theorem is on the sufficient condition for equality of mixed derivatives. We
omit the proof.
Calculus lecture notes 23

Theorem 6.0.2. If f, fx , fy , fxy , fyx are continuous in a neighborhood of (a, b). Then fxy (a, b) =
fyx (a, b).

But this is not a necessary condition as can be seen from the following example

x2 y 2

x2 +y 2
x ̸= 0, y ̸= 0
Example 6.0.3. Consider the function f (x, y) = .
0 x=y=0
Here fxy (0, 0) = fyx (0, 0) but they are not continuous at (0, 0) (Try!).

Theorem 6.0.4. Taylor’s theorem: Suppose f (x, y) and its partial derivatives through order
n+1 are continuous throughout an open rectangular region R centered at a point (a, b). Then,
throughout R,

1 2
f (a + h, b + k) =f (a, b) + (hfx + kfy ) (a,b) + (h fxx + 2hkfxy + k 2 fyy ) (a,b)
2!
1 3
+ (h fxxx + 3h2 kfxxy + 3hk 2 fxyy + k 3 fyyy ) (a,b)
3!
1 ∂ ∂ 1 ∂ ∂
+ ... + (h + k )n f (a,b) + (h + k )n+1 f (a+ch,b+ck)
n! ∂x ∂y (n + 1)! ∂x ∂y

where (a + ch, b + ck) is a point on the line segment joining (a, b) and (a + h, b + k).

Proof. Proof follows by applying the Taylor’s theorem, Chain rule on the one dimensional
function ϕ(t) = f (x + ht, y + kt) at t = 0.
Error estimation: Similar to the one variable case, we can approximate a given function
by its Taylor polynomial in two variables, for example,

Example 6.0.5. The function f (x, y) = x2 −xy+y 2 is approximated by a first degree Taylor’s
polynomial about the point (2, 3). Find a square |x − 2| < δ, |y − 3| < δ such that the error of
approximation is less than or equal to 0.1.

We have fx = 2x − y, fy = 2y − x, fxx = −1, fxy = −1, fyy = 2. At the point (2, 3):
fx = 1, fy = 4. So the linear polynomial L(x, y) is 7 + (x − 2) + 4(y − 3). The maximum error
in the first degree approximation is

B
|R| ≤ (|x − 2| + |y − 3|)2
2

where B = max{|fxx |, |fxy |, |fyy |} = max{2, 1, 2} = 2. Therefore, we want to determine δ


such that
2
|R| ≤ (δ + δ)2 < 0.1
2

Hence δ me chosen such that 0 < δ < 0.025.
24 K. Sreenadh

7 Local maxima and minima in two variables

Let us consider a function f : R2 → R be a well defined function in an open set around the
point (a, b).

Definition 7.0.1. We say that the point (a, b) is a point of local maximum of f , if there
exists δ > 0 such that
p
h2 + k 2 < δ =⇒ ∆f = f (a + h, b + k) − f (a, b) ≤ 0

The point (a, b) is a point of local minimum of f , if there exists δ > 0 such that
p
h2 + k 2 < δ =⇒ ∆f = f (a + h, b + k) − f (a, b) ≥ 0

We say that the point (a, b) is a point of local extremum if either it is local maximum or local
minimum.
Necessary condition: Suppose f is differentiable in an open set around the point (a, b)
and the point (a, b) is a point of local extremum. Then by taking the one variable function
ψ(x) = f (x, b) we see that the point x = a is a point of local extremum for ψ. Therefore, by
the one variable calculus, ψ ′ (x) = 0. That is ∂f ∂f
∂x (a, b) = 0. Similarly, we also get ∂y (a, b) = 0.

Example 7.0.2. Find the critical points of f (x, y) = x2 − xy + y 2 .

In this case, fx = 2x − y and fy = 2y − x. So fx = fy = 0 implies x = 0, y = 0. Hence (0, 0)


is the only critical point.
Sufficient Condition: Suppose f is twice differentiable and the second order partial deriva-
tives are continuous in an open set around the point (a, b). If the point is also a local
extremum, then from the above necessary condition all first order partial derivatives at the
point (a, b) will be equal to zero. So to determine if the point is a point of local maximum
or minimum, it is enough to determine the sign of ∆f = f (a + ∆x, b + ∆y) − f (a, b) for all
small ∆x and ∆y. From the above Taylor’s theorem for two variables,

1
fxx (a, b)(∆x)2 + 2fxy (a, b)∆x∆y + fyy (a, b)(∆y)2 + α(∆ρ)3

∆f =
2
p
where ∆ρ = (∆x)2 + (∆y)2 . We use the notation

A = fxx , B = fxy , C = fyy

In polar form,
∆x = ∆ρ cos ϕ, ∆y = ∆ρ sin ϕ
Calculus lecture notes 25

Then we have

1
∆f = (∆ρ)2 A cos2 ϕ + 2B cos ϕ sin ϕ + C sin2 ϕ + 2α∆ρ .

2

Suppose A ̸= 0, then

(A cos ϕ + B sin ϕ)2 + (AC − B 2 ) sin2 ϕ


 
1
∆f = (∆ρ)2 + 2α∆ρ
2 A

Now we consider the 4 possible cases:


Case 1: Let AC − B 2 > 0, A < 0. Then (A cos ϕ + B sin ϕ)2 ≥ 0, sin2 ϕ ≥ 0 implies

1
∆f = (∆ρ)2 −m2 + 2α∆ρ

2

where m is independent of ∆ρ, α∆ρ → 0 as ∆ρ → 0. Hence for ∆ρ small, ∆f ≤ 0. Hence the


point (a, b) is a point of local maximum
Case 2: Let AC − B 2 > 0, A > 0.
In this case
1
∆f = (∆ρ)2 (m2 + α∆ρ)
2
So ∆f ≥ 0. Hence the point (a, b) is a point of local minimum.
Case 3:

1. Let AC − B 2 < 0, A > 0. When we move along ϕ = 0, we have

1
∆f = (∆ρ)2 (A + 2α∆ρ) > 0.
2

for ∆ρ small. When we move along tan ϕ0 = −A/B, then

AC − B 2
 
1
∆f = (∆ρ)2 2
sin ϕ0 + 2α∆ρ ≤ 0
2 A

for ∆ρ small. so we don’t have constant sign along all directions. Hence (a, b) is neither
a point of maximum nor a point of minimum. Such point (a, b) is called Saddle point.

2. Let AC − B 2 < 0, A < 0.


Similar as above the sign along path ϕ = 0 is non-positive and tan ϕ0 = −A/B is
non-negative.

3. Let AC − B 2 < 0, A = 0.
In this case B ̸= 0 and

1
∆f = (∆ρ)2 (sin ϕ(2B cos ϕ + C sin ϕ) + 2α∆ρ)
2
26 K. Sreenadh

for small ϕ, 2B cos ϕ + C sin ϕ is close to 2B, but sin ϕ changes sign for ϕ > 0 or ϕ < 0.
Again here (a, b) is a saddle point.

Case 4: Let AC − B 2 = 0.
Again in this case it is difficult to decide the sign of ∆f . For instance, if A ̸= 0,

(A cos ϕ + B sin ϕ)2


 
1
∆f = (∆ρ)2 + 2α∆ρ
2 A

When ϕ = arctan(−A/B), the sign of ∆f is determined by the sign of α. So Additional


investigation is required. No conclusion can be made with AC − B 2 = 0.

We summarize the derivative test in two variables in the following:

step 1: Find the critical points by solving the equations

∂f ∂f
= 0, = 0.
∂x ∂y

Step 2: At the critical points, the following holds:


[Link]. Condition Nature
1 AC − B 2 > 0, A > 0 local minimum
2 AC − B2 > 0, A < 0 local maximum
3 AC − B2 <0 Saddle point
4 AC − B2 =0 No conclusion

Example 7.0.3. Find critical points and their nature of f (x, y) = xy − x2 − y 2 − 2x − 2y + 4

Figure 13:

The critical points are found using fx = y − 2x − 2 = 0, fy = x − 2y − 2 = 0. Therefore,


the point (−2, −2) is the only critical point. Also A = fxx = −2, C = fyy = −2, and
Calculus lecture notes 27

B = fxy = 1. Therefore, AC − B 2 = 3 > 0 and A = −2 < 0. Therefore, (−2, −2) is a point


of local maximum.
The following is an example where the derivative test fails.

Example 7.0.4. Consider the function f (x, y) = (x − y)2 ,

Figure 14:

Here fx = 0, fy = 0 implies x = y. Also, AC − B 2 = 0. Moreover, all third order


partial derivatives are zero. so no further information can be expected from Taylor’s theorem.
However it is easy to see that f (x, y) ≥ 0 and f (x, x) = 0 implying that all points on the line
y = x are the points of global minimum.

Example 7.0.5. Find the critical points and their nature for the function f (x, y) = x3 +
3xy + y 3 .

Critical points:

fx = 3x2 + 3y = 0, fy = 3x + 3y 2 = 0 =⇒ x = 0, y = 0, and x = −1, y = −1.

Therefore (0, 0) and (−1, −1) are the critical points.

fxx = 6x, fxy = 6y, fyy = 3

Therefore at (0, 0), AC − B 2 < 0. Therefore, (0, 0) is a saddle point. At (−1, −1), AC − B 2 >
0, A < 0. Therefore, (−1, −1) is a point of local minimum.
28 K. Sreenadh

Figure 15:

8 Global maxima and Minima


Suppose we have a function defined on closed and bounded domain. Then we know that the
maximum and minimum are achieved. This maximum and minimum may be in the interior
or on the boundary. If it is in the interior then the derivatives of the function at these points
must be zero. However on the boundary we cannot do the derivative test. For example
f (x) = x on [0, 1]. We know that the minimum is at 0 and maximum is at 1. But the
derivative is not zero at these points. We we do the following

1. Find all interior points critical points of f (x, y). These are the points inside the open
domain where partial derivatives are zero.

2. Restrict the function to the each piece of the boundary. This will be one variable
function defined on closed interval I(say) and use the derivative test of one variable
calculus to find the nature of critical points.

3. Find the end points of these intervals I and evaluate f (x, y) at these points.

4. The global/Absolute maximum/minimum will be the maximum/minimum of f among


all these points.

Example 8.0.1. Find the absolute maxima and minima of f (x, y) = 2 + 2x + 2y − x2 − y 2


on the triangular region in the first quadrant bounded by the lines x = 0, y = 0, y = 9 − x.

Solution: fx = 2 − 2x = 0, fy = 2 − 2y = 0 implies that x = 1, y = 1 is the only critical


point and f (1, 1) = 4. fxx = −2, fyy = −2, fxy = 0. Therefore, AC − B 2 = 4 > 0 and A < 0.
So this is local maximum.

1. On the segment y = 0, f (x, y) = f (x, 0) = 2 + 2x − x2 defined on I = [0, 9]. f (0, 0) =


2, f (9, 0) = −61 and the at the interior points where f ′ (x, 0) = 2 − 2x = 0. So x = 1 is
the only critical point and f (1, 0) = 3.
Calculus lecture notes 29

2. On the segment x = 0, f (0, y) = 2 + 2y − y 2 and fy = 2 − 2y = 0 implies y = 1 and


f (0, 1) = 3.

3. On the segment y = 9 − x, we have f (x, 9 − x) = −61 + 18x − 2x2 and the critical point
is x = 9/2. At this point f (9/2, 9/2) = −41/2.

4. finally, f (0, 0) = 2, f (9, 0) = f (0, 9) = −61. so the global maximum is 4 at (1, 1) and
minimum is −61 at (9, 0) and (0, 9).

9 Constrained extremum
A couple of situations:

1. Milkmaid problem: Suppose a milkmaid (M) is trying to get milk a cow (C) as fast
as possible. But before milking the cow, milkmaid has to clean the bucket in the river
whose river front is defined by h(x, y) = 0. The question is what is the best point (x, y)
on the river front to minimize the total distance.

2. How do we minimize the metal sheet to make a cylindrical Water CAN that could fill
250cm3 of liquid.

First, we describe the substitution method. Consider the problem of finding the shortest
distance from origin to the plane z = 2x + y − 5.
Here we minimize the function f (x, y, z) = x2 +y 2 +z 2 subject to the constraint 2x+y−z−5 =
0. Substituting the constraint in the function, we get

h(x, y) = f (x, y, 2x + y − 5) = x2 + y 2 + (2x + y − 5)2 .

The critical points of this function are

hx = 2x + 2(2x + y − 5)(2) = 0, hy = 2y + 2(2x + y − 5) = 0.

This leads to x = 5/3, y = 5/6. Then z = 2x + y − 5 implies z = −5/6. We can check that
AC − B 2 > 0 and A > 0. So the point (5/3, 5/6, −5/6) is a point of minimum.
30 K. Sreenadh

Does this substitution method always work? The answer is NO. The following
example explains

Example 9.0.1. The shortest distance from origin to x2 − z 2 = 1.

This is minimizing f (x, y, z) = x2 + y 2 + z 2 subject to the constraint x2 − z 2 = 1. Then


substituting z 2 = x2 − 1 in f , we get

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

The critical points of the function are hx = 4x = 0, hy = 2y = 0. That is, x = 0, y = 0, z 2 =


−1. But this point is not on the hyperbolic cylinder. To overcome this difficulty, we can
substitute x2 = z 2 + 1 in f and find that z = y = 0 and x = ±1. These points are on the
hyperbolic cylinder and we can check that AC − B 2 > 0, A > 0. This implies the points are
of local minimum nature.
In the substitution method, once we substitute the constraint in the minimizing function,
then the the domain of the function will be the domain of the minimizing function. Then the
critical points can belong to this domain which may not be the domain of constraints. This
is overcome by the following:
Lagrange Multiplier Method:
Imagine a small sphere centered at the origin. Keep increasing the radius of the sphere untill
the sphere touches the hyperbolic cylinder. The required smallest distance is the radius of
that sphere which touches the cylinder. When the sphere touches the cylinder, both these
surfaces has common tangent plane. So at the point of touching, both surfaces has normal
proportional.

(Above picture is taken from Thomas Calculus book). That is ∇f = λ∇g for some λ. Now
solving this equations along with g = 0 gives the points of extrema. In the above example,
Calculus lecture notes 31

taking f = x2 + y 2 + z 2 and g = x2 − z 2 − 1 = 0, we get

2xbi + 2yb k = λ(2xbi − 2z b


j + 2z b k)

This implies, 2x = 2λx, 2y = 0 2z = −2λz. x = 0 does not satisfy g = 0. So from first


equation we get λ = 1. Then 2z = −2z. That is z = 0, and y = 0. Therefore, the critical
points are (x, 0, 0). Substituting this in the constraint equation, we get x = ±1. Hence the
points of extrema are (±, 0, 0).
Caution: The Method of Lagrange multiplies gives only the points of extremum. To find
the maxima or minima one has to compare the function values at these extremum points.
Method of Lagrange multipliers with many constraints in n variables
1. Number of constraints m should be less than the number of independent variables n
say g1 = 0, g2 = 0, ....gm = 0.
m
X
2. Write the Lagrange multiplier equation: ∇f = λi ∇gi .
i=1

3. Solve the set of m + n equations to find the extremal points


m
X
∇f = λi ∇gi , gi = 0, i = 1, 2, ...m
i=1

4. Once we have extremum points, compare the values of f at these points to determine
the maxima and minima.
Example 9.0.2. Let C be the intersection of the surfaces

x2 + 4y 2 + 4z 2 = 4, x + y + z = 0

Using the Lagrange multiplier method, determine the points that are nearest and farthest from
the origin.

Solution: Problem translates into finding the extremum of the function

f (x, y, z) = x2 + y 2 + z 2

subject to the conditions

x2 + 4y 2 + 4z 2 = 4, x + y + z = 0.

This surface is closed and bounded. Hence f being a continuous function attains its global
maximum and global minimum of this surface. From the Lagrange multiplier method we get

2x = λ2x + µ, 2y = λ8y + µ, 2z = λ8z + µ. (9.1)


32 K. Sreenadh

From second and third equations of (9.1), we get

2(y − z) = 8λ(y − z) =⇒ y = z OR λ = 1/4

In case of λ = 1/4 using the first and second equations of (9.1), we get

2(y − x) = 2y − x/2 =⇒ x = 0

Then from the constraints we get



y = −z, 8y 2 = 4 =⇒ y = ±1/ 2

Therefore we get the critical points


√ √ √ √
(0, 1 2, −1/ 2), (0, −1/ 2, −1/ 2)

In case of y = z, from constraints we get

x = −2y, y 2 = 1/3

Hence we get two more critical points


√ √ √ √ √ √
(2/ 3, 1/ 3, 1/ 3), (−2/ 3, 1/ 3, 1/ 3)
√ √ √ √
Therefore the nearest points from the origin is (0, 1 2, −1/ 2), (0, −1/ 2, −1/ 2) and
√ √ √ √ √ √
farthest points are (2/ 3, 1/ 3, 1/ 3), (−2/ 3, 1/ 3, 1/ 3).

Example 9.0.3. Find the maximum and minimum of the function f (x, y) = x3 + 4y 2 on
x2 + y 2 = 1.

Here again the set of points on the circle is a closed and bounded set and the function f is
continuous on this set. Therefore f attains its maximum and minimum on the circle. Now
by Lagrange multiplier method, we get

3x2 = 2λx, 8y = 2λy

Therefore either x = 0 or x = 2λ
3 . In case of x = 0, from the constraint we get y = ±1 and
from the second equation we get λ = 4. So we get one set of points

(0, ±1)

Similarly when we solve the second equation, we get y = 0 and from the constraint we get
Calculus lecture notes 33

x = ±1. Hence we get another set of points

(±1, 0)

The case x = 2λ
3 will not give any feasible points that satisfy the constraint.(check). Therefore
we have the following extremum values

f (0, ±1) = 4, f (1, 0) = 1, f (−1, 0) = −1.

Therefore maximum of f is 4 and minimum of f is −1 on the circle x2 + y 2 = 1.

Example 9.0.4. Among all rectangular boxes with a fixed surface area of 30 sq. cms., find
the dimension of the box that has largest volume.

Let l, b and h denote the length, breadth and height, respectively, of a rectangular box.
The problem is

max V (l, b, h) = lbh


subject to 2(lb + bh + lh) = 30
l > 0, b > 0, h > 0.

The Lagrangian is
L(l, b, h, λ) = (lbh) + λ(2(lb + bh + lh) − 30).

The Lagrange multiplier equation is

∇L(l, b, h, λ) = ∇(lbh) + λ∇(lb + bh + lh − 15) = 0.

Thus, we arrive at the following set of equations:

bh + λ(b + h) = 0; lh + λ(l + h) = 0
lb − λ(l + b) = 0; lb + bh + lh = 15.
√ √ √ √ √ √
Solving these equations, we get the following two solutions ( 5, 5, 5) and (− 5, − 5, − 5).
√ √ √ 
Since l, b and h are positive, the dimension of the box with largest volume is 5, 5, 5 .

Example 9.0.5. Find the maximum and minimum of f (x, y) = 81x2 + y 2 subject to the
constraint g(x, y) = 4x2 + y 2 = 9.

Here Lagrange multiplier method yields the critical points. However taking a parametrization
of the ellipse g: x(θ) = 23 cos θ, y(θ) = 3sinθ and substituting in the function f , and applying
the second derivative test would also get the required answer.
34 K. Sreenadh

10 Applictions

Gasoline company
A petroleum company (Indiana) producing heating oil and gasoline from crude oil has the
profit function
f (x, y) = −60 + 140x + 100y − 10x2 − 8y 2 − 6xy

where x is the heating oil and y is the gasoline. Using the second derivative test we find the
optimum at the the critical point x = 5.77 and y = 4.08 and the optimal profit (maximum of
f ) =548.45.

The same company if there is a constraint on the supply of crude oil. Say during some
period they only have 200 units of crude oil and suppose crude oil (x) requires 20 liters and
(y) requires 40 liters for making each unit. Then we have the following constraint

20x + 40y = 200

The solution of unconstrained problem x = 5.77, y = 4.08 in this case does not satisfy the
constraint because it requires 20(5.77) + 40(4.08) = 278.6. However we have only 200 units
of crude oil. However solving the constrained problem we get x = 5.56, y = 2.22

Sales of a company
A company (Bounds Inc) that manufactures a product has observed through a statistical data
analysis that their sales are a function of amount of advertising in two different media: news
papers (x) and magazines (y)

f (x, y) = 200x + 100y − 10x2 − 20y 2 + 20xy

Using the second derivative test we can calculate the maximum sales at the optimum values.
By the second derivative test we find the optimal values as x = 25 and y = 15. The maximal
sales will be 3500.

Suppose the advertisement budget is restricted to 20 then what would be the maximum
sales at optimum levels (x + y = 20). We can use Lagrange multiplier method to solve the
constrained optimization problem:

maximizef (x, y) subject to x + y = 20.


Calculus lecture notes 35

11 Mamima & Minima in 3 or more variables

We recall from the above Taylor’s theorem:


! !
1 h A B
f (x + h, y + k) − f (x, y) = ∇f · (h, k) + (h, k) + o(h2 + k 2 )
2! k B C

where o(h2 + k 2 ) is such that

o(h2 + k 2 )
→ 0 as h, k → 0.
h2 + k 2

From here we see that if (x, y) is a critical point, then the sign of Left hand side depends on
the sign of second term on the Right hand side. In terms of matrices, we can say that the
second term is positive if A > 0, AC − B 2 > 0. This is the above second derivative test. Such
matrices are known as positive definite matrices. Equivalently, A matrix H is called positive
definite matrix if all its eigenvalues are positive.
This process can be now generalized to functions of n variables:
 
x1
 x2 
 
n
Let X =  ..  and let f : R → R be a sufficiently differentiable function in an open set

 .
xn
around the point X0 . Then from the Taylor’s theorem, we may write

f (X + X0 ) − f (X0 ) = ∇f (X0 ) · X + X T HX + o(∥X∥2 )

where H is the Hessian matrix given as


 
fx1 x1 fx1 x2 ··· fx1 xn
 fx2 x1 fx2 x2 ··· fx2 xn 
 
H=
 .. .. .. .. 
 . . . . 

fxn x1 fxn x2 ··· fxn xn

2
Here fxi xj = ∂x∂i ∂x
f
j
(X0 ). Similar to the second derivative test as above we may get sufficient
condition for points of local maxima and minima. For this we need

Definition 11.0.1. A symmetric matrix H is called positive definite if X T HX > 0 for all
non-zero X and is called negative definite if X T HX < 0 for all non-zero X.
Equivalently, H is positive definite if Det(Hi ) > 0 for each i = 1, 2, · · · n, where Hi is the
36 K. Sreenadh

 
h11 h12 · · · h1i
h21 h22 · · · h2i 
 
submatrix 
 .. .. .. .. 
 . . . . 

hi1 hi2 · · · hii


We have the following characterization using eigenvalues

Theorem 11.0.2. A symmetric Matrix H is positive definite if and only if all its eigenvalues
are positive.

Proof. The proof follows from the fact that symmetric matrices are diagonalizable. We leave
this as an exercise.

Remark 11.1. A symmetric matrix H is negative definite if all its eigenvalues are negative.
In case H has both negative and positive eigenvalues, then the matrix H is called indefinite.

As a consequence of these we have

Theorem 11.0.3. A critical point X0 is a point of local minimum if all eigenvalues of the
Hessian matrix H at X0 is positive. It is a point of local maximum if all its eigenvalues are
negative. If H is indefinite then X0 is a saddle point. If one of the eigenvalues is zero then
we need more information.

Example 11.0.4. Consider the the problem of finding the maximum of the function f (x, y, z) =
xyz(16 − x − y − 2z).

It is not difficult to check that the critical points are (4, 2, 2), (x, 0, 0), (0, y, 0) and (0, 0, z).
The Hessian at the points (x, 0, 0) is
 
0 0 0
0 0 16 − x2 
 

0 16 − x2 0

Without calculating all eigenvalues, we see that it has at least one zero eigenvalue. So we
cannot decide the nature of the critical points (coordinate axis in this case) using the test.
At the point (4, 2, 2) the Hessian is equal to
 
−16 −8 −16
 −8 −16 −16
 

−16 −16 −64

Now one can compute the eigenvalues of this matrix and see that all of them are nega-
tive. Therefore noting that f (x, 0, 0) = 0, f (0, y, 0)f (0, 0, z) = 0, we see that f (4, 2, 2) =
16(16 − 4 − 2 − 4) = 160 is the maximum value of the function.
Calculus lecture notes 37

References

1. G.B. Thomas, Thomas’ Calculus,

2. [Link]

3. [Link]

You might also like