0% found this document useful (0 votes)
2 views

Multivariable Calculus

The document covers multivariable calculus, focusing on scalar-valued functions of two variables, limits, continuity, derivatives, and optimization. It provides definitions, theorems, and examples related to these topics, including partial derivatives, gradients, and the Hessian matrix. Key concepts such as limits of functions, continuity, and the properties of derivatives are elaborated with mathematical rigor and illustrative examples.

Uploaded by

sarvathshettyyy
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)
2 views

Multivariable Calculus

The document covers multivariable calculus, focusing on scalar-valued functions of two variables, limits, continuity, derivatives, and optimization. It provides definitions, theorems, and examples related to these topics, including partial derivatives, gradients, and the Hessian matrix. Key concepts such as limits of functions, continuity, and the properties of derivatives are elaborated with mathematical rigor and illustrative examples.

Uploaded by

sarvathshettyyy
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
You are on page 1/ 23

Multivariable Calculus

Karthik Thiagarajan

1. Scalar-valued Functions of Two Variables 2


2. Limits and Continuity 2
2.1. Limits of Sequences 2
2.2. Limits of functions 3
2.3. Properties of limits 3
2.4. Continuity 4
3. Derivatives 5
3.1. Partial Derivatives 5
3.2. Gradient 5
3.3. Directional Derivatives 6
3.4. Steepest Ascent and Descent 7
3.5. Second Order Partial Derivatives 8
4. Tangents 11
4.1. Tangent Lines 11
4.2. Tangent Hyperplanes 13
4.3. Best Linear Approximation 14
5. Differentiability 15
6. Optimization 16
6.1. Maxima and Minima 16
6.2. Critical Points 16
6.3. Continuous functions on Closed, Bounded Domain 17
6.4. Hessian Test 21
1. Scalar-valued Functions of Two Variables
A scalar valued function of two variables is a function f : D → R whose domain D is a
subset of R 2 and the co-domain is R. Examples of such functions:
• f(x, y) = x + y
• f(x, y) = sin(x + y)
• f(x, y) = xy e x + y

Open ball
A concept that we will use in the rest of the document is that of an open ball. An
open ball centered at a point (a, b) with radius r is the following set:

(x, y) : (x - a) 2 + (y - b) 2 < r 2
In simple terms, it is the set of all points within the circle centered at (a, b) with
radius r. Note that the boundary is not a part of an open ball. Visually:

r All points in the shaded region belong to the


open ball. Note that the boundary is given by
(a, b)
a dotted line and is not a part of the open ball.

2. Limits and Continuity

2.1. Limits of Sequences

Consider a n = 1 n . This sequence converges to 0 as n → ∞. That is, as n increases,


a n gets closer and closer to 0. We denote this as a n → 0. A sequence (a n , b n ) in R 2
1 1
converges to (a, b) if a n → a and b n → b. For instance , n sin → (0, 1). We will
n n
use this fact to define limits of functions of two variables.
2.2. Limits of functions

Definition
Consider a function f : D → R where D ⊂ R 2 . Let (a, b) ∈ D. The limit of f at
(a, b) exists if there exists a real number L such that:

(a n , b n ) → (a, b) ⟹ f(a n , b n ) → L

for all possible sequences (a n , b n ) that converge to (a, b).

For simple functions, we can just substitute the value (a, b) into the function to get the
limit. For instance:

lim e x sin(x + y) = e a sin(a + b)


(x,y) → (a,b)

This method of substituting the value is not foolproof. There is a useful theorem that
can be used to show the non-existence of limits:

Theorem
The limit of a function f at (a, b) exists and is equal to L if for every curve C in the
domain D of f passing through (a, b), the limit of f along C is exists and is equal to
L.

An example of this theorem in action:

x2 - y2
lim
(x,y) → (0,0) x2 + y2

The limit along the x-axis is 1 and the limit along the y-axis is -1. Since we have two
different limits along the two curves, the limit doesn't exist.

