Multi-Variable Calculus Lecture Notes
Multi-Variable Calculus Lecture Notes
Lecture notes
Calculus
Chapter-3
Prof. K. Sreenadh
Department of Mathematics
IIT Delhi
2 K. Sreenadh
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 .
For example,
(1). The open ball of radius δ: Bδ ((0, 0)) = {(x, y) ∈ R2 : x2 + y 2 < 1} is an open 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| < ϵ.
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
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,
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
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
Let f be a real valued function defined in a ball around (a, b). Then
In other words,
f (a + h, b + k) → f (a, b) as (h, k) → (0, 0).
Calculus lecture notes 7
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:
∂f 1
fx (a, b) = (a, b) = lim (f (a + h, b) − f (a, b)) .
∂x h→0 h
∂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.
∂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
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).
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
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
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
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
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
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 )
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
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
Example 4.0.2. Consider the function f (x, y) = x2 + y 2 + xy. Then fx (0, 0) = fy (0, 0) = 0.
Also
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
1
f (h, h) = (ϵ1 + ϵ2 )h =⇒ 2h sin = h(ϵ1 + ϵ2 ).
h
p
Example 4.0.4. Show that the function f (x, y) = |xy| is not differentiable at the origin.
0−0
fx (0, 0) = lim = 0, and similar calculation shows fy (0.0) = 0
h→0 h
f (h, k) = ϵ1 h + ϵ2 k.
Taking h = k, we get
|h| = (ϵ1 + ϵ2 )h.
Notations:
∆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:
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
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
′
ϕ(b + k) − ϕ(b) = kϕ (b + θk), 0 < θ < 1
= kfy (a + h, b + θk)
Now, if we write
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,
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
There are continuous functions for which directional derivatives exist in any direction, but
the function is not differentiable. For example,
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
∂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
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
∆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̂.
///
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 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
1
(⃗r(t + ∆t) − ⃗r(t))
∆t
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 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.
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
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:
2(x − 1) + 4(y − 2) + (z − 4) = 0
///
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
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,
M
|E(x, y)| ≤ (|x − a| + |y − b|)2 .
2
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).
So
L(x, y) = 8 + 4(x − 3) − (y − 2) = 4x − y − 2
22 K. Sreenadh
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
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.
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
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
1
∆f = (∆ρ)2 −m2 + 2α∆ρ
2
1
∆f = (∆ρ)2 (A + 2α∆ρ) > 0.
2
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.
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,
∂f ∂f
= 0, = 0.
∂x ∂y
Figure 13:
Figure 14:
Example 7.0.5. Find the critical points and their nature for the function f (x, y) = x3 +
3xy + y 3 .
Critical points:
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:
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.
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
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
(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
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.
f (x, y, z) = x2 + y 2 + z 2
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
In case of λ = 1/4 using the first and second equations of (9.1), we get
2(y − x) = 2y − x/2 =⇒ x = 0
x = −2y, y 2 = 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
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
(±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
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
The Lagrangian is
L(l, b, h, λ) = (lbh) + λ(2(lb + bh + lh) − 30).
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
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)
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:
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
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
.. .. .. ..
. . . .
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.
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
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
2. [Link]
3. [Link]