2.3. Properties of limits


2.3.1. Arithmetic
f and g denote two functions on a domain D. If lim f(x, y) = F and
(x,y) → (a,b)
lim g(x, y) = G, then:
(x,y) → (a,b)

• lim f(x, y) + g(x, y) = F + G


(x,y) → (a,b)

• lim (fg)(x, y) = FG
(x,y) → (a,b)

f(x, y) F
• lim = , provided G ≠ 0 and g is defined in a small interval
g(x, y)
(x,y) → (a,b) G
around (a, b).

2.3.2. Composition
Let f be a multivariable function and g be a single variable function such that g ∘ f is
defined. If lim f(x, y) = F and lim g(x) = L, then:
(x,y) → (a,b) x→F

lim (g ∘ f)(x, y) = L
(x,y) → (a,b)

2.3.3. Sandwich principle


If lim f(x, y) = L and lim g(x, y) = L, and f(x) ⩽ h(x) ⩽ g(x), we
(x,y) → (a,b) (x,y) → (a,b)
have:
lim h(x, y) = L
(x,y) → (a,b)

2.4. Continuity
A function f is continuous at the point (a, b) in its domain if the limit at the point
exists and is equal to the value of the function at that point. That is:

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


(x,y) → (a,b)
If a function is continuous at all points in its domain, it is said to be a continuous
function.

3. Derivatives

3.1. Partial Derivatives


The partial derivative of a function f with respect to x and y at the point (a, b) is
denoted by f x and f y respectively and is given as:

f(a + h, b) - f(a, b)
f x (a, b) = lim
h→0 h

f(a, b + h) - f(a, b)
f y (a, b) = lim
h→0 h

For example, f x (1, 2) for f(x, y) = x 2 + y 2 can be computed as:

( 1 + h) 2 + 2 2 - 1 2 + 2 2
f x (1, 2) = lim
h→0 h
( 1 + h) 2 - 1
= lim
h→0 h
h( 2 + h)
= lim
h→0 h
=2

f x (a, b) can be viewed as the instantaneous rate of change of f at (a, b) along the x-
axis. A similar idea holds for f y (a, b). The partial derivatives are themselves functions
of (x, y). We denote this as f x (x, y) and f y (x, y). To compute the partial derivative
with respect to x, we can view f as function of x while y remains constant, and
differentiate with respect to x. For example, if f(x, y) = x 2 + y 2 , f x (x, y) = 2x and
f y (x, y) = 2y.

3.2. Gradient
The partial derivatives can be clubbed together into a vector called the gradient:
f x (x, y)
∇f(x, y) =
f y (x, y)

2x
For example, if f(x, y) = x 2 + y 2 , ∇f(x, y) = .
2y

3.3. Directional Derivatives


Directional derivatives extend the notion of partial derivatives to any direction. The
directional derivative of f in the direction given by the unit vector u = (u 1 , u 2 ) at
(a, b) is given by f u (a, b):

f(a + hu 1 , b + hu 2 ) - f(a, b)
f u (a, b) = lim
h→0 h

f u (x, y) is again a function of x, y. As an example, if f(x, y) = xy, the directional


derivative along u = (u 1 , u 2 ) can be computed as:

f(x + hu 1 , y + hu 2 ) - f(x, y)
f u (x, y) = lim
h→0 h
(x + hu 1 )(y + hu 2 ) - xy
= lim
h→0 h
xy + xhu 2 + yhu 1 + h 2 u 1 u 2 - xy
= lim
h→0 h
= yu 1 + xu 2
Theorem

If the partial derivatives are continuous in an open ball centered at (a, b), the
directional derivative at (a, b) is defined for all directions. For any direction given by
the unit vector u = (u 1 , u 2 ), the directional derivative is given by:

f u (a, b) = ∇f(a, b) T u

Recall that u T v is just the dot product of u and v.

To see this theorem in action, for f(x, y) = xy, we have:

u1
f u (x, y) = ∇f(x, y) T
u2
u1
= y x
u2
= yu 1 + xu 2

3.4. Steepest Ascent and Descent


Since ||u|| = 1, we see that:

f u (a, b) = ∇f(a, b) T u

= ||∇f(a, b)|| ⋅ ||u|| ⋅ cos 𝜃

= ||∇f(a, b)|| ⋅ cos 𝜃

The maximum and minimum values of f u (a, b) occur when 𝜃 = 0 and 𝜃 = 180 ∘
respectively. If 𝜃 = 90 ∘ , then the directional derivative is zero. Therefore:
∇f(a, b)
• The direction of steepest ascent of the function at (a, b) is .
||∇f(a, b)||
-∇f(a, b)
• The direction of steepest descent of the function at (a, b) is .
||∇f(a, b)||

• The direction in which the function's value doesn't change at (a, b) is orthogonal
to ∇f(a, b).

Note that all these are local phenomenon. When we talk about the direction of steepest
ascent at a point (a, b), we are only concerned about the function's behavior in the
immediate vicinity of (a, b).

3.5. Second Order Partial Derivatives


The second order partial derivatives are given below:

∂ ∂f ∂2f
f x x = (f x ) x = =
∂x ∂x ∂x 2

∂ ∂f ∂2f
f yy = (f y ) y = =
∂y ∂y ∂y 2

∂ ∂f ∂2f
f xy = (f x ) y = =
∂y ∂x ∂y∂x

∂ ∂f ∂2f
f yx = (f y ) x = =
∂x ∂y ∂x∂y

f xy and f yx are called mixed partial derivatives.

Theorem

Let f be a function defined on a domain D with a point (a, b) and an open ball
around it contained in D. If the second order partial derivatives are continuous in an
open ball around (a, b), then f xy (a, b) = f yx (a, b).

All the second order partial derivatives can be collected in a matrix termed the Hessian
matrix:

f xx f xy
H=
f yx f yy

If the theorem above holds, H is a symmetric matrix. For a function of three variables,
the Hessian will be a square matrix of order three:

f xx f xy f xz
H = f yx f yy f yz
f zx f zy f zz

Question
Find all partial derivatives up to order 2 at (0, 0).

xy x 2 - y 2
f(x, y) = 2 2
, (x, y) ≠ (0, 0)
x +y
0, (x, y) = (0, 0)

For (x, y) = (0, 0):

f(h, 0) - f(0, 0)
f x (0, 0) = lim =0
h→0 h

f(0, h) - f(0, 0)
f y (0, 0) = lim =0
h→0 h

For (x, y) ≠ (0, 0):

x2 + y2 3x 2 y - y 3 - 2x 2 y x 2 - y 2
f x (x, y) = 2
x2 + y2

x 4 y + 4x 2 y 3 - y 5
= 2
2 2
x2 + y2
Therefore:

y x 4 + 4x 2 y 2 - y 4
, (x, y) ≠ (0, 0)
f x (x, y) = 2
x2 + y2
0, (x, y) = (0, 0)

f x (h, 0) - f x (0, 0)
f xx (0, 0) = lim =0
h→0 h

f x (0, h) - f x (0, 0) -h 5
f xy (0, 0) = lim = lim 5
= -1
h→0 h h→0 h

Similarly, we compute f y (x, y):

x x 4 - 4x 2 y 2 - y 4
, (x, y) ≠ (0, 0)
f y (x, y) = 2 2
x2 + y
0, (x, y) = (0, 0)

This gives us f yy (0, 0) = 0 and f yx (0, 0) = 1.

NOTE: IGNORE FOR END-TERM, CAN BE CONFUSING

During the live session, there was a mistake in the expression for f y (x, y). This is
what was being attempted. One way to quickly compute f y (x, y) is to note the
following relationship:
f(x, y) = -f(y, x)
⟹ f y (x, y) = -f y (y, x)
f y (y, x) is the partial derivative of f with respect to the first variable. Therefore,
this is the same as partial derivative of f(x, y) with respect to x, and then
swapping the variables x and y. Therefore, we have f y (y, x) = f x (y, x). This
gives us:
f y (x, y) = - f x (y, x)
f y ( , y) f x (y, )

4. Tangents
For all subsections, consider a function f defined on a domain D ⊂ R 2 that has
continuous partial derivatives in an open ball centered at the point (a, b) ∈ D. The
existence of continuous partial derivatives implies that the directional derivative exists in
all directions and is given by:
f u (a, b) = ∇f(a, b) T u

4.1. Tangent Lines


The tangent line to a function f at the point (a, b) in the direction of the unit vector
u = (u 1 , u 2 ) is given by the following equivalent forms:

Form-1
(a, b, f(a, b)) + t(u 1 , u 2 , f u (a, b))

(a, b, f(a, b)) + span{(u 1 , u 2 , f u (a, b))}

Form-2
x = a + tu 1
y = b + tu 2
z = f(a, b) + tf u (a, b)
Form-3
x-a y-b z - f(a, b)
= =
u1 u2 f u (a, b)

The tangent line is an affine subspace of R 3 .


Question
Find the tangent line to the function f(x, y) = xy at the point (1, 3) in the
1 1
direction , .
2 2

1 1
(1, 3, f(1, 3)) + t , , f u (1, 3)
2 2

1/ 2 4
f u (1, 3) = 3 1 =
1/ 2 2

1 1
The tangent line at the point (1, 3) to f in the direction , is given by:
2 2

1 1 4
(1, 3, 3) + t , ,
2 2 2

Alternatively:

t
x = 1+
2
t
y = 3+
2
4t
z = 3+
2
Alternatively:

x-1 y-3 z-3


= =
1/ 2 1/ 2 4/ 2
4.2. Tangent Hyperplanes

The tangent plane to the function at (a, b) is given by:

Form-1
z = f(a, b) + f x (a, b)(x - a) + f y (a, b)(y - b)

Form-2

(a, b, f(a, b)) + {(x, y, z) : f x (a, b)x + f y (a, b)y - z = 0 }

Form-3

x-a
z = f(a, b) + ∇f(a, b) T
y-b

The vector (f x (a, b), f y (a, b) - 1) is orthogonal to the tangent plane.


Question
Find the tangent plane to the function f(x, y) = 9 - x 2 - y 2 at the point (1, 2).

z - f(1, 2) = f x (1, 2)(x - 1) + f y (1, 2)(y - 2)

(-2x) -x -1 -1
fx = = = =
2 9 - x2 - y2 9 - x2 - y2 2 2
(-2y) -y -2
fy = = = = -1
2 9 - x2 - y2 9 - x2 - y2 2

-1
z-2 = (x - 1 ) - (y - 2 )
2

The equation of the tangent plane at (1, 2) to f is:

x + 2y + 2z = 9

4.3. Best Linear Approximation


The best linear approximation to the function at (a, b) is given by L f (x, y)| (a,b) :

x-a
L f (x, y)| (a,b) = f(a, b) + ∇f(a, b) T
y-b
Expanding it, we get:

L f (x, y)| (a,b) = f(a, b) + f x (a, b)(x - a) + f y (a, b)(y - b)


Question
Find the best linear approximation to f at (0, 0) where, f(x, y) = e x sin y + xe x .

x-a
L f (x, y)| (0,0) = f(a, b) + ∇f(a, b) T
y-b

f(0, 0) = 0

e x (sin y + x + 1) 1
∇f(x, y) = =
e x cos y 1

L f (x, y)| (0,0) = x + y

5. Differentiability
Consider a function f defined on a domain D ⊂ R 2 . Let f x and f y be defined at
(a, b) ∈ D. Then, f is differentiable at (a, b) ∈ D if:

f(a + h 1 , b + h 2 ) - f(a, b) - f x (a, b)h 1 - f y (a, b)h 2


lim =0
(h 1 ,h2 ) → (0,0)
h 12 + h 22

This is equivalent to:


• The tangent plane to f exists at (a, b).
• The best linear approximation to f exists at (a, b).

Intuitively, this means that very close to the point (a, b) f looks like a plane (behaves
like a linear function).
Theorem
If the partial derivatives exist in an open ball at (a, b) and are continuous, then f is
differentiable at (a, b).

6. Optimization
Consider a function defined over D ⊂ R 2 and a point (a, b) ∈ D with an open ball
centered at (a, b) that is contained in D.

6.1. Maxima and Minima

• A point (a, b) is called a local minimum of f if f(x, y) ⩾ f(a, b) for all (x, y) in
an open ball centered at (a, b).
• A point (a, b) is called a local maximum of f if f(x, y) ⩽ f(a, b) for all (x, y) in
an open ball centered at (a, b).
• A point (a, b) is called a absolute minimum of f if f(x, y) ⩾ f(a, b) for all (x, y)
in the domain of f.
• A point (a, b) is called a absolute maximum of f if f(x, y) ⩽ f(a, b) for all
(x, y) in the domain of f.

A point that is a maximum or a minimum is called an extremum.

6.2. Critical Points

Consider a function f with domain D ⊂ R 2 . A point (a, b) is a critical point of f if


one of two things happen:
• The gradient of f is not defined at (a, b).
• The gradient of f is zero.

For example, consider f(x, y) = x 2 + 6xy + 4y 2 + 2x - 4y.

f x (x, y) = 2x + 6y + 2 = 0
⟹ (x, y) = (2, -1)
f y (x, y) = 8y + 6x - 4 = 0
(2, -1) is a critical point of f.

Theorem
If a point (a, b) is a local extremum, then ∇f(a, b) = 0.

To see why this is true, consider what happens if ∇f(a, b) ≠ 0. The function's value
would increase along the direction ∇f(a, b) and decrease along -∇f(a, b) suggesting
that (a, b) is not an extremum. This is a loose argument. For a more concrete
argument, consider the slice of the function along y = b and note that for the
corresponding single variable function in terms of x, x = a is an extremum, which
implies that f x (a, b) = 0.

Every local extremum is a critical point. All critical points are not local extrema. A
point which is a critical point but not a local extremum is called a saddle point. An
example is the function f(x, y) = xy. This function has a critical point at (0, 0), but
this is neither a local maximum nor a local minimum. The function has a minimum
along y = x and a maximum along y = -x.

6.3. Continuous functions on Closed, Bounded Domain


A set D ⊂ R 2 is
• closed if it contains all its boundary points
• bounded if it is contained within a ball around 0 with finite radius.

An example of a closed, bounded domain is a square that contains its boundary:

{(x, y) : 0 ⩽ x ⩽ 2, 0 ⩽ y ⩽ 2 }

An example of a domain that is bounded but not closed is a square that doesn't contain
its boundary:

{(x, y) : 0 < x < 2, 0 < y < 2 }

Visually:
Open, Bounded Closed, Bounded

Theorem
Consider a continuous function f on a domain D that is closed and bounded. Then f
has a global maximum and global minimum on D.

The maximum and minimum could be one of these points:


• A point in the interior of D.
• A point on the boundary of D.

Question
Find the global maximum and minimum of the function f(x, y) = x 2 + y 2 on the
closed triangular plate bounded by the lines x = 0, y = 0, y = 2x + 2 in the second
quadrant.

Step-1: Critical points

∇f(x, y) = (2x, 2y)

(0, 0) is the only critical point and is one of the candidates for global
maximum/minimum.

Step-2: Graph the region

1
-2 -1 0 1 2 3 4

Step-3: Check the boundaries

Boundary-1: x = 0

h(y) = f(0, y) = y 2

Check for (0, 0) and (0, 2).

Boundary-2: y = 0

h(x) = f(x, 0) = x 2

Check for (0, 0) and (-1, 0).

Boundary-3: y = 2x + 2

h(x) = f(x, 2x + 2) = x 2 + (2x + 2) 2 = 5x 2 + 8x + 4

Note that h is defined in the interval [-1, 0]. In this interval, the global maximum of
h can be a critical point or one of the boundary points.

-4
h′ (x) = 0 ⟹ 10x + 8 = 0 ⟹ x =
5

Check for (-4 / 5, 2 / 5), (-1, 0) and (0, 2).

(a, b) f(a, b)

(0, 0) 0

(0, 2) 4

( )
(-1, 0) 1

(-4 / 5, 2 / 5) 4
5

Therefore, the global maximum of f is 4 at (0, 2) and the global minimum is 0 at


(0, 0).

Aside

D is the triangular region mentioned above:

f:D→R

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

What is f x (0, 0)?

-2 -1 0 1 2 3 4

f(0 + h, 0) - f(0, 0) h2 - 0
f x (0, 0) = lim = lim- =0
-
h→0 h h→0 h

f(0, 0 + h) - f(0, 0) h2 - 0
f y (0, 0) = lim = lim+ =0
+
h→0 h h→0 h
6.4. Hessian Test
The Hessian test can be used to determine the nature of the critical point. The test
may fail to be conclusive in certain situations.

6.4.1. Two variables


Consider a function f defined on D ⊂ R 2 which has a critical point at (a, b) ∈ D with
continuous first and second order partial derivatives in an open ball centered at (a, b).
Let H be the Hessian at (a, b) and let f xx , f yy , f xy , f yx denote the second order
partial derivatives at (a, b):

• If |H| > 0 and f xx > 0, (a, b) is a local minimum.


• If |H| > 0 and f xx < 0, (a, b) is a local maximum.
• If |H| < 0, (a, b) is a saddle point.
• If |H| = 0, the test is inconclusive.

Here |H| denotes the determinant of H.

6.4.2. Three variables

Consider a function f defined on D ⊂ R 3 which has a critical point at (a, b, c) ∈ D


with continuous first and second order partial derivatives in an open ball centered at
(a, b, c). Let H be the Hessian at (a, b, c) and let f xx , f yy , f zz , f xy , f yz , f zx denote
the second order partial derivatives at (a, b, c):

2
• If |H| > 0, f xx > 0 and f xx f yy - f xy > 0, then (a, b, c) is a local minimum.
2
• If |H| < 0, f xx < 0 and f xx f yy - f xy > 0, then (a, b, c) is a local maximum.
• If |H| ≠ 0 and the above two cases do not occur, then (a, b, c) is a saddle point.
• If |H| = 0, the test is inconclusive.

Here |H| denotes the determinant of H. Visually, this test involves the determinants of
three matrices:

f xx f xy f xz f xx f xy f xz f xx f xy f xz
f yx f yy f yz , f yx f yy f yz , f yx f yy f yz
f zx f zy f zz f zx f zy f zz f zx f zy f zz
f xx 2 |H|
f xx f yy - f xy Outcome

+ + + Local minimum

- + - Local maximum

For additional reading, lookup Sylvester's theorem in Wikipedia.


Question
Find all the points of local extrema for the function f(x, y) = x 3 - 3x + y 3 - 3y 2 .

f x (x, y) = 3x 2 - 3 = 0
2
⟹ x = ± 1, y = 0, 2
f y (x, y) = 3y - 6y = 0

This function has 4 critical points, namely:

(1, 0), (1, 2), (-1, 0), (-1, 2)

f xx = 6x f xy = 0
f yx = 0 f yy = 6y - 6

6x 0
H=
0 6y - 6

(a, b) f xx = 6x |H| = 36x(y - 1) Outcome

(1, 0) 6 -36 Saddle point

(1, 2) 6 36 Local minimum

(-1, 0) -6 36 Local maximum

(-1, 2) -6 -36 Saddle point

You might also like