Multivariable Knill 2022
Multivariable Knill 2022
MATH S-21A
Lecture
1.1. A point on the real line R is determined by a single real coordinate x. Zero 0
divides the positive axis from the negative axis. A point P = (x, y) in the plane
R2 is fixed by two coordinates x and y. In space R3 , locating a point needs three
coordinates P = (x, y, z). The third coordinate z is usually interpreted as height, the
distance from the xy-plane. The signs define four quadrants in R2 or eight octants in
R3 . These regions all intersect at the origin O = (0, 0) or O = (0, 0, 0) and are bound
by coordinate axes {y = 0} and {x = 0} or coordinate planes {x = 0}, {y =
0}, {z = 0}.
1.2. In R2 , we usually orient the x-axis to point “east” and the y-axis point “north”.
In R3 , a common view is to see the xy-plane as the “ground” and to imagine the
z-coordinate axis pointing “up”. A photographic coordinate system appears in
computer graphics or photography, where the xy-plane is the retina or film plate and
the z-coordinate measures the distance towards the viewer.
1.3. The Euclidean distance between two points P = (x, y, z) and Q = (a, b, c) in
space is defined as
p
Definition: d(P, Q) = (x − a)2 + (y − b)2 + (z − c)2 .
1.4. The points A = (1, 1, 0), B = (1, 0, 1), C = (0, 1, 1) define an equilateral trian-
gle in space because all distances d(A, B), d(B, C) and d(A, C) are equal. The points
A = (275, 0, 0), B = (0, 252, 0), C = (0, 0, 240) define a triangle, in which all sides have
integer length. You will encounter this triangle in a homework.
1.5. The distance formula is a definition, not a result. It is motivated by the theo-
rem of Pythagoras. We will prove the Pythagorean theorem later. This distance is
defined pin any dimension. In the plane for example, the distance of the point (x, y) to
(a, b) is (x − a)2 + (y − b)2 . When working in R2 , we do not think of it as part of R3 .
Coordinates work in arbitrary dimensions. A collection of n data points defines a vec-
tor in Rn . The Euclidean space Rn appears in data science as n real data points can
be seen as a vector. The Euclidean distance Pn between2 two data points x = (x1 , . . . , xn )
2
and a = (a1 , . . . , an ) is then d(x, a) = k=1 (xk −ak ) . The sum of the squares appears
in statistics, like in least square problems.
Multivariable Calculus
1.6. Points, curves, surfaces and solids are geometric objects which can be de-
scribed with functions of several variables. An example of a curve is a circle, an
example of a surface is a sphere, an example of a solid is the ball, the region enclosed
by a sphere.
Examples
1.8. P = (−1, −3) is in the third quadrant of the plane and P = (2, 4, 3) is in the
positive octant of space. The point (0, 0, −8) is located on the negative z axis. The
point P = (4, 5, −3) is below the xy-plane. Can you spot the point Q on the xy-plane
which is closest to P ?
1.9. Problem: Find the midpoint M on the line segment connecting P = (1, 2, 5)
and Q = (−3, 4, 7) and verify that d(P, M ) + d(Q, M ) = d(P, Q). Answer: The
point
√ we are looking
√ for is the average
√ M = (P +√Q)/2. The distances
√ are d(P, Q) =
2 2 2 2 2 2 2 2 2
√4 + 2 + 2 = 24, d(P, M ) is 2 + 1 + 1 = 6. and d(Q, M ) is 2 + 1 + 1 =
6. Indeed d(P, M ) + d(M, Q) = d(P, Q).
1.12. Draw the unit circle of the quartic distance d(x, y) = (x − a)4 + (y − b)4 . More
generally, for any p > 1, we get a distance d(x, y) = (x−a)p +(y−b)p . For p = 1, it is the
taxi metric, for t = 2 it is the Euclidean metric, for t → ∞ it goesp to the p distance
max(|x−a|, |y−b|) which is the l∞ metric. Problem: is d(P, Q) = |x − a|+ |y − b|
a distance? Answer: no, while it satisfies d(P, Q) = d(Q, P ) and is zero if and only
if P = Q, it does not satisfy the triangle inequality d(A, B) + d(B, C) ≥ d(A, C).
We call a space (X, d) for which d is a distance formula satisfying d(P, Q) = d(Q, P ),
d(P, Q) = 0 ↔ P = Q and d(A, B) + d(B, C) ≥ d(A, C) a metric space.
1.13. Problem: Find an algebraic expression for the set of all points for which the
sum of thepdistances to A =p (1, 0) and B = (−1, 0) is equal to 3. Answer: Square the
equation (x − 1) + y + (x + 1)2 + y 2 = 3, separate the remaining single square
2 2
root on one side and square again. Simplification gives 20x2 + 36y 2 = 45 which is
2 2
equivalent to xa2 + yb2 = 1, where a, b can be computed as follows: because P = (a, 0)
satisfies this equation, d(P, A) + d(P, B) = (a − 1) + (a + 1) = 3 so √ that a = 3/2.
Similarly,
√ the point Q = (0, b) satisfying it gives d(Q, A) + d(P, B) = 2 b2 + 1 = 3 or
b = 5/2.
1.15. The method of completion of squares is due to Al-Khwarizmi who lived from
780-850 and used it as a method to solve quadratic equations. Even so Al-Khwarizmi
worked with numerical examples, it is one of the first important steps of algebra. His
work ”Compendium on Calculation by Completion and Reduction” was dedicated to
the Caliph al Ma’mun, who had established research center called ”House of Wisdom”
in Baghdad. 2
1.16. The Euclidean geometry described is only one of many geometries. One can
work with more general metric spaces. An important class of metric spaces are
studied in Riemannian geometry, where the distance between two points can become
dependent on where we are. Space becomes curved. This is the frame work of general
relativity. Formally, this can happen by changing the coefficients E, G of the metric
d(P, Q)2 = E(x − a)2 + G(y − b)2 . One a sphere, where x = θ ∈ [0, 2π] is longitude and
y = ϕ ∈ [0, π] is latitude, one would take E = sin2 (y), G = 1. Two points on the arctic
circle with fixed longitude have shorter distance than two points on the equator with
the same fixed longitudes. It is important to think now of the surface of the sphere as
a space itself, without its embedding in the ambient space. This space is curved. Our
four dimensional space-time universe is curved depending on the matter distribution.
1An entertaining read is “Descartes secret notebook” by Amir Aczel which deals with an other
discovery of Descartes.
2The book ”The mathematics of Egypt, Mesopotamia, China, India and Islam, by Ed Victor Katz,
page 542 contains translations of some of this work.
Multivariable Calculus
Homework
This homework is due on Tuesday, 6/28/2022.
Problem 1.4: The figure shows two rectangles of area 64 and 65 made
up of matching pieces. What is going on?
Figure 1. The 3-4-5 triangle and the Curry missing square paradox.
MATH S-21A
Lecture
2.1.
Two points P = (a, b, c) and Q = (x, y, z) in space R3 define a vector ⃗v =
x−a
y − b . We write this column vector also as a row vector [x − a, y − b, z − c] in
z−c
order to save space. As the vector starts at P to Q we write ⃗v = P⃗Q. The real numbers
numbers p, q, r in ⃗v = [p, q, r] are called the components of ⃗v .
2.2. Vectors can be attached to any point in space. Two vectors with the same compo-
nents are considered equal as they can be translated into each other. If a vector ⃗v starts
at the origin O = (0, 0, 0), then ⃗v = [p, q, r] heads from O to the point P = (p, q, r).
One can therefore identify points P = (a, b, c) with vectors ⃗v = [a, b, c] attached to
the origin. For clarity reasons, we often draw an arrow⃗ on top of a vector variable
and if ⃗v = P⃗Q then P is the “tail” and Q is the “head” of the vector. To distinguish
vectors from points, it is custom to write [2, 3, 4] for vectors and (2, 3, 4) for points. 1
2.3.
Definition: The sum of two vectors is ⃗u +⃗v = [u1 , u2 ]+[v1 , v2 ] = [u1 +v1 , u2 +
v2 ]. The scalar multiple is λ⃗u = λ[u1 , u2 ] = [λu1 , λu2 ]. The difference ⃗u − ⃗v
can best be seen as the addition of ⃗u and (−1) · ⃗v .
2.4. The vectors ⃗i = [1, 0, 0], ⃗j = [0, 1, 0], ⃗k = [0, 0, 1] are called standard basis
vectors. This has historically grown because the dot and cross product have grown
from quaternions which are points (t, x, y, z) in R4 , usually written as q = t + ix +
jy + kz.
1Please avoid the Stewart notation ⟨p, q, r⟩. It is not used in advanced mathematics. Programming
languages like Python use [p, q, r]. Mathematica, Perl or C use the notation {p, q, r}.
Multivariable Calculus
2.5.
Definition: The length |⃗v | of a vector ⃗v = P⃗Q is defined as the distance
d(P, Q) from P to Q. A vector of length 1 is called a unit vector. If ⃗v ̸= ⃗0,
then ⃗v /|⃗v | is called a direction of ⃗v . The only vector of length 0 is the zero
vector ⃗0 = [0, 0, 0].
2.6.
Definition: The dot product of two vectors ⃗v = [a, b, c] and w
⃗ = [p, q, r] is
defined as ⃗v · w
⃗ = ap + bq + cr.
2.7. Different notations for the dot product are used in different mathematical fields.
While mathematicians write ⃗v · w ⃗ or ⟨⃗v , w⟩,
⃗ or (⃗v , w) ⃗ the Dirac notation ⟨⃗v |w⟩
⃗ is used
in quantum mechanics. The Einstein notation vi wi or more generally gij v i wj is used
in general relativity. In statistics, it is called the covariance Cov[v, w] of centered
data. The dot product is also called scalar product or inner product. It could
be generalized. Any product g(v, w) which is bi-linear (linear both in v and w) and
satisfies the symmetry g(v, w) = g(w, v) and g(v, v) ≥ 0 and g(v, v) = 0 if and only if
v = 0, can be used as a dot product. An example is g(v, w) = 2v1 w1 + 3v2 w2 + 5v3 w3 .
2.8. The dot product determines distances and distances determine the dot product.
Proof:√ Write v = ⃗v . Using the dot product one can express the length of v as
|v| = v · v. On the other hand, from (v + w) · (v + w) = v · v + w · w + 2(v · w) can
be solved for v · w:
v · w = (|v + w|2 − |v|2 − |w|2 )/2 .
Theorem: |⃗v · w|
⃗ ≤ |⃗v ||w|.
⃗
Proof. If |w| = 0, the statement holds because both sides are zero. Otherwise, assume
|w| = 1 by dividing the equation by |w|. Now plug in a = v · w into the equation
0 ≤ (v −aw)·(v −aw) to get 0 ≤ (v −(v ·w)w)·(v −(v ·w)w) = |v|2 +(v ·w)2 −2(v ·w)2 =
|v|2 − (v · w)2 which means (v · w)2 ≤ |v|2 . □
2.10. Having established this, it is possible to give a definition of what an angle is,
without the need to refer to any geometric pictures:
2.11. The Al Kashi theorem gives the third side length c of a triangle ABC in terms
of the sides a = d(A, C), b = d(B, C) and α, the angle located at the vertex A.
Proof. |⃗u +⃗v |2 = (⃗u +⃗v )·(⃗u +⃗v ) = ⃗u2 +⃗v 2 +2⃗u ·⃗v ≤ ⃗u2 +⃗v 2 +2|⃗u ·⃗v | ≤ ⃗u2 +⃗v 2 +2|⃗u|·|⃗v | =
(|⃗u| + |⃗v |)2 . □
Proof. (⃗v − w)
⃗ · (⃗v − w)
⃗ = ⃗v · ⃗v + w
⃗ ·w
⃗ + 2⃗v · w
⃗ = ⃗v · ⃗v + w
⃗ · w.
⃗ We usually write this
as a2 + b2 = c2 . □
2.14.
·w
Definition: The vector P(⃗v ) = |⃗vw| ⃗
⃗ 2
w
⃗ is called the projection of ⃗v onto w.
⃗ The
⃗v ·w
⃗
scalar projection |w| ⃗
is a signed length of the vector projection. Its absolute
value is the length of the projection of ⃗v onto w. ⃗ The vector ⃗b = ⃗v − P (⃗v ) is a
vector orthogonal to the w-direction.
⃗
2.15. The projection allows to visualize the dot product. The absolute value of the
dot product is the length of the projection. The dot product is positive if ⃗v points
more towards to w,⃗ it is negative if ⃗v points away from it. In the next class, we use
the projection to compute distances between various objects.
Examples
2.16.√For example, with ⃗v = [0, −1, 1], w
⃗ = [1, −1, 0], P(⃗v ) = [1/2, −1/2, 0]. Its length
is 1/ 2.
2.17. The RGB color space consists of triples ⃗v = [r, g, b] describing the amount of
red, green and blue of a color. An other coordinate system is the CMY color space
consisting of triples ⃗v = [c, m, y] = [1 − r, 1 − g, 1 − b], where c is cyan, m is magenta
and y is yellow.
2.18. In physics, forces and fields F⃗ are described by vectors. The velocity of a curve
r(t) = [x(t), y(t), z(t)] is a vector attached to the point r(t). We will come to this.
Multivariable Calculus
2.19. In probability theory, data are described by vectors. One calls them also ran-
dom variables. It is in statistics, where higher dimensional spaces appear. In statis-
tics, ⃗v · w
⃗ is the covariance and cos(α) = (⃗v · w)/(|⃗
⃗ v ||w|)
⃗ is the correlation.
Homework
This homework is due on Tuesday, 6/28/2022.
Problem 2.5: a) Find the angle between the main diagonal of the unit
cube and one of the face diagonals. Assume that both diagonals pass
through a common vertex.
b) Find the vector projection of the main diagonal ⃗v = [1, 1, 1] onto the
side diagonal w
⃗ = [1, 1, 0].
c) Find the maximal distance between the 16 points (±1, ±1, ±1, ±1) of
a tesseract.
MATH S-21A
Lecture
⃗ = [w1 , w2 ] in the plane R2
3.1. The cross product of two vectors ⃗v = [v1 , v2 ] and w
is the scalar ⃗v × w
⃗ = v1 w2 −
v2 w1 . One can remember this as the determinant of a
v1 v2
2 × 2 matrix A = , the product of the diagonal entries minus the product
w1 w2
of the side diagonal entries.
3.2.
Definition: The cross product of two vectors ⃗v = [v1 , v2 , v3 ] and w
⃗ =
[w1 , w2 , w3 ] in space is defined as the vector
⃗v × w
⃗ = [v2 w3 − v3 w2 , v3 w1 − v1 w3 , v1 w2 − v2 w1 ] .
3.7. The trigonometric sin-formula relates the side lengths a, b, c and angles α, β, γ
of a general triangle:
a b c
Theorem: sin(α)
= sin(β)
= sin(γ)
.
Proof. We can express the doubled area of the triangle in three different ways:
ab sin(γ) = bc sin(α) = ac sin(β) .
Divide the first equation by sin(γ) sin(α) to get one identity. Divide the second equation
by sin(α) sin(β) to get the second identity. □
3.8. It follows from the sin-formula and the fact that sin(α) = 0 if α = 0 or α = π
that ⃗v × w
⃗ is zero if and only if ⃗v and w
⃗ are parallel, that is if either ⃗v = 0, w
⃗ =0
or ⃗v = λw
⃗ for some real λ. The cross product is a quick check to see that two vectors
are parallel or not. Note that v and −v are considered parallel even so sometimes the
notion anti-parallel is used.
3.9.
Definition: The scalar [⃗u, ⃗v , w] ⃗ = ⃗u · (⃗v × w)⃗ is called the triple scalar
product of ⃗u, ⃗v , w.
⃗ The absolute value of [⃗u, ⃗v , w]
⃗ defines the volume of the
parallelepiped spanned by ⃗u, ⃗v , w. ⃗ The orientation of three vectors is defined
as the sign of [⃗u, ⃗v , w].
⃗ It is positive if the three vectors define a right-handed
coordinate system. It is zero if the vectors are in one plane.
3.10. We have defined volume and orientation using dot and cross product. Why does
this fit with our intuition? The value h = |⃗u · ⃗n|/|⃗n| is the height of the parallelepiped
if ⃗n = (⃗v × w)
⃗ is a normal vector to the ground parallelogram of area A = |⃗n| = |⃗v × w|. ⃗
The volume of the parallelepiped is hA = (⃗u · ⃗n/|⃗n|)|⃗v × w| ⃗ which simplifies to ⃗u · ⃗n =
|(⃗u · (⃗v × w)|
⃗ which is the absolute value of the triple scalar product. The vectors ⃗v , w ⃗
and ⃗v × w ⃗ form a right handed coordinate system. If the first vector ⃗v is your
thumb, the second vector w ⃗ is the pointing finger then ⃗v × w
⃗ is the third middle finger of
⃗ ⃗ ⃗ ⃗ ⃗
the right hand. For example, the vectors i, j, i × j = k form a right handed coordinate
system. Since the triple scalar product is linear with respect to each vector, we also see
that volume is additive. Adding two equal parallelepipeds together for example gives
a parallelepiped with twice the volume.
Examples
3.11. Problem: Find the volume of the parallelepiped which has the vertices O =
(1, 1, 0), P = (2, 3, 1), Q = (4, 3, 1), R = (1, 4, 1). Answer: the solid is spanned by the
⃗ = [0, 3, 1]. We get ⃗v × w
vectors ⃗u = [1, 2, 1], ⃗v = [3, 2, 1], and w ⃗ = [−1, −3, 9] and
⃗u · (⃗v × w)
⃗ = 2. The volume is 2.
3.12. Problem: Two apples have the same shape and mass density, but one has a
3 times larger diameter. What is their weight ratio? Answer. For a cuboid spanned
by [a, 0, 0] [0, b, 0] and [0, 0, c], the volume is the triple scalar product abc. If a, b, c
are all tripled, the volume gets multiplied by a factor 27. Now cut each apple into
parallelepipeds, the larger one with slices 3 times as large too. Since each of the larger
pieces has 27 times the volume of the smaller, also the apple is 27 times heavier!
3.14. Problem. The scanner now detects an other point A = (1, 1, 1). On which
side of the triangle is it located if the cross product of P⃗Q and P⃗R is considered the
up-direction. Solution. The cross product is ⃗n = [1, −3, 1]. We have to see whether
the vector P⃗A = [1, 0, 0] points into the direction of ⃗n or not. To see that, we have to
form the dot product. It is 1 so that indeed, A is ”above” the triangle. Note that a
triangle in space a priori does not have an orientation. We have to tell, what direction
is ”up”. That is the reason that file formats for 3D printing like contain the data for
three points in space as well as a vector, telling the direction.
Multivariable Calculus
Homework
This homework is due on Tuesday, 6/28/2022.
Problem 3.1: A three dimensional analogue of a right angle triangle is
a tetrahedral shape P, Q, R, O, where all angles at O are right angles. Let
us assume that O = (0, 0, 0) and P = (3, 0, 0), Q = (0, 5, 0), R = (0, 0, 7).
The 3D Pythagoras theorem stats that the sum of three triangle area
triangle squared is the area of the square of the triangle P QR. That is
|OP Q|2 + |OQR|2 + |ORP |2 = |P QR|2 . Verify it in the example, then
verify it in general for P = (a, 0, 0), Q = (0, b, 0), R = (0, 0, c).
Problem 3.4: Verify the ”BAC minus CAB” formula (due to Lagrange)
⃗a × (⃗b × ⃗c) = ⃗b(⃗a · ⃗c) − ⃗c(⃗a · ⃗b) for general vectors ⃗a, ⃗b, ⃗c in space.
MATH S-21A
Lecture
3.1. A point P = (p, q, r) and a vector ⃗v = [a, b, c] define the line
p a
L = { q + t b , t ∈ R } .
r c
The line consists of all points obtained by adding a multiple of the vector ⃗v = [a, b, c] to
⃗ = [p, q, r]. It contains the point P as well as a copy of ⃗v = P⃗Q attached
the vector OP
to P . Every vector contained in the line is necessarily parallel to ⃗v . We think about
the parameter t as “time”. At t = 0, we are at the end point P of OP ⃗ and at t = 1,
we are at the end point Q of OQ ⃗ = OP⃗ + ⃗v .
3.3. The line ⃗r = OP ⃗ + t⃗v defined by P = (p, q, r) and vector ⃗v = [a, b, c] with nonzero
a, b, c satisfies the symmetric equations
x−p y−q z−r
= = .
a b c
The reason is that each of these expressions is equal to t. These symmetric equations
have to be modified a bit one or two of the numbers a, b, c are zero. If a = 0, replace
the first equation with x = p, if b = 0 replace the second equation with y = q and if
c = 0 replace third equation with z = r. The interpretation is that the line is written
as an intersection of two planes.
3.5. If a plane contains the two vectors ⃗v and w, ⃗ then the vector ⃗n = ⃗v × w
⃗ is orthogonal
to both ⃗v and w. ⃗ ⃗ ⃗
⃗ Because also the vector P Q = OQ − OP is perpendicular to ⃗n, we
have (Q − P ) · ⃗n = 0. With Q = (x0 , y0 , z0 ), P = (x, y, z), and ⃗n = [a, b, c], this means
ax+by +cz = ax0 +by0 +cz0 = d. The plane is therefore described by a single equation
ax + by + cz = d. We have shown:
3.6. Problem: Find the equation of a plane which contains the three points P =
(−1, −1, 1), Q = (0, 1, 1), R = (1, 1, 3).
Answer: The plane contains the two vectors ⃗v = P⃗Q = [1, 2, 0] and w⃗ = P⃗R = [2, 2, 2].
The normal vector ⃗n = ⃗v × w ⃗ = [4, −2, −2] leads to the equation 4x − 2y − 2z = d.
The constant d is obtained by plugging in the coordinates of one of the points. In our
case, it is 4x − 2y − 2z = −4.
3.7. Problem: Find the angle between the planes x + y = −1 and x + y + z = 2, The
angle between the two planes ax + by + cz = d and ex + f y + gz = h is defined as
the angle between the two normal vectors ⃗n = [a, b, c] and m
⃗ = [e, f, g]. √
Answer: find the angle between ⃗n = [1, 1, 0] and m
⃗ = [1, 1, 1]. It is arccos(2/ 6).
Examples
3.8. To practice the concepts, we look at distance formulas.
|P⃗Q · ⃗n|
d(P, Σ) =
|⃗n|
is the distance between P and the plane. Proof: use the angle formula in the denomi-
nator. For example, to find the distance from P = (7, 1, 4) to Σ : 2x + 4y + 5z = 9, we
find first a a point Q = (0, 1, 1) on the plane. Then compute
|[−7, 0, −3] · [2, 4, 5]| 29
d(P, Σ) = =√ .
|[2, 4, 5]| 45
2) If P is a point in space and L is the line ⃗r(t) = Q + t⃗u, then
|(P⃗Q) × ⃗u|
d(P, L) =
|⃗u|
is the distance between P and the line L. Proof: the area divided by base length is
height of parallelogram. For example, to compute the distance from P = (2, 3, 1) to
the line ⃗r(t) = (1, 1, 2) + t(5, 0, 1), compute
√
|[−1, −2, 1] × [5, 0, 1]| |[−2, 6, 10]| 140
d(P, L) = = √ = √ .
[5, 0, 1] 26 26
3) If L is the line ⃗r(t) = Q + t⃗u and M is the line ⃗s(t) = P + t⃗v , then
|(P⃗Q) · (⃗u × ⃗v )|
d(L, M ) =
|⃗u × ⃗v |
is the distance between the two lines L and M . Proof: the distance is the length of
the vector projection of P⃗Q onto ⃗u × ⃗v which is normal to both lines. For example,
to compute the distance between ⃗r(t) = (2, 1, 4) + t(−1, 1, 0) and M is the line ⃗s(t) =
(−1, 0, 2) + t(5, 1, 2) form the cross product of [−1, 1, 0] and [5, 1, 2] is [2, 2, −6]. The
distance between these two lines is
|(3, 1, 2) · (2, 2, −6)| 4
d(L, M ) = =√ .
|[2, 2, −6]| 44
4) To get the distance between two planes ⃗n · ⃗x = d and ⃗n · ⃗x = e, then their distance
is
|e − d|
d(Σ, Π) =
|⃗n|
Non-parallel planes have distance 0. Proof: use the distance formula between point
and plane. For example, 5x + 4y + 3z = 8 and 10x + 8y + 6z = 2 have the distance
|8 − 1| 7
=√ .
|[5, 4, 3]| 50
Figure 1. The global positioning system GPS uses the fact that a
receiver can get the difference of distances to two satellites.
Multivariable Calculus
Homework
This homework is due on Tuesday, 6/28/2022.
Problem
√ 4.2: A regular
√ tetrahedron
√ has corners
√ at P√
1 = (0, 0, 6),P2 =
(0, 32, −2), P3 = (− 24, − 8, −2) and P4 = ( 24, − 8, −2). What is
the distance between two non-intersecting edges.
Problem 4.3: Find a parametric equation for the line through the point
P = (3, 1, 2) that is perpendicular to the line L : x = 1+4t, y = 1−4t, z =
8t and intersects this line in a point Q.
Problem 4.5: a) Find the distance between the point P = (3, 3, 4) and
the line 2x = 2y = 2z.
b) Parametrize the line ⃗r(t) = [x(t), y(t), z(t)] in a) and find the minimum
of the function f (t) = d(P, ⃗r(t))2 . Verify this agrees with a).
MATH S-21A
Unit 5: Functions
Lecture
5.1. Functions are a way to define geometric objects or to assign properties to a point
of a geometric object. The shape of a mountain for example can be described by a
function which assigns to every point (x, y) the height.
5.3.
Definition: The set {(x, y, f (x, y)) | (x, y) ∈ D } ⊂ R3 is the graph of f .
Graphs are surfaces which allow to visualize the function. We should not mix up the
graph of a function with the function itself. The function is a rule which assigns to
(x, y) a third number, the graph is a geometric object in three dimensional space.
Multivariable Calculus
The modern notion of function only started to appear at the beginning of the 19th cen-
tury. That the function f and the graph of f are different things matters in computer
science for example. They are implemented as different data structures. In some cases,
we know f but we do not understand the graph. An example is the zeta function
f (x, y) = |ζ(x + iy)| for which we know the function very well, can evaluate it at every
point but where we do not know the graph, especially, where its zeros are.
5.5.
Definition: The set {(x, y) | f (x, y) = c = const } is called a contour curve
or level curve of f . A collection of contour curves is a contour map.
For example, for f (x, y) = 4x2 + 3y 2 , the level curves f = c are ellipses if c > 0.
Drawing several contour curves {f (x, y) = c } simultaneously produces a contour
map of the function f .
5.6. Level curves allow to visualize and analyze functions f (x, y) without leaving the
two dimensional space. The picture below for example shows the level curves of the
function sin(xy) − sin(x2 + y). Contour curves are everywhere: they appear as iso-
bars=curves of constant pressure, or isoclines= curves of constant (wind) field direc-
tion, isothermes= curves of constant temperature or isoheights =curves of constant
height.
Examples
5.7. For f (x, y) = x2 − y 2 , the set x2 − y 2 = 0 is the union of the lines x = y and
x = −y. The set x2 − y 2 = 1 consists of two hyperbola with with their ”noses” at the
point (−1, 0) and (1, 0). The set x2 − y 2 = −1 consists of two hyperbola with their
noses at (0, 1) and (0, −1).
5.8. The function f (x, y) = 1 − 2x2 − y 2 has contour curves f (x, y) = 1 − 2x2 − y 2 = c
which are ellipses 2x2 + y 2 = 1 − c for c < 1.
2 2
5.9. For the function f (x, y) = (x2 − y 2 )e−x −y , we can not find explicit expressions
2 2
for the contour curves (x2 −y 2 )e−x −y = c. We can draw the traces curve (x, 0, f (x, 0))
or (0, y, f (0, y) or then use a computer:
p
5.10. The surface z = f (x, y) = sin( x2 + y 2 ) has concentric circles as contour curves.
5.12.
Definition: A function f (x, y) is called continuous at (a, b) if there is a
finite value f (a, b) with lim(x,y)→(a,b) f (x, y) = f (a, b). This means that for any
sequence (xn , yn ) converging to (a, b), also f (xn , yn ) → f (a, b). A function is
continuous in G ⊂ R2 if it is continuous at every point (a, b) of G.
5.13. Continuity means that if (x, y) is close to (a, b), then f (x, y) must be close to
f (a, b). Continuity for functions of more than two variables is defined in the same way.
The bad news is that continuity is not always easy to check. The good news is that in
general we do not have to worry about continuity. Lets look at some examples:
5.14. Example: For f (x, y) = (xy)/(x2 + y 2 ), we have
x2 1
lim f (x, x) = lim 2 =
x→0 x→0 2x 2
and limx→0 f (0, x) = lim(x,0)→(0,0) 0 = 0. The function is not continuous at (0, 0).
5.15. Example: The function f (x, y) = (x2 y)/(x2 +y 2 ) is better described using polar
coordinates: f (r, θ) = r3 cos2 (θ) sin(θ)/r2 = r cos2 (θ) sin(θ). We see that f (r, θ) → 0
uniformly in θ if r → 0. The function is continuous as we can extend it and extend
the value to f (0, 0) = 0. It is custom in mathematics to consider the above function
to be continuous. The reason is that there is a unique way to give a function value
Multivariable Calculus
5.19. The level surfaces of g(x, y, z) = x2 + y 2 + z 2 are spheres. The level surfaces of
g(x, y, z) = 2x2 + y 2 + 3z 2 are ellipsoids. The equation ax + by + cz = d is a plane.
With ⃗n = [a, b, c] and ⃗x = [x, y, z], we can rewrite the equation ⃗n · ⃗x = d. If a point ⃗x0
is on the plane, then ⃗n · ⃗x0 = d. so that ⃗n · (⃗x − ⃗x0 ) = 0. This means that every vector
⃗x − ⃗x0 in the plane is orthogonal to ⃗n. For f (x, y, z) = ax2 + by 2 + cz 2 + dxy + exz +
f yz + gx + hy + kz + m the surface f (x, y, z) = 0 is called a quadric.
Sphere Paraboloid Plane
Homework
This homework is due on Tuesday, 7/5/2022.
Problem 5.1: a) Plot the contour plot and graph of the function
f (x, y) = sin(x + y 2 )/(x2 + y 2 ).
2
b) Plot both the graph and the contour plot of the function f (x, y) =
sin(x2 ) + sin(y 2 ) on the region −π ≤ x ≤ π, −π ≤ y ≤ π. Try a) without a
computer, for b), you might want to use Wolfram alpha or Mathematica or a graphing calculator to
get your picture.
MATH S-21A
Lecture
6.1. There are two fundamentally different ways to describe surfaces: there are level
surfaces g(x, y, z) = c and parametrizations. What we have seen already for planes
can be done more generally for other surfaces. Let’s first look at the general setup:
6.2. Because two parameters u and v are involved, the map ⃗r is also called uv-map.
And like uv-light, it looks cool. If you like a fancy description, a parametrization is
a map from R2 to R3 . A parametrized surface is the image of the uv-map. The
domain R of the uv-map is called the parameter domain. The parametrization is
what you are doing, the surface itself is something you see. There are many different
parametrizations of the same surface.
Multivariable Calculus
Parametric surfaces can become complex. In that case, it is better to explored them
with the help of a computer. The following four examples are important building blocks
for more general surfaces.
Definition:
p A point (x, y) ̸= (0, 0) in the plane has the polar coordinates
2 2
r = x + y , θ, where θ is the angle from the positive x-axes to the point
in counter clockwise direction. For x > 0, y > 0 it is arctan(y/x). In general
(x, y) = (r cos(θ), r sin(θ)). A common choice is to take θ ∈ [0, 2π). The point
((0, −1) has then the polar coordinates (r, θ) = (1, 3π/2).
6.3. Note that the formula θ = arctan(y/x) defines the angle θ only up to an addition
of an integer multiple of π. The points (1, 2) and (−1, −2) for example have the same θ
value. In order to get the correct θ value one can could take arctan(y/x) in (−π/2, π/2],
where π/2 is the limit when x → 0+ , then add π if x < 0 or if x = 0 and y < 0.
6.4. The following figures allow you to derive the formulas. The distance to the z axes
is r = ρ sin(ϕ) and the height z = ρ cos(ϕ) can be read off by the left picture, the
coordinates x = r cos(θ), y = r sin(θ) can be seen in the right picture.
z y
ϕ ρ r
x = ρ cos(θ) sin(ϕ), θ
r
xy
y = ρ sin(θ) sin(ϕ), x
z = ρ cos(ϕ)
Examples
⃗ + s⃗v + tw
6.5. A plane has the parametrization ⃗r(s, t) = OP ⃗ and the implicit equation
ax + by + cz = d. To get from parametric to implicit, find the normal vector ⃗n = ⃗v × w.
⃗
To get from implicit to parametric, find two vectors ⃗v , w
⃗ normal to the vector ⃗n. For
example, find three points P, Q, R on the surface and form ⃗u = P⃗Q, ⃗v = P⃗R.
6.6. The sphere ⃗r(u, v) = [a, b, c] + [ρ cos(u) sin(v), ρ sin(u) sin(v), ρ cos(v)] can be
brought into the implicit form by finding the center and radius (x − a)2 + (y − b)2 +
(z − c)2 = ρ2 .
6.7. The parametrization of a graph is ⃗r(u, v) = [u, v, f (u, v)]. It can be written in
implicit form as z − f (x, y) = 0.
6.8. The surface of revolution is inpparametric form given as ⃗r(u, v) = [g(v) cos(u), g(v) sin(u), v].
It has the implicit description x2 + y 2 = r = g(z) which can be rewritten as
2 2 2
x + y = g(z) .
Homework
This homework is due on Tuesday, 7/5/2022.
Problem 6.1: Find a parametrization ⃗r(t, s) for the plane which contains
the point P = (−9, 7, 1) and the line through Q = (2, 2, 1) and R =
(1, 3, 5).
MATH S-21A
Lecture
r(t)
7.2. Curves can describe the paths of particles, celestial bodies, or other quantities
which change in time. Examples are the motion of a star moving in a galaxy, or eco-
nomical data changing in time. Here are some more places, where curves appear:
Multivariable Calculus
Definition: Any vector parallel to the velocity ⃗r ′ (t) is called tangent to the
curve at ⃗r(t).
7.3. You know from single variable, the addition rule (f + g)′ = f ′ + g ′ , the scalar
multiplication rule (cf )′ = cf ′ and the Leibniz rule (f g)′ = f ′ g + f g ′ as well as
the chain rule (f (g))′ = f ′ (g)g ′ . They generalize to vector-valued functions.
(⃗v + w)⃗ ′ = ⃗v ′ + w
⃗ ′ , (c⃗v )′ = c⃗v ′ , (⃗v · w)
⃗ ′ = ⃗v ′ · w ⃗ ′ , (⃗v × w)
⃗ + ⃗v · w ⃗ ′ = ⃗v ′ × w ⃗ ′,
⃗ + ⃗v × w
′ ′ ′
(⃗v (f (t))) = ⃗v (f (t))f (t).
7.4. The Differentiation of curves can be reversed using the fundamental theorem
′
of calculus.
R t ′ If ⃗r (t) and ⃗r(0) is known, we can figure out ⃗r(t) by integration ⃗r(t) =
⃗r(0) + 0 ⃗r (s) ds.
Assume we know the acceleration ⃗a(t) = ⃗r′′ (t) at all times as well as initial
R tvelocity
′ ′ ⃗ ⃗
and position ⃗r (0) and ⃗r(0). Then ⃗r(t) = ⃗r(0)+t⃗r (0)+ R(t), where R(t) = 0 ⃗v (s) ds
Rt
and ⃗v (t) = 0 ⃗a(s) ds.
10
[0, 1000, 2], ⃗r(0) = [0, 0, h], then ⃗r(t) = [0, 1000t, h + 2t −
10t2 /2]. 2
-2
Examples
7.5. Examples:
1) The parametrization ⃗r(t) = [1 + 2 cos(t), 3 + 5 sin(t)] is the ellipse (x − 1)2 /4 + (y −
3)2 /25 = 1. The parametrization ⃗r(t) = [cos(3t), sin(5t)] is an example of a Lissajous
curve.
2) If x(t) = t, y(t) = f (t), the curve ⃗r(t) = [t, f (t)] traces the graph of the func-
tion f (x). For example, for f (x) = x2 + 1, the graph is a parabola. 3) With
x(t) = t cos(t), y(t) = t sin(t), z(t) = t we get the parametrization of a space curve
⃗r(t) = [t cos(t), t sin(t), t] which traces a spiral on a cone x2 + y 2 = z 2 . 4) For
x(t) = 2t cos(2t), y(t) = 2t sin(2t), z(t) = 2t traces the same curve but twice as fast.
5) If P = (a, b, c) and Q = (u, v, w) are points in space, then ⃗r(t) = [a + t(u − a), b +
t(v − b), c + t(w − c)] with t ∈ [0, 1] is a line segment from P to Q. Example:
⃗r(t) = [1 + t, 1 − t, 2 + 3t] connects P = (1, 1, 2) with Q = (2, 0, 5).
6) For ⃗r(t) = [cos(t), sin(2t), 0] we get a figure 8 curve.
Homework
This homework is due on Tuesday, 7/5/2022.
Multivariable Calculus
Problem 7.3: a) Two particles travel along space curves. The first is
⃗r1 (t) = [t, t2 , t3 ] .
The second is
⃗r2 (t) = [1 + 2t, 1 + 6t, 1 + 14t] .
Do the particles collide? Do the particle paths intersect?
b) If ⃗r(t) = [cos(t), 2 sin(t), 4t], find ⃗r ′ (0) and ⃗r ′′ (0). Then compute
|⃗r ′ (0) × ⃗r ′′ (0)|/|⃗r ′ (0)|3 . We will later call this the curvature.
Problem 7.4: Find the parametrization ⃗r(t) = [x(t), y(t), z(t)] of the
curve obtained by intersecting the elliptical cylinder x2 /16 + y 2 /25 = 1
with the surface z = x2 y. Find the velocity vector ⃗r ′ (t) at the time
t = π/2.
MATH S-21A
Lecture
8.1. If ⃗r is differentiable,
Rbp then a polygon approximation justifies it. Written out, the
formula is L = a x (t) + y ′ (t)2 + z ′ (t)2 dt.
′ 2
8.3. The curvature is the length of the acceleration vector if ⃗r(t) parametrizes the
curve with constant speed 1. A large curvature at a point means that the curve is
strongly bent. Unlike the acceleration or the velocity, the curvature does not depend
on the parameterization of the curve. You “see” the curvature, while you “feel” the
acceleration. We can measure curvature at a point only if ⃗r ′ (t) is not zero.
Proof. Let s(t) be an other parametrization, then by the chain rule d/dtT (s(t)) =
T ′ (s(t))s′ (t) and d/dtr(s(t)) = r′ (s(t))s′ (t). We see that the s′ cancels in T ′ /r′ .
Multivariable Calculus
Especially, if the curve is parametrized by arc length, meaning that the velocity vector
r′ (t) has length 1, then κ(t) = |T ′ (t)|. It measures the rate of change of the unit
tangent vector.
Definition: If ⃗r(t) is a curve which has nonzero speed at t, then we can define
′
T⃗ (t) = |⃗⃗rr ′ (t) ⃗ (t) = T⃗ ′ (t) , the normal vector and
, the unit tangent vector, N
(t)| |T⃗ ′ (t)|
⃗ ⃗ ⃗
B(t) = T (t) × N (t) the bi-normal vector. The plane spanned by N ⃗ and B⃗ is
called the normal plane. It is perpendicular to the curve. The plane spanned
by T and N is called the osculating plane.
8.4. If we differentiate T⃗ (t) · T⃗ (t) = 1, we get T⃗ ′ (t) · T⃗ (t) = 0 and see that N⃗ (t) is
perpendicular to T⃗ (t). Because B ⃗ is automatically normal to T⃗ and N ⃗ , we have shown:
8.5. Here is an application of curvature: if a curve ⃗r(t) represents a wave front and
⃗n(t) is a unit vector normal to the curve at ⃗r(t), then ⃗s(t) = ⃗r(t) + ⃗n(t)/κ(t) defines
a new curve called the caustic of the curve. Geometers call it the evolute of the
original curve. To the left a caustic. The picture of John Harvard was obtained by
following level curves.
8.6. We prove this in class. Finally, lets mention that curvature is important also in
computer vision. If the gray level value of a picture is modeled as a function f (x, y)
of two variables, places where the level curves of f have maximal curvature corresponds
to corners in the picture. This is useful when tracking or identifying objects.
Examples
The arc length of the circle ⃗r(t) = [R cos(t), R sin(t)] is 2πR. The speed
|⃗r′ (t)| is constant and equal to R.
The helix ⃗r(t) = [cos(t), sin(t), t] has velocity ⃗r ′ (t)√= [− sin(t), cos(t), 1]
and constant speed |⃗r ′ (t)| = |[− sin(t), cos(t), 1]| = 2.
This curve does not have a name. But because it is constructed in such a
way that the arc length can be computed, we an call it ”opportunity”.
Find the arc length of the curve ⃗r(t) = [3t2 , 6t, t3 ] from t = 1 to t = 3.
What is the arc p length of the curve ⃗r(t) = [cos3 (t), sin3 (t)]? Answer: We
have |⃗r ′ (t)| = 3 sin2 (t) cos4 (t) + cos2 (t) sin4 (t) = (3/2)| sin(2t)|. There-
R 2π
fore, 0 (3/2) sin(2t) dt = 6.
Find the arc length of ⃗r(t) = [t2 /2, t3 /3] for −1 ≤ t ≤ 1. This cubic
2 3
curve satisfies
R √ y = x 8/9 and is an example of an elliptic curve. Be-
2 2 3/2
cause x 1 + x dx = (1 + x ) /3, the integral can be evaluated as
R1 √ R1 √ √
−1
|x| 1 + x2 dx = 2 0 x 1 + x2 dx = 2(1 + x2 )3/2 /3|10 = 2(2 2 − 1)/3.
Find the arc length of the catenary ⃗r(t) = [t, cosh(t)], where cosh(t) =
(et + e−t )/2 is the hyperbolic cosine and t ∈ [−1, 1]. We have
cosh2 (t)2 − sinh2 (t) = 1 ,
t −t
q = (e − e )/2 is the hyperbolic
where sinh(t) sine. Solution: We have
1
|⃗r ′ (t)| = 1 + sinh2 (t) = cosh(t) and −1 cosh(t) dt = 2 sinh(1).
R
Often, there is no closed formula for the arc length of a curve. For exam-
ple, the Lissajous figure ⃗r(t) = [cos(3t), sin(5t)] leads to the arc length
R 2π p 2
integral 0 9 sin (3t) + 25 cos2 (5t) dt which can only be evaluated nu-
merically.
Multivariable Calculus
The curve ⃗r(t) = [t, f (t)], which is the graph of a function f has
the velocity p ⃗r ′ (t) = (1, f ′ (t)) and the unit tangent vector T⃗ (t) =
(1, f ′ (t))/ 1 + f ′ (t)2 . After some simplification we get
3
κ(t) = |T⃗ ′ (t)|/|⃗r ′ (t)| = |f ′′ (t)|/ 1 + f ′ (t)2
p
p 3
For example, for f (t) = sin(t), then κ(t) = | sin(t)|/| 1 + cos2 (t) .
Homework
This homework is due on Tuesday, 7/5/2022.
Problem 8.1: a) Find the arc length of the curve ⃗r(t) = [t2 , 2t3 /3, 2]
from t = −2 to t = 2.
b) Find the arc length of ⃗r(t) = [4t, 4 sin(3t), 4 cos(3t), 2] with 0 ≤ t ≤ π.
Problem 8.2: Find the curvature of ⃗r(t) = [et cos(t), et sin(t), t] at the
point (1, 0, 0).
Problem 8.4: Let ⃗r(t) = [t, t2 ]. Find the equation for the caustic
⃗ (t)
⃗s(t) = ⃗r(t) + Nκ(t) . It is known also as the evolute of the curve.
MATH S-21A
Lecture
9.1. Functions of several variables one can differentiated with respect to any of the
variables:
∂
9.2. The short hand notation fx (x, y) = ∂x f (x, y) is convenient. When iterating
∂ ∂
derivatives, the notation is similar: we write for example fxy = ∂x ∂y
f . The num-
ber fx (x0 , y0 ) gives the slope of the graph sliced at (x0 , y0 ) in the x-direction. The
second derivative fxx is a measure of concavity in the x-direction. The meaning of fxy
is the rate of change of the x-slope if horizontal cut is moved along the y-axis.
9.3. The notation ∂x f, ∂y f was introduced by Carl Gustav Jacobi. Before that, Josef
Lagrange used the term “partial differences”. For functions of three or more variables,
the partial derivatives are defined in the same way. We write for example fx (x, y, z) or
fxxz (x, y, z).
9.4. Proof. Following Euler, we first look at the difference quotients and say that if
the “Planck constant” h is positive, then define fx (x, y) = [f (x + h, y) − f (x, y)]/h.
The limit h = 0, is then the usual partial derivative fx . Comparing the two sides of
the equation for fixed h > 0 shows:
9.5. Without having taken any limits we established an identity which holds for all
h > 0: the discrete derivatives fx , fy satisfy the relation fxy = fyx for any h > 0. We
could fancy it as ”quantum Clairaut” formula. If the classical derivatives fxy , fyx
are both continuous, it is possible to take the limit h → 0. The classical Clairaut’s
theorem can be seen as a “classical limit”. The quantum Clairaut holds however for
all functions f (x, y) of two variables. Not even continuity is needed. 1
9.6. An equation for an unknown function f (x, y) which involves partial derivatives
with respect to at least two different variables is called a partial differential equa-
tion. We abbreviate PDE. If only the derivative with respect to one variable appears,
it is an ordinary differential equation, abbreviated ODE.
Examples
9.7. For f (x, y) = x4 − 6x2 y 2 + y 4 , we have fx (x, y) = 4x3 − 12xy 2 , fxx = 12x2 −
12y 2 , fy (x, y) = −12x2 y + 4y 3 , fyy = −12x2 + 12y 2 and see that ∆f = fxx + fyy = 0. A
function which satisfies ∆f = 0 is also called harmonic. The equation fxx + fyy = 0
is a PDE:
Definition: A partial differential equation (PDE) is an equation for an
unknown function f (x, y) which involves partial derivatives with respect to more
than one variables.
9.8.
The wave equation ftt (t, x) = fxx (t, x) governs the motion of light or
sound. The function f (t, x) = sin(x − t) + sin(x + t) satisfies the wave
equation.
1For
a full proof of Clairaut’s theorem, see
www.math.harvard.edu/˜knill/teaching/math22a2018/handouts/lecture14.pdf .
The Burgers equation ft + f fx = fxx describes waves at the beach
√ 1 −x2 /(4t)
e
which break. The function f (t, x) = t √t 1 −x2 /(4t) satisfies the Burgers
x
1+ t
e
equation.
iℏ
The Schrödinger equation ft = f
2m xx
is used to describe a quan-
ℏ 2
tum particle of mass m. The function f (t, x) = ei(kx− 2m k t) solves the
Schrödinger equation. [Here i2 = −1 is the imaginary i and ℏ is the
Planck constant ℏ ∼ 10−34 Js.]
Can you match the graphs f (t, x) with the equations which satisfy this equation?
9.9. In all examples, we just see one possible solution to the partial differential equa-
tion. There are in general many solutions and additional initial or boundary conditions
then determine the solution uniquely. If we know f (0, x) for the Burgers equation, then
the solution f (t, x) is determined.
Multivariable Calculus
Homework
This homework is due on Tuesday, 7/12/2022.
Problem 9.3: Verify that for any real constant b, the function
−bt
f (x, t) = e sin(x + t) satisfies the driven transport equation
ft (x, t) = fx (x, t) − bf (x, t) This PDE is sometimes called the advec-
tion equation with damping b.
MATH S-21A
Lecture
10.1. In single variable calculus we have seen how to approximate functions by linear
functions:
Definition: The linear approximation of f (x) at a is the affine function
L(x) = f (a) + f ′ (a)(x − a) .
10.2. If you remember Taylor series, this is the part of the series f (x) = ∞ (k)
P
k=0 f (a)(x−
k
a) /k!, where only the k = 0 and k = 1 term are considered. We think about the linear
approximation L as a function and not as a graph because we also will look at linear
approximations for functions of three variables, where we can not draw graphs.
y=L(x)
y=f(x)
10.3. The graph of the function L is close to the graph of f at a. What about higher
dimensions?
Definition: The linear approximation of f (x, y) at (a, b) is the affine
function
L(x, y) = f (a, b) + fx (a, b)(x − a) + fy (a, b)(y − b) .
The linear approximation of f (x, y, z) at (a, b, c) is
L(x, y, z) = f (a, b, c) + fx (a, b, c)(x − a) + fy (a, b, c)(y − b) + fz (a, b, c)(z − c) .
Multivariable Calculus
Examples
10.6. What is the linear approximation of the function f (x, y) = sin(πxy 2 ) at the point
(1, 1)? Answer: We have [fx (x, y), fy (x, y)] = [πy 2 cos(πxy 2 ), 2xyπ cos(πxy 2 )] which is
at the point (1, 1) equal to ∇f (1, 1) = [π cos(π), 2π cos(π)] = [−π, −2π]. The function
is L(x, y) = 0 + (−π)(x − 1) − 2π(y − 1).
10.7. Linearization can be used to estimate functions near a point. In the previous
example,
f (1 + 0.01, 1 + 0.01) = −0.095
10.8. Here is an example in three dimensions: find the linear approximation to f (x, y, z) =
xy+yz+zx at the point (1, 1, 1). Since f (1, 1, 1) = 3, and ∇f (x, y, z) = (y+z, x+z, y+
x), ∇f (1, 1, 1) = [2, 2, 2]. we have L(x, y, z) = f (1, 1, 1) + [2, 2, 2] · [x − 1, y − 1, z − 1] =
3 + 2(x − 1) + 2(y − 1) + 2(z − 1) = 2x + 2y + 2z − 3.
√
10.9. Estimate f (0.01, 24.8, 1.02) for f (x, y, z) = ex yz.
Solution: take (x0 , y0 , z0 ) = (0, 25, 1), where f (x0 , y0 , z0 ) = 5. The gradient is
√ √ √
∇f (x, y, z) = (ex yz, ex z/(2 y), ex y). At the point (x0 , y0 , z0 ) = (0, 25, 1) the gra-
dient is the vector (5, 1/10, 5). The linear approximation is L(x, y, z) = f (x0 , y0 , z0 ) +
∇f (x0 , y0 , z0 )(x − x0 , y − y0 , z − z0 ) = 5 + (5, 1/10, 5)(x − 0, y − 25, z − 1) = 5x + y/10 +
5z − 2.5. We can approximate f (0.01, 24.8, 1.02) by 5 + (5, 1/10, 5) · (0.01, −0.2, 0.02) =
5 + 0.05 − 0.02 + 0.10 = 5.13. The actual value is f (0.01, 24.8, 1.02) = 5.1306, very
close to the estimate.
10.10. Find the tangent line to the graph of the function g(x) = x2 at the point (2, 4).
Solution: the level curve f (x, y) = y − x2 = 0 is the graph of a function g(x) = x2 and
the tangent at a point (2, g(2)) = (2, 4) is obtained by computing the gradient [a, b] =
∇f (2, 4) = [−g ′ (2), 1] = [−4, 1] and forming −4x + y = d, where d = −4 · 2 + 1 · 4 = −4.
The answer is −4x + y = −4 which is the line y = 4x − 4 of slope 4.
10.11. The Barth surface is defined as the level surface f = 0 of
f (x, y, z) = (3 + 5t)(−1 + x2 + y 2 + z 2 )2 (−2 + t + x2 + y 2 + z 2 )2
+ 8(x2 − t4 y 2 )(−(t4 x2 ) + z 2 )(y 2 − t4 z 2 )(x4 − 2x2 y 2 + y 4 − 2x2 z 2 − 2y 2 z 2 + z 4 ) ,
√
where t√= ( 5 + 1)/2 is a constant called the golden ratio. If we replace t with
1/t = ( 5 − 1)/2 we see the surface to the middle. For t = 1, we see to the right the
surface f (x, y, z) = 8. Find the tangent plane of the later surface at the point (1, 1, 0).
Answer: We have ∇f (1, 1, 0) = [64, 64, 0]. The surface is x + y = d for some constant
d. By plugging in (1, 1, 0) we see that x + y = 2.
10.12. Linearization is just the first step for more accurate approximations. One
could do quadratic approximations for example. In one dimension, one has Q(x) =
2
f (a) + f ′ (a)(x − a) + f ′′ (a) (x−a)
2!
. In two dimensions, this becomes Q(x, y) = L(x, y) +
H(a,
b)[x − a, y − b] ·
[x − a, y − b]/2, where H is the Hessian matrix H(a, b) =
fxx (a, b) fxy (a, b)
. We will see this matrix next week, when we maximize or
fyx (a, b) fyy (a, b)
minimize functions.
Homework
This homework is due on Tuesday, 7/12/2022.
6yx
Problem 10.2: Given f (x, y) = π
− cos(x). Estimate f (π + 0.01, π −
0.03) using linearization
MATH S-21A
Lecture
11.1. If f and g are functions of t, the single variable chain rule tells us that
d
dt
f (g(t)) = f ′ (g(t))g ′ (t). For example, dtd sin(log(t)) = cos(log(t))/t. The rule can be
proven by linearization of the functions f and g and verifying the chain rule in the
linear case. The chain rule is also useful:
Definition: Define the gradient ∇f (x, y) = [fx (x, y), fy (x, y)] or
∇f (x, y, z) = [fx (x, y, z), fy (x, y, z), fz (x, y, z)]. It is the analog of the deriv-
ative in higher dimensions.
Theorem: d
dt
f (⃗r(t)) = ∇f (⃗r(t)) · ⃗r′ (t).
holds for every h > 0. The left hand side converges to dtd f (x(t), y(t)) in the limit
h → 0 and the right hand side to fx (x(t), y(t))x′ (t) + fy (x(t), y(t))y ′ (t) using the single
variable chain rule twice. Here is the proof of the later, when we differentiate f with
respect to t and y is treated as a constant:
Write H(t) = x(t+h)-x(t) in the first part on the right hand side.
f (x(t + h)) − f (x(t)) [f (x(t) + H) − f (x(t))] x(t + h) − x(t)
= · .
h H h
As h → 0, we also have H → 0 and the first part goes to f ′ (x(t)) and the second factor
to x′ (t).
11.4. The chain rule is powerful because it implies all other differentiation rules:
the addition, product and quotient rule: f (x, y) = x + y, x = u(t), y = v(t), d/dt(x +
y) = fx u′ + fy v ′ = u′ + v ′ .
f (x, y) = xy, x = u(t), y = v(t), d/dt(xy) = fx u′ + fy v ′ = vu′ + uv ′ .
f (x, y) = x/y, x = u(t), y = v(t), d/dt(x/y) = fx u′ + fy v ′ = u′ /y − v ′ u/v 2 .
11.5. We mentioned that the chain rule can be derived from linearization. Let us look
at this case: if f is a linear function f (x, y) = ax + by − c and if ⃗r(t) = [x0 + tu, y0 + tv]
is a line, then dtd f (⃗r(t)) = dtd (a(x0 + tu) + b(y0 + tv)) = au + bv and this is the dot
product of ∇f = (a, b) with ⃗r ′ (t) = (u, v). Because the chain rule only refers to the
derivatives of the functions and the linearlization too, the chain rule is also true for
general functions.
Examples
11.6. A ladybug moves on a circle ⃗r(t) = [cos(t), sin(t)] on a table with tempera-
ture distribution f (x, y) = x2 − y 3 . Find the rate of change of the temperature
∇f (x, y) = (2x, −3y 2 ), ⃗r′ (t) = (− sin(t), cos(t)) d/dtf (⃗r(t)) = ∇T (⃗r(t)) · ⃗r′ (t) =
(2 cos(t), −3 sin(t)2 ) · (− sin(t), cos(t)) = −2 cos(t) sin(t) − 3 sin2 (t) cos(t).
11.7. From f (x, y) = 0, one can express y as a function of x, at least near a point
where fy is not zero. From dxd
f (x, y(x)) = ∇f · (1, y ′ (x)) = fx + fy y ′ = 0, we obtain
′
y = −fx /fy . Even so, we do not know y(x), we can compute its derivative! Implicit
differentiation works also in three variables. The equation f (x, y, z) = c defines a
surface. Near a point where fz is not zero, the surface can be described as a graph
z = z(x, y). We can compute the derivative zx without actually knowing the function
z(x, y). To do so, we consider y a fixed parameter and compute, using the chain rule
fx (x, y, z(x, y)) · 1 + fy (x, y, z(x, y)) · 0 + fz (x, y) · zx (x, y) = 0
so that zx (x, y) = −fx (x, y, z)/fz (x, y, z). This works at points where fz is not zero.
11.8. The surface f (x, y, z) = x2 + y 2 /4 + z 2 /9 = 6 is an ellipsoid. Compute zx (x, y)
at the point (x, y, z) = (2, 1, 1).
Solution: zx (x, y) = −fx (2, 1, 1)/fz (2, 1, 1) = −4/(2/9) = −18.
Homework
This homework is due on Tuesday, 7/12/2022.
MATH S-21A
Lecture
12.1. The gradient ∇f (x, y, z) = [a, b, c] is the derivative of a scalar function f of
many variables. It produces a vector at every point (x, y, z). This vector [a, b, c] is
useful for example to compute tangent lines or tangent planes.
12.2. The symbol ∇ is spelled “Nabla” and named after an Egyptian or Assyrian harp.
Early on, the name “Atled” was suggested. But the textbook of 1901 of Gibbs used
Nabla was too persuasive. The following important fact holds in any dimension.
Proof: Every curve ⃗r(t) on the level curve or level surface satisfies dtd f (⃗r(t)) = 0. By
the chain rule, ∇f (⃗r(t)) is perpendicular to the tangent vector ⃗r′ (t). QED.
The directional derivative tells us how the function changes when we move in a given
direction. Assume for example that T (x, y, z) is the temperature at position (x, y, z). If
we move with velocity ⃗v through space, then D⃗v T tells us at which rate the temperature
changes for us. If we move with velocity ⃗v on a hilly surface of height h(x, y), then
D⃗v h(x, y) gives us the slope we drive on.
12.4. If ⃗r(t) is a curve with velocity ⃗r ′ (t) and the speed is 1, then D⃗r′ (t) f = ∇f (⃗r(t)) ·
⃗r ′ (t) is the temperature change, one measures at ⃗r(t). The chain rule told us that this
is d/dtf (⃗r(t)).
12.5. For ⃗v = [1, 0, 0], then D⃗v f = ∇f · v = fx , the directional derivative is a general-
ization of the partial derivatives. It measures the rate of change of f , if we walk with
unit speed into that direction. But as with partial derivatives, it is a scalar.
12.6. The directional derivative satisfies |D⃗v f | ≤ |∇f ||⃗v | because
∇f · ⃗v ≤ |∇f ||⃗v || cos(ϕ)| ≤ |∇f ||⃗v | .
Examples
12.11. Compute the tangent plane to the surface 3x2 y + z 2 − 4 = 0 at the point
(1, 1, 1). Solution: ∇f (x, y, z) = [6xy, 3x2 , 2z]. And ∇f (1, 1, 1) = [6, 3, 2]. The plane
is 6x + 3y + 2z = d where d is a constant. We can find the constant d by plugging in
a point and get 6x + 3y + 2z = 11.
12.12. Problem: reflect the ray ⃗r(t) = [1 − t, −t, 1] at the surface
x4 + y 2 + z 6 = 6 .
Solution: ⃗r(t) hits the surface at the time t = 2 in the point (−1, −2, 1). The velocity
vector in that ray is ⃗v = [−1, −1, 0]. The normal vector at this point is ∇f (−1, −2, 1) =
[−4, −4, 6] = ⃗n. The reflected vector is R(⃗v = 2Proj⃗n (⃗v ) − ⃗v . We have Proj⃗n (⃗v ) =
8/68[−4, −4, 6]. Therefore, the reflected ray is w⃗ = (4/17)[−4, −4, 6] − [−1, −1, 0].
12.13. You are on a trip in a air-ship over Cambridge at (1, 2) and you want to
avoid a thunderstorm, a region of low pressure. The pressure is given by a function
p(x, y) = x2 + 2y 2 . In which direction do you have to fly so that the pressure change
is largest? Solution: The gradient√∇p(x, y) = [2x, 4y] at the point (1, 2) is [2, 8].
Normalize to get the direction [1, 4]/ 17.
12.14. The “Dom” is a mountain in Switzerland with an altitude of 4’545 meters. In
suitable units on the ground, the height f (x, y) is approximated by the quadratic func-
tion f (x, y) = 4000−x2 −y 2 . At height f (−10, 10) = 3800, at the point (−10, 10, 3800),
√
you rest. The climbing route continues into the south-east direction ⃗v = [1, −1]/ 2.
Calculate the rate of change in that direction. We have ∇f (x, y) = [−2x, −2y], so
Multivariable Calculus
√ √
that√[20, −20] · [1, −1]/ 2 = 40/ 2. This is a place, with a ladder, where you climb
40/ 2 meters up when advancing 1m forward. The rate of change in all directions is
zero if and only if ∇f (x, y) = [0, 0]: if ∇f ̸= ⃗0, we can choose ⃗v = ∇f /|∇f | and get
D∇f f = |∇f |.
Dom as seen from the Alp Salmenfee in Switzerland. Oliver was finally back there
this summer 2022.
√ √
12.15.√ Assume we know√ Dv f (1, 1) = 3/ 5 and Dw f (1, 1) = 5/ 5, where v =
[1, 2]/ 5 and w = [2, 1]/ 5. Find the gradient of f . Note that we do not know any-
thing else about the function f . Solution: Let ∇f (1, 1) = [a, b]. We know a + 2b = 3
and 2a + b = 5. This allows us to get a = 7/3, b = 1/3.
Homework
This homework is due on Tuesday, 7/12/2022.
MATH S-21A
Lecture
13.1. In applications we often are led to the task to maximize or minimize a function
f . As in single variable calculus, the strategy is to look for points where the derivative
is zero. In the interior of an Euclidean domain this is needed for a maximum by the
Fermat principle. In one dimensions, like for f (x) = 3x5 − 5x3 we can then use the
second derivative test to classify the extrema, like local max at −1 and the local
min at 1. 1
13.4. Note that in the definition, we do not include points, where f or its derivative
is not defined. For f (x, y) = |x| + |y| we would have to exclude the points on the x
and the y axis and study the function there separately. Without stating otherwise, we
always assume that a function f can be differentiated arbitrarily often. Points, where
the function has no derivatives are just not considered to be part of the domain and
need to be studied separately. For the continuous function f (x, y) = 1/ log(|xy|) for
example, we would have to look at the points on the coordinate axes as well as the
points on the hyperbola xy = 1 separately.
1It is custom to abbreviate max for maximum and min for minimum.
Multivariable Calculus
13.5. In one dimension, we used the condition f ′ (x) = 0, f ′′ (x) > 0 to get a local
minimum and f ′ (x) = 0, f ′′ (x) < 0 to assure a local max. If f ′ (x) = 0, f ′′ (x) = 0, the
nature of the critical point is undetermined and could be a max like for f (x) = −x4 ,
or a minimum like for f (x) = x4 or a flat inflection point like for f (x) = x3 , where
we have neither a max nor a min.
Definition: If f (x, y) is a function of two variables with a critical point (a, b),
2
the number D = fxx fyy − fxy is called the discriminant of the critical point.
13.7. If D ̸= 0 at all critical points, the function f is called Morse. The Morse
condition is nice as for D = 0, we need higher derivatives or ad-hoc methods to
determine the nature of the critical point.
13.8. To find the max or min of f (x, y) on a domain, determine all critical points in
the interior the domain, and compare their values with maxima or minima at the
boundary. We will see in the next unit how to get extrema on the boundary.
13.9. Sometimes, we want to find the overall maximum and not only the local ones.
Definition: A point (a, b) in the plane is called a global maximum of
f (x, y) if f (x, y) ≤ f (a, b) for all (x, y). For example, the point (0, 0) is a global
maximum of the function f (x, y) = 1 − x2 − y 2 . Similarly, we call (a, b) a global
minimum, if f (x, y) ≥ f (a, b) for all (x, y).
3
Examples
13.10. Find the critical points of f (x, y) = x4 +y 4 −4xy+2. The gradient is ∇f (x, y) =
[4(x3 − y), 4(y 3 − x)]. This is [0, 0] at the points (0, 0), (1, 1), (−1, −1). These are the
critical points.
13.11. f (x, y) = sin(x2 + y) + y. The gradient is ∇f (x, y) = [2x cos(x2 + y), cos(x2 +
y) + 1]. For a critical points, we must have x = 0 and cos(y) + 1 = 0 which means
π + k2π. The critical points are at . . . (0, −π), (0, π), (0, 3π), . . . . There are infinitely
many critical points here.
2Matrixcomes from Mater = womb of a mother as matrices are the mother of determinants!
3Weavoid “absolute maximum” as this would suggest to look for the maximum of |f |. Compare
for example when looking at absolute convergence of series.
2 2
13.12. The graph of f (x, y) = (x2 + y 2 )e−x −y looks like a volcano. The gradient
2 2
∇f = [2x − 2x(x2 + y 2 ), 2y − 2y(x2 + y 2 )]e−x −y vanishes at (0, 0) and on the circle
x2 + y 2 = 1. This function has a continuum of critical points.
13.13. The function f (x, y) = y 2 /2 − g cos(x) is the energy of the pendulum. The
variable g is a constant and related to the gravitational strength. We have ∇f =
(y, −g sin(x)) = [(0, 0] for
(x, y) = . . . , (−π, 0), (0, 0), (π, 0), (2π, 0), . . . .
These points are equilibrium points, the angles for which the pendulum is at rest.
13.15. The function f (x, y) = |x| + |y| is smooth on the first quadrant {x > 0, y > 0}.
It does not have critical points there. The function has a minimum at (0, 0) but it is
not in the domain, where f and ∇f are defined. We have to look at the points on the
coordinate axis separately. For y = 0, we see that x = 0 is a minimum of |x| For x = 0
we see that y = 0 is a minimum of |y|. Now (0, 0) is a minimum of f . This minimum
was not detected using derivatives.
is a local maximum on the line y = −1. Comparing f (4/3, 0), f (4/3, −1) shows that
(4/3, 0) is the global maximum.
13.18. Find the global maxima and minima of f (x, y) = x4 + y 4 − 2x2 − 2y 2 Solution:
the function has no global maximum. This can be seen by restricting the function to
the x-axis, where f (x, 0) = x4 − 2x2 is a function without maximum. The function has
four global minima however. They are located on the 4 points (±1, ±1). The best way
to see this is to note that f (x, y) = (x2 − 1)2 + (y − 1)2 − 2 which is minimal when
x2 = 1, y 2 = 1.
Homework
This homework is due on Tuesday, 7/19/2022.
Problem 13.1: Find all the extrema of the function
f (x, y) = xy + x2 y − xy 2
they are maxima, minima or saddle points.
MATH S-21A
Lecture
14.1. When looking for maxima and minima of a function f (x, y) in the presence of
a constraint g(x, y) = 0, a necessary condition is that the gradients of f and g are
parallel. The reason is that otherwise, we can move along the curve g = c and increase
the value of f . Indeed, the directional derivative of f in the direction tangent to the
level curve is zero if and only if the tangent vector to g is perpendicular to the gradient
of f . This can also include the case ∇g = [0, 0].
14.2. In higher dimensions, the statement is exactly the same: extrema of f (⃗x) under
the constraint g(⃗x) = c are either solutions of the Lagrange equations ∇f = λ∇g, g = c
or points, where ∇g = ⃗0. But we also can have more than one constraint:
14.3. Remarks.
1) The conditions in the Lagrange theorem are equivalent to ∇f ×∇g = ⃗0 in dimensions
2 or 3.
2) With g(x, y) = 0, the Lagrange equations can also be written as ∇F (x, y, λ) = ⃗0,
where F (x, y, λ) = f (x, y) − λg(x, y).
3) The two conditions in the theorem are equivalent to ”∇g = λ∇f or f has a critical
point”.
4) Constrained optimization problems work also in higher dimensions.
5) Can we avoid Lagrange? Sometimes. It is often done in single variable calculus. In
order to maximize xy under the constraint 2x + 2y = 4 for example, we solve for y in
the second equation and extremize the single variable problem f (x, y(x)). This needs
to be done carefully and the boundaries must be considered.
√ To extremize f (x, y) = y
2 2 2
on x + y = 1 for example we need to maximize 1 − x . We can differentiate to get
the critical points but also have to look at the cases x = 1 and x = −1, where the
actual minima and maxima occur. In general also, we can not do the substitution. To
extremize f (x, y) = x2 + y 2 with constraint g(x, y) = x4 + 3y 2 − 1 = 0 for example, we
solve y 2 = (1 − x4 )/3 and minimize h(x) = f (x, y(x)) = x2 + (1 − x4 )/3. h′ (x) = 0
gives x = 0. The find the maximum (±1, 0), we had to maximize h(x) on [−1, 1], which
occurs at ±1.
To extremize f (x, y) = x2 +y 2 under the constraint g(x, y) = p(x)+p(y) = 1, where p is
a complicated function in x which satisfies p(0) = 0, p′ (1) = 2,the Lagrange equations
2x = λp′ (x), 2y = λp′ (y), p(x) + p(y) = 1 can be solved with x = 0, y = 1, λ = 1. We
can not solve g(x, y) = 1 however for y in an explicit way.
6) How do we determine whether a solution of the Lagrange equations is a maximum
or minimum? Instead of introducing a second derivative test, we just make a list of
critical points and pick the maximum and minimum. A second derivative test can be
designed using second directional derivative in the direction of the tangent.
7) The Lagrange method also works with more constraints. The constraints g = c, h =
d define a curve in space. The gradient of f must now be in the plane spanned by the
gradients of g and h because otherwise, we could move along the curve and increase f :
Examples
14.4. Minimize f (x, y) = x2 +2y 2 under the constraint g(x, y) = x+y 2 = 1. Solution:
The Lagrange equations are 2x = λ, 4y = λ2y. If y = 0 then x = 1. If y ̸= 0 we can
divide the second equation by y and get 2x = λ, 4 = λ2 again showing x = 1. The
point x = 1, y = 0 is the only solution.
14.5. Find the shortest distance from the origin to the curve x6 + 3y 2 = 1. Solution:
Minimize the function f (x, y) = x2 + y 2 under the constraint g(x, y) = x6 + 3y 2 = 1.
The gradients are ∇f = [2x, 2y], ∇g = [6x5 , 6y]. The Lagrange equations ∇f = λ∇g
lead to the system 2x = λ6x5 , 2y = λ6y, x6 + 3y 2 − 1 = 0. We get λ = 1/3, x = x5 ,
p either x = 0 or 1 or −1. From the constraint
so that p equation g = 1, we obtain
6
y = (1 − x )/3. So, we have the solutions (0, ± 1/3) and (1, 0), (−1, p 0). To see
which is the minimum, just evaluate f on each of the points. (0, ± 1/3) are the
minima.
14.6. Which cylindrical soda cans of height h and radius r has minimal surface for fixed
volume? Solution: The volume is V (r, h) = hπr2 = 1. The surface area is A(r, h) =
2πrh + 2πr2 . With x = hπ, y = r, you need to optimize f (x, y) = 2xy + 2πy 2 under
the constrained g(x, y) = xy 2 = 1. Calculate ∇f (x, y) = (2y, 2x + 4πy), ∇g(x, y) =
(y 2 , 2xy). The task is to solve 2y = λy 2 , 2x + 4πy = λ2xy, xy 2 = 1. The first equation
gives yλ = 2. Putting that in the second one gives 2x + 4πy = 4x or 2πy = x.
The third equation finally reveals 2πy 3 = 1 or y = 1/(2π)1/3 , x = 2π(2π)1/3 . This
means h = 0.54.., r = 2h = 1.08. Remark: Other factors can influence the shape. For
example, the can has to withstand a pressure up to 100 psi. A typical can of ”Coca-
Cola classic” with 3.7 volumes of CO2 dissolve has at 75F an internal pressure of 55
psi, where PSI stands for pounds per square inch.
14.7. On the curve g(x, y) = x3 −y 2 the function f (x, y) = x obviously has a minimum
(0, 0). The Lagrange equations ∇f = λ∇g have no solutions. This is a case where the
minimum is a solution to ∇g(x, y) = 0.
14.10. The probability that a chemical compound is in the state k is pk . The en-
ergy
P of the state k is Ek . Nature tries to minimize the free energy f (p1 , . . . , pn ) =
− i pi log(pi ) + Ei pi if the energies Ei are fixed. The probability distribution P pi min-
imizing this is called the Gibbs distribution. The constraint of course is k pk = 1.
We have ∇f = (−1 − log(p1 ) − E1 , . . . , −1 − log(pn ) − En ), ∇g = (1, . . . , 1). The La-
grange equation are log(pi ) = −1−λ−Ei , or pi = exp(−E P i )C, where C = exp(−1−λ).
ThePconstraint g(p) = p1 + · · · + pn = 1 gives C(P i exp(−Ei )) = 1 so that C =
1/( i e−Ei ). The Gibbs solution is pk = exp(−Ek )/ i exp(−Ei ).
15. Homework
This homework is due on Tuesday, 7/19/2022.
Problem 14.1: A solid bullet made of a half sphere and a cylinder has
the volume V = 2πr3 /3 + πr2 h and surface area A = 2πr2 + 2πrh + πr2 .
Doctor Manhattan designs a bullet with fixed volume and minimal
area. With g = 3V /π = 1 and f = A/π he therefore minimizes
f (h, r) = 3r2 + 2rh under the constraint g(h, r) = 2r3 + 3r2 h = 1. Use the
Lagrange method to find a local minimum of f under the constraint g = 1.
Problem 14.2: Find the cylindrical basket which is open on the top
has has the largest volume for fixed area 3π. If x is the radius and y
is the height, we have to extremize f (x, y) = πx2 y under the constraint
g(x, y) = 2πxy + πx2 = 3π. Use the method of Lagrange multipliers.
MATH S-21A
Lecture
15.1. If f (x) is a continuous function of one variable, then the Riemann integral
Rb
f (x) dx is defined as the limit of the Riemann sums Sn f = n1 k/n∈[a,b] f (k/n)
P
a
for n → ∞. The derivative of f is the limit of difference quotients Dn f (x) =
Rb
n[f (x + 1/n) − f (x)] as n → ∞. The integral a f (x) dx is the signed area under
the graph of f and above the x-axes, where “signed”Rx indicates that area below the
x-axes has negative sign. The function F (x) = 0 f (y) dy is called an anti-derivative
of f . It is determined up a constant. The fundamental theorem of calculus states
Z x
′
F (x) = f (x), f (x) dx = F (x) − F (0) .
0
It allows to compute integrals by inverting differentiation. Differentiation rules so
become integration rules: the product rule leads to integration by parts; the chain
rule becomes substitution.
RR
Definition: If f (x, y) is continuous on a region R, the integral R
f (x, y) dxdy
is defined as the limit of Riemann sums
1 X i j
2
f( , )
n i j n n
( n , n )∈R
RR
when n → ∞. We write also R f (x, y) dA, where dA = dxdy is a formal
notation meaning for “an area element”.
15.2. The Fubini’s theorem allows to switch the order of integration over a rectangle
if the function f is continuous:
Multivariable Calculus
RbRd RdRb
Theorem: a c
f (x, y) dxdy = c a
f (x, y) dydx.
which holds for all functions. Now divide both sides by n2 and take the limit n → ∞.
This is possible for continuous functions. Fubini’s theorem only holds for rectangles.
We extend now the collection of possible regions to integrate over:
d(x)
a(y)
b(y)
c(x)
c
a b
15.3. Similarly
R Ras we could see in one dimensions, an integral as a signed area, one
can interpret R
f (x, y) dydx as the signed volume of the solid below the graph of
f and above R in the xy plane. As in 1D integration, the volume of the solid below
the xy-plane is counted negatively.
Examples
15.4. If we integrate f (x, y) = xy over the unit square we can sum up the Riemann
sum for fixed y = j/n and get y/2. Now perform the integral over y to get 1/4. This
example shows how to reduce double integrals to single variable integrals.
15.5. If f (x, y) = 1, then the integral is the area of the region R. The integral is the
limit L(n)/n2 , where L(n) is the number of lattice points (i/n, j/n) contained in R.
RR RR
15.6. The value R
f (x, y) dA/ R
1 dA is the average value of f .
15.7. Integrate f (x, y) = x2 over the region bounded above by sin(x3 ) and bounded
below by the graph of − sin(x3 ) for 0 ≤ x ≤ π 1/3 . The value of this integral has a
physical meaning. It is called moment of inertia.
Z π1/3 Z sin(x3 ) Z π1/3
2
x dydx = 2 sin(x3 )x2 dx
0 − sin(x3 ) 0
1/3
We have now an integral, which we can solve by substitution − 32 cos(x3 )|π0 = 34 .
15.8. Integrate f (x, y) = y 2 over the region bound by the x-axes, the lines y = x + 1
and y = 1 − x. The problem is best solved with a “left to right” integral. As you can
see from the picture, we would have to compute two different integrals as a “bottom
to top” integral. To do so, we have to write the bounds as a function of x: they are
x = y − 1 and x = 1 − y
Z 1 Z 1−y
y 2 dx dy = 1/6 .
0 y−1
R R R √R2 −x2 RR √
15.10. The area of a disc of radius R is −R −√R2 −x2 1 dydx = −R 2 R2 − x2 dx.
R π/2 p
Substitute x = R sin(u), dx = R cos(u)du, to get −π/2 2 R2 − R2 sin2 (u)R cos(u) du =
R π/2
−π/2
2R2 cos2 (u) du = R2 π. In the last identity, we have used the double angle iden-
tity 2 cos2 (x) = 1 + cos(2x).
Multivariable Calculus
Homework
This homework is due on Tuesday, 7/19/2022.
Problem 15.1: Find the area of the region
R = {(x, y) | 0 ≤ x ≤ 4π, sin(x) − 1 ≤ y ≤ cos(x) + 2}
RR
and use it to compute the average value R
f (x, y) dxdy/area(R) of
f (x, y) = y over that region.
Problem 15.3: Find the volume of the solid lying under the paraboloid
z = 3x2 + 3y 2 and above the rectangle R = [−2, 2] × [−2, 4] = {(x, y) | −
3 ≤ x ≤ 3, −2 ≤ y ≤ 4 }.
R 1 R 2−x
Problem 15.4: a) Fist evaluate the iterated integral 0 x 6(x2 −
y) dydx. Make sure to sketch the corresponding bottom to top region.
b) Rewrite the integral as a left to right region and compute the integral
again.
MATH S-21A
Lecture
16.1. For certain regions, it is better to use a different coordinate system. A re-
parametrization (x, y) = ⃗r(u, v) often helps. This works then also in higher dimensions,
where surfaces are parametrized as [x, y, z] = ⃗r(u, v). We first remain in R2 , where polar
coordinates (x, y) = (r cos(θ), r sin(θ) are an important example.
16.2. Why do we have to include the factor r, when we transition to polar coordinates?
The reason is that a small rectangle R with area dA = dθdr in the (r, θ) plane is mapped
by T : (r, θ) 7→ (r cos(θ), r sin(θ)) to a sector segment S in the (x, y) plane. It has the
area r dθdr. We will also see that the parametrization ⃗r(θ, r) = [r cos(θ), r sin(θ), 0]
gives |⃗rθ × ⃗rr | = r.
Multivariable Calculus
16.3. We can now integrate over basic regions in the (θ, r)-plane. Examples are flow-
ers: {(θ, r) |0 ≤ r ≤ f (θ)}, where f (θ) is a non-negative periodic function of θ.
A polar region shown in polar coordi- The same region in the xy coordinate
nates. system.
16.4. Proof. The vector ⃗ru is tangent to the grid curve u 7→ ⃗r(u, v) and ⃗rv is tangent
to v 7→ ⃗r(u, v). The two vectors span a parallelogram with area |⃗ru × ⃗rv |. A small
rectangle [u, u + du] × [v, v + dv] is mapped by ⃗r to a parallelogram spanned by ⃗ru du
and ⃗rv dv which has the area |⃗ru (u, v) × ⃗rv (u, v)| dudv.
Examples
16.5. The polar graph defined by r(θ) = | cos(3θ)| belongs to the class of roses r(t) =
| cos(nt)|. Regions enclosed by this graph are also called rhododenea. Note that in
the literature you often see also situations where r(θ) can become negative. We will
never allow that as r ≥ 0 is a radius and a radius is non-negative in order not to get
confused.
16.6. The polar curve r(θ) = 1 + sin(θ) is called a cardioid. It looks like a heart and
belongs to the class of limacon curves r(θ) = 1 + b sin(θ).
p
16.7. The polar curve r(θ) = | cos(2t)| is called a lemniscate.
2.0 1.0
1.5 0.5
0.5
1.0
0.5
-0.5
-0.5
-1.0
16.8. Integrate
f (x, y) = x2 + y 2 + xy
over
RR the unit disc. We
R 1 Rhave f (x, y) = f (r cos(θ), r sin(θ)) = r2 + r2 cos(θ) sin(θ) so that
2π
R
f (x, y) dxdy = 0 0 (r2 + r2 cos(θ) sin(θ))r dθdr = 2π/4.
16.9. We have earlier computed area of the disc {x2 + y 2 ≤ 1 } using substitution. It
is more elegant to do this in polar coordinates:
Z 2π Z 1
r drdθ = 2πr2 /2|10 = π .
0 0
16.12. The Belgian Biologist Johan Gielis defined in 1997 the family of curves given
in polar coordinates as
| cos( mϕ
4
)|n1 | sin( mϕ
4
)|n2 −1/n3
+ r(ϕ) = ( )
a b
This super-curve can produce a variety of shapes like circles, squares, triangles or
stars. It can also be used to produce “super-shapes”. The super-curve generalizes
the super-ellipse which had been discussed in 1818 by Lamé and helps to describe
forms in biology. 1
1”Gielis,J. A ’generic geometric transformation that unifies a wide range of natural and abstract
shapes’. American Journal of Botany, 90, 333 - 338, (2003).
Multivariable Calculus
16.13. The parametrized surface ⃗r(u, v) = [2u, 3v, 0] is part of the xy-plane. The
parameter region R just gets stretched by a factor 2 in the x coordinate and by a
factor 3 in the y coordinate. ⃗ru × ⃗rv = [0, 0, 6] and we see that the area of S = ⃗r(R) is
6 times the area of R.
16.14. The map ⃗r(u, v) = [L cos(u) sin(v), L sin(u) sin(v), L cos(v)] maps the rectangle
G = {0 ≤ x ≤ 2π, 0 ≤ y ≤ π onto a sphere of R Rradius L. RWe compute ⃗ru × ⃗rv =
2 2 2π R π 2
L sin(v)⃗r(u, v). So, |⃗ru × ⃗rv | = L | sin(v)| and R
1 dS = 0 0 L sin(v) dvdu =
2
4πL . This is a formula which Archimedes already has derived by seeing it as the
surface area of an open cylinder of height 2L and radius L.
16.15. For graphs (u, v) 7→ [u, v, f (u, v)], we have ⃗ru = [1, 0, fu (u,p v)] and ⃗rv =
−fv , 1] has the length 1 + fu2 + fv2 .
[0, 1, fv (u, v)]. The cross product ⃗ru × ⃗rv = [−fu ,p
RR
The area of the surface above a region R is R
1 + fu2 + fv2 dudv.
16.16. Lets take a surface of revolution ⃗r(u, v) = [v, f (v) cos(u), f (v) sin(u)] on R =
[0, 2π]×[a, b]. We have ⃗ru = (0, −f (v) sin(u), f (v) cos(u)), ⃗rv = (1, f ′ (v) cos(u), f ′ (v) sin(u))
and ⃗ru ×⃗rv = (−f (v)f ′ (v), f (v) cos(u), f (v) sin(u)) ′
p = f (v)(−f (v), cos(u), sin(u)). The
RR Rb
surface area is |⃗ru × ⃗rv | dudv = 2π a |f (v)| 1 + f ′ (v)2 dv.
Homework
This homework is due on Tuesday, 7/19/2022.
RR
Problem 16.1: Find R
(x2 + y 2 )150 dA, where R is the part of the
2 2
unit disc {x + y ≤ 1 } for which y > x.
Problem 16.2: The cardioid has first been described in 1741. Its
ultimate fame came because the main body of the Mandelbrot set is
a Cardioid. Find its area. Its boundary is
cos(t) cos(2t) sin(t) sin(2t)
⃗r(t) = [ − , − ], 0 ≤ t ≤ 2π .
2 4 2 4
Problem 16.3: Find the area of the region bounded by three curves:
first by the polar curve r(θ) = 2θ with θ ∈ [0, 2π], second by the polar
curve r(θ) = 3θ with θ ∈ [0, 2π] and third by the positive x-axis?
RR
f dxdy
Problem 16.4: Find the average RRR 1 dxdy for f (x, y) = 34(x2 + y 2 ) on
R
the annular region R : 1 ≤ |(x, y)| ≤ 2.
Problem 16.5: Find the surface area of the part of the paraboloid
x = y 2 + z 2 which is inside the cylinder y 2 + z 2 ≤ 16.
MATH S-21A
Lecture
17.1. Integrating over 3-dimensional solids is done in the same way than in two di-
mensions. Three dimensional regions are referred to as solids.
Definition:
RRR If f (x, y, z) is continuous and E is a bounded solid in R3 , then
E
f (x, y, z) dxdydz is defined as the n → ∞ limit of the Riemann sum
X i j k 1
f( , , ) 3 .
i j k
n n n n
( n , n , n )∈E
17.2. If E is the box {x ∈ [0, 1], y ∈ [0, 1], z ∈ [0, 1]} and f (x, y, z) = 24x2 y 3 z.
R1 R1 R1
0 0 0
24x2 y 3 z dz dy dx .
R1
To evaluate the integral, start from the inside 0 24x2 y 3 z dz = 12x3 y 3 , then then
R1
integrate the middle layer, 0 12x3 y 3 dy = 3x2 and finally and finally handle the most
R1
outer layer: 0 3x2 dx =1.
For the inner integral, x = x0 and y = y0 are fixed. The middle integral now computes
the contribution over a slice z = z0 intersected with R. The outer integral sums up all
these slice contributions.
below the graph of a function R R f (x, y) and above a region R, considered part of the
xy-plane. It is the integral R
f (x, y) dA. The triple integral above also has more
flexibility: we can replace 1 with a function f (x, y, z). If interpreted as a mass density,
then the integral is the mass of the solid.
17.5. The problem of computing volumes has been been worked on by Archimedes
(287-212 BC) already. His method of exhaustion was a precursor of Riemann sums
allowed him to find areas, volumes and surface areas in many cases without calculus.
One idea is comparison. Already the Archimedes principle relating volume to
the amount of displayed water is such an idea. The displacement method is a
comparison technique: the area of a sphere is the area of the cylinder enclosing it.
The volume of a sphere is the volume of the complement of a cone in that cylinder.
Cavalieri (1598-1647) would build on Archimedes ideas and determine area and
volume using tricks now called the Cavalieri principle. An example already due to
Archimedes is the computation of the volume the half sphere of radius R, cut away a
cone of height and radius R from a cylinder of height R and radius R. At height z,
this body has a cross section with area R2 π − r2 π. If we cut the half sphere at height
z, we obtain a disc of area (R2 − r2 )π. Because these areas are the same, the volume
of the half-sphere is the same as the cylinder minus the cone: πR3 − πR3 /3 = 2πR3 /3
and the volume of the sphere is 4πR3 /3. Newton (1643-1727) and Leibniz( 1646-
1716) developed calculus independently. It provided a new tool which made it possible
to compute integrals through ”anti-derivation”. Suddenly, it became possible to find
integrals using analytic tools. We can do this also in higher dimensions.
Examples
17.6. Find the volume of the unit sphere. Solution: The sphere is sandwiched be-
tween the graphs of two functions obtained by solving for z. Let R be the unit disc in
the xy plane. If we use the sandwich method, we get
Z Z Z √ 1−x2 −y 2
V = [ √ 1dz]dA .
R − 1−x2 −y 2
RR p
which gives a double integral 2 1 − x2 − y 2 dA which is of course best solved in
R 2π RR1 √
polar coordinates. We have 0 0 1 − r2 r drdθ = 4π/3.
With the washer method which is in √this case also called disc method, we slice
2
along the z axes and get a disc of radius 1 − z 2 with area π(1
R 1 − z ). This is a method
2
suitable for single variable calculus because we get directly −1 π(1 − z ) dz = 4π/3.
RRR
17.7. The mass of a body with mass density ρ(x, y, z) is defined as R
ρ(x, y, z) dV .
For bodies with constant density ρ, the mass is ρV , where V is the volume. Compute
the mass of a body which is bounded by the parabolic cylinder z = 4 − x2 , and the
planes x = 0, y = 0, y = 6, z = 0 if the density of the body is z. Solution:
Z 2 Z 6 Z 4−x2 Z 2Z 6
z dz dy dx = (4 − x2 )2 /2 dydx
0 0 0 0 0
Z 2 5 3
x 8x
= 6 (4 − x2 )2 /2 dx = 6( − + 16x)|20 = 2 · 512/5
0 5 3
17.9. Finding the volume of the solid region bound by the three cylinders x2 + y 2 = 1,
x2 + z 2 = 1 and y 2 + z 2 = 1 is one of the most famous volume integration problems
going back to Archimedes.
Solution: look at 1/16’th of√the body given in cylindrical coordinates 0 ≤ θ ≤ π/4, r ≤
1, z > 0. The roof is z = 1 − x2 because above the ”one eighth disc” R only the
cylinder x2 + z 2 = 1 matters. The polar integration problem
Z π/4 Z 1 p
16 1 − r2 cos2 (θ)r drdθ
0 0
has an inner r-integral of (16/3)(1 − sin(θ)3 )/ cos2 (θ). Integrating this over θ can be
done by integrating (1 + sin(x)3 ) sec2 (x) by parts using tan′ (x) √= sec2 (x) leading to
the anti derivative cos(x) + sec(x) + tan(x). The result is 16 − 8 2.
Homework
This homework is due on Tuesday, 7/26/2022.
Multivariable Calculus
R1R1R1 2
Problem 17.2: What is 0 0 y
xe−z dzdydx?
RRR
Problem 17.3: Find the moment of inertia E
(x2 + y 2 ) dV of a
cone
E = {x2 + y 2 ≤ z 2 0 ≤ z ≤ 15 } ,
which has the z-axis as its center of symmetry.
MATH S-21A
Lecture
18.1. Cylindrical and spherical coordinate systems help to integrate in many situa-
tions.
ZZZ ZZZ
f (x, y, z) dxdydz = g(ρ, θ, z) ρ2 sin(ϕ) dρdθdϕ
T (R) R
Examples
18.2. For a ball of radius R we obtain with respect to the z-axis:
Z R Z 2π Z π
I= ρ2 sin2 (ϕ)ρ2 sin(ϕ) dϕdθdρ
0 0 0
Z π Z R Z 2π
3 4
=( sin (ϕ) dϕ)( ρ dr)( dθ)
0 0 0
Z π Z R Z 2pi
2 4
=( sin(ϕ)(1 − cos (ϕ)) dϕ)( ρ dr)( dθ)
0 0 0
3 4 R5 8πR5
= (− cos(ϕ) + cos(ϕ) /3)|π0 (L5 /5)(2π) = · · 2π = .
3 5 15
18.3. If the sphere rotates with angular velocity ω, then Iω 2 /2 is the kinetic en-
ergy of that sphere. The moment of inertia of the earth for example is 8 · 1037 kgm2 .
The angular velocity is ω = 2π/day = 2π/(86400s). The rotational energy is 8 ·
1037 kgm2 /(7464960000s2 ) ∼ 1029 J ∼ 2.51024 kcal.
18.4. Find the volume and the center of mass of a diamond, the √ intersection of the
unit sphere with the cone given in cylindrical coordinates as z = 3r.
Solution: we use spherical coordinates to find the center of mass
Z 1 Z 2π Z π/6
1
x = ρ3 sin2 (ϕ) cos(θ) dϕdθdρ =0
0 0 0 V
Z 1 Z 2π Z π/6
1
y = ρ3 sin2 (ϕ) sin(θ) dϕdθdρ =0
0 0 0 V
Z 1 Z 2π Z π/6
1 2π
z = ρ3 cos(ϕ) sin(ϕ) dϕdθdρ =
0 0 0 V 32V
RRR
18.5. Find R
z 2 dV for the solid obtained by intersecting {1 ≤ x2 + y 2 + z 2 ≤ 4 }
with the double cone {z 2 ≥ x2 + y 2 }.
Solution: since the result for the double cone is twice the result for the single cone, we
work with the diamond shaped region R in {z > 0} and multiply the result at the end
with 2. In spherical coordinates, the solid R is given by 1 ≤ ρ ≤ 2 and 0 ≤ ϕ ≤ π/4.
With z = ρ cos(ϕ), we have
Z 2 Z 2π Z π/4
ρ4 cos2 (ϕ) sin(ϕ) dϕdθdρ
1 0 0
Homework
This homework is due on Tuesday, 7/26/2022.
Problem
√ 18.1: A hot air balloon E has the shape x2 + y 2 + z 2 ≤ 1, z ≥
−1/ 2. The density of the gas is f (x, y, z) = 1+z. Olli Rocky Docky com-
RRR
putes the amount√ of f (x, h, z) dV using cylindrical coordinates and
R 2π R 1 R 1−z2 E
gets 0 −1/√2 0 (1+z)rdrdzdθ. Then he computes the same volume
R 2π R 3π/4 R 1 2
using spherical coordinates 0 0 0
ρ sin(ϕ)(1 + ρ cos(ϕ)) dρdϕdθ.
Compute both integrals. You will see that they do not agree. Which
of the two integrals correctly computes the volume? What went wrong
with the other?
MATH S-21A
Lecture
19.1. A vector-valued function F is called a vector field. A real valued function f is
called a scalar field.
19.2. Here are examples of vector fields in two and three dimensions
−y
y − sin(x)
F⃗ (x, y) = , F⃗ (x, y, z) = x .
x3 + cos(2y)
sin(z)
19.3. When is a vector field a gradient field? F⃗ (x, y) = [P (x, y), Q(x, y)] = ∇f (x, y)
implies Qx (x, y) = Py (x, y). If this does not hold at some point, F⃗ is no gradient field.
Clairaut test: If Qx (x, y) − Py (x, y) is not zero at some point, then F⃗ (x, y) =
[P (x, y), Q(x, y)] is not a gradient field.
19.4. We will see next week that curl(F⃗ ) = Qx − Py = 0 is also sufficient for F⃗ to be a
gradient field if F⃗ is defined everywhere. How do we get f the function with F⃗ = ∇f ?
We will look at examples in class.
Examples
19.5. Is the vector field F⃗ (x, y) = [P, Q] = [3x2 y + y + 2, x3 + x − 1] a gradient
field? Solution: the Clairaut test shows Qx − Py = 0. We integrate the equation
fx = P = 3x2 y + y + 2 and get f (x, y) = 2x + xy + x3 y + c(y). Now take the derivative
of this with respect to y to get x + x3 + c′ (y) and compare with x3 + x − 1. We see
c′ (y) = −1 and so c(y) = −y + c. We see the solution x3 y + xy − y + 2x .
19.6. Is the vector field F⃗ (x, y) = [xy, 2xy 2 ] a gradient field? Solution: No: Qx −Py =
2y 2 − x is not zero.
Vector fields appear naturally when studying differential equations. Here is an example
in population dynamics:
19.7. If x(t) is the population of a “prey species” like shrimp and y(t) is the population
size of a “predator” like sharks. We have x′ (t) = ax(t) − bx(t)y(t) with positive a, b
because both more predators and more prey species will lead to prey consumption.
The rate of change of y(t) is y ′ (t) = −cy(t) + dxy, where c, d are positive. This can
be written using a vector field ⃗r′ = F⃗ (⃗r(t)). We have a negative sign in the first part
because predators would die out without food. The second term is explained because
both more predators as well as more prey leads to a growth of predators through
reproduction. A concrete example is the Volterra-Lodka system
ẋ = 0.4x − 0.4xy
ẏ = −0.1y + 0.2xy ,
where F⃗ (x, y) = [0.4x − 0.4xy, −0.1y + 0.2xy]. Volterra explained with such systems
the oscillation of fish populations in the Mediterranean sea. At any specific point
⃗r(x, y) = [x(t), y(t)], there is a curve = ⃗r(t) = [x(t), y(t)] through that point for which
the tangent ⃗r ′ (t) = (x′ (t), y ′ (t) is the vector field.
19.8. In mechanics, Hamiltonian fields plays an important role: if H(x, y) is a func-
tion of two variables called energy, then [Hy (x, y), −Hx (x, y)] is called a Hamiltonian
vector field. An example is the harmonic oscillator H(x, y) = (x2 + y 2 )/2. Its vec-
tor field is F⃗ (x, y) = [Hy (x, y), −Hx (x, y)] = [y, −x]. The flow lines of a Hamiltonian
vector fields are located on the level curves of H.
19.9. Here is a famous example. It is the Lorenz vector field
10y − 10x
F⃗ (x, y, z) = −xz + 28x − y .
xy − 38 z
It features what one calls a strange attractor, an icon in chaos theory.
Multivariable Calculus
Homework
This homework is due on Tuesday, 7/26/2022.
Problem 19.1: p
a) Draw the gradient vector field of f (x, y) = (x + 1)2 + (y − 2)2 .
b) Draw the gradient vector field of f (x, y) = sin(x2 − y 2 ).
In both cases, draw a contour map of f and use gradients to draw the
vector field⃗F (x, y) = ∇f .
Problem 19.3:
xy
a) Is the vector field F⃗ (x, y) = a gradient field?
x2
sin(x) + y
b) Is the vector field F⃗ (x, y) = a gradient field?
cos(y) + x
In both cases, find f (x, y) satisfying ∇f (x, y) = F⃗ (x, y) or give a reason,
why it does not exist.
MATH S-21A
Lecture
20.1. When a vector field is integrated along a curve, we get a line integral. In the
special case, where F⃗ is a gradient field, we can compute the integral using the funda-
mental theorem of calculus. The corresponding formula will be the first generalization
of the fundamental theorem to higher dimensions.
20.2. We use also the short-hand notation C F⃗ · dr. ⃗ In physics, if F⃗ (x, y, z) is a force
R
Rb
field, then F⃗ (⃗r(t)) · ⃗r ′ (t) is called power and the line integral a F⃗ (⃗r(t)) · ⃗r ′ (t) dt
is work. In electrodynamics, if F⃗ (x, y, z) is an electric field, then the line integral
Rb
a
F⃗ (⃗r(t)) · ⃗r ′ (t) dt is the electrostatic potential.
20.3. Let C : t 7→ ⃗r(t) = [cos(t), sin(t)] be a circle parameterized by t ∈ [0, 2π] and let
⃗
F⃗ (x, y) = [−y, x]. Calculate the line integral I = C F⃗ (⃗r) · dr.
R
R 2π 2π
Solution: We have I = 0 F⃗ (⃗r(t))·⃗r ′ (t) dt = 0 (− sin(t), cos(t))·(− sin(t), cos(t)) dt =
R
R 2π 2
0
sin (t) + cos2 (t) dt = 2π
Multivariable Calculus
20.4. Let ⃗r(t) be a curve given in polar coordinates as ⃗r(t) = [r(t), ϕ(t)] = [cos(t), t]
defined on the interval 0 ≤ t ≤ π. Let F⃗ be the vector field F⃗ (x, y) = [−xy, 0]. Calcu-
late the line integral C F⃗ · dr. ⃗ Solution: In Cartesian coordinates, the curve is ⃗r(t) =
R
[cos (t), cos(t) sin(t)]. The velocity vector is then ⃗r ′ (t) = [−2 sin(t) cos(t), − sin2 (t) +
2
20.5. The first generalization of the fundamental theorem of calculus to higher dimen-
sions is the fundamental theorem of line integrals.
20.6. In other words, the line integral is the potential difference between the end points
⃗r(b) and ⃗r(a), if F⃗ is a gradient field.
Examples
20.7. Let f (x, y, z) be the temperature distribution in a room and let ⃗r(t) the path
of a fly in the room, then f (⃗r(t)) is the temperature, the fly experiences at the point
⃗r(t) at time t. The change of temperature for the fly is dtd f (⃗r(t)). The line-integral of
the temperature gradient ∇f along the path of the fly coincides with the temperature
difference between the end point and initial point.
20.8. Here are some special cases: If ⃗r(t) is parallel to the level curve of f , then
d/dtf (⃗r(t)) = 0 because ⃗r ′ (t) is orthogonal to ∇f (⃗r(t)). If ⃗r(t) is orthogonal to the
level curve, then |d/dtf (⃗r(t))| = |∇f ||⃗r ′ (t)| because ⃗r ′ (t) is parallel to ∇f (⃗r(t)).
20.9. The proof of the fundamental theorem uses the chain rule in the second equality
and the fundamental theorem of calculus in the third equality of the following identities:
Z b Z b Z b
⃗ ′ ′ d
F (⃗r(t)) · ⃗r (t) dt = ∇f (⃗r(t)) · ⃗r (t) dt = f (⃗r(t)) dt = f (⃗r(b)) − f (⃗r(a)) .
a a a dt
Theorem: For a gradient field, the line-integral along any closed curve
is zero.
20.10. When is a vector field a gradient field? F⃗ (x, y) = ∇f (x, y) implies Py (x, y) =
Qx (x, y). If this does not hold at some point, F⃗ = [P, Q] is no gradient field. This is
called the Clairaut test. We will see later that the condition curl(F⃗ ) = Qx − Py = 0
and F⃗ being defined everywhere implies that the field is a gradient field
20.11. Let F⃗ (x, y) = [2xy 2 + 3x2 , 2yx2 ]. Find a potential f of F⃗ = [P, Q].
Solution: The potential function f (x, y) satisfies fx (x, y) = 2xy 2 + 3x2 and fy (x, y) =
2yx2 . Integrating the second equation gives f (x, y) = x2 y 2 + h(x). Partial differentia-
tion with respect to x gives fx (x, y) = 2xy 2 + h′ (x) which should be 2xy 2 + 3x2 so that
3 2 2 3
we can takeR x h(x) = x . The potential function is f (x, y) = x y + x . Find g, h from
f (x, y) = 0 P (x, y) dx + h(y) and fy (x, y) = g(x, y).
20.13. A device which implements a non gradient force field is called a perpetual
motion machine. It realizes a force field for which the energy gain is positive along
some closed loop. The first law of thermodynamics forbids the existence of such a
machine. It is informative to contemplate some of the ideas people have come up and
to analyze why they don’t work. Here is an example: consider a O-shaped pipe which
is filled only on the right side with water. A wooden ball falls on the right hand side in
the air and moves up in the water. You find plenty of other futile attempts on youtube.
Multivariable Calculus
Homework
This homework is due on Tuesday, 7/26/2022.
Problem 20.1: What is the work done by moving in the force field
F⃗ (x, y) = [6x2 + 2, 16y 7 ] along the parabola y = x2 from (−1, 1) to (1, 1)?
In part a) compute it directly. Then, in part b), use the theorem.
Problem 20.2: Let C be the space curve ⃗r(t) = [cos(t), sin(sin(t)), 5t] for
t ∈ [0, π] and let F⃗ (x, y, z) = [y, x, 15 + cos(21z)]. Find the value of the
⃗
line integral C F⃗ · dr.
R
Problem 20.3: Let F⃗ be the vector field F⃗ (x, y) = [−y, x]/2. Compute
the line integral of F⃗ along an ellipse ⃗r(t) = [a cos(t), b sin(t)] with width
2a and height 2b. The result should depend on a and b.
Problem 20.4: It is hot and you refresh yourself in a little pool in your
garden. Its rim has the shape x40 + y 40 = 1 oriented counter clockwise.
There is a hose filling in fresh water to the tub so that there is a velocity
field F⃗ (x, y) = [2x + 5y, 10y 4 + 5x] inside. Calculate the line integral
⃗ the energy you gain from the fluid force when dislocating from
F⃗ · dr,
R
C
(1, 0) to (0, 1) along the rim. Remember you are in a pool and do not
want to work hard. There is an easy way to get the answer.
Problem 20.5: Find a closed curve C : ⃗r(t) for which the vector field
F⃗ (x, y) = [P (x, y), Q(x, y)] = [xy, x2 ]
satisfies C F⃗ (⃗r(t)) · ⃗r ′ (t) dt ̸= 0.
R
MATH S-21A
Lecture
21.1. Multi-variable calculus in two dimensions has two derivatives ∇, curl and two
integral theorems: the fundamental theorem of line integrals as well as Green’s
theorem. You might be used to think about two-dimensions as the xy-plane in three
space, but we insist on remaining two dimensional. 1
21.2. The curl of a vector field F⃗ (x, y) = [P (x, y), Q(x, y)] is the scalar field curl(F⃗ )(x, y) =
∇ × F⃗ = Qx (x, y) − Py (x, y). It measures the vorticity of the vector field at (x, y).
For example, for F⃗ (x, y) = [x3 + y 2 , y 3 + x2 y], we have curl(F )(x, y) = 2xy − 2y.
Theorem: Green’s theorem tells that if F⃗ (x, y) = [P (x, y), Q(x, y)]
is a vector field and G is a region for which the boundary C is a curve,
parametrized so that G is “to the left”, then
Z ZZ
⃗ ⃗
F · dr = curl(F⃗ ) dxdy .
C G
21.3. Take a square G = [x, x + h] × [y, y + h] with small h > 0. The line integral of
Rh Rh Rh
F⃗ = [P, Q] along the boundary is 0 P (x + t, y)dt + 0 Q(x + h, y + t) dt − 0 P (x +
Rh
t, y + h) dt − 0 Q(x, y + t) dt. It measures the “circulation” at the position (x, y).
Because Q(x + h, y) − Q(x, y) ∼ Qx (x, y)h and P (x, y + h) − P (x, y) ∼ Py (x, y)h, the
RhRh
line integral is (Qx − Py )h2 is 0 0 curl(F⃗ ) dxdy with an error of the order h3 . Now
take a region G with area |G| and chop it into small squares of size h. We need about
|G|/h2 such squares. Summing up all the line integrals around the boundaries is the
sum of the line integral along the boundary of G because of the cancellations in the
interior. On the boundary, it is a Riemann sum of the line integral along the boundary.
The sumRRof the curls of the squares is a Riemann sum approximation of the double
integral G curl(F⃗ ) dxdy. Taking the limit h → 0 gives Greens theorem.
1Think about two dimensions as if you were a flat-lander unaware about the third dimension. If
we speak about “the plane”, it is our universe and we are ignorant about 3 space. Edwin Abbot’s
Flatland is a 1884 romance plays in two dimensions.
Multivariable Calculus
21.4. George Green lived from 1793 to 1841. Unfortunately, we don’t have a single
picture of him. He was a physicist, a self-taught mathematician as well as a miller. His
work greatly contributed to modern physics.
⃗ ⃗
21.5. A special case R is if F is a gradient field F = ∇f . Then, both sides of Green’s
theorem are zero: C F⃗ · dr ⃗ is zero by the fundamental theorem for line integrals. And
curl(F⃗ ) · dA is zero because curl(F⃗ ) = curl(grad(f )) = 0.
RR
G
21.6. If F⃗ (x, y) = ∇f is a gradient field then the curl is zero because if P (x, y) =
fx (x, y), Q(x, y) = fy (x, y) and curl(F⃗ ) = Qx − Py = fyx − fxy = 0 by Clairaut. The
field F⃗ (x, y) = [x + y, yx] for example is not a gradient field because curl(F⃗ ) = y − 1.
curl(grad(f )) = 0
21.9. It had been a consequence of the fundamental theorem of line integrals that:
Examples
21.12. Problem: Find the line integral of F⃗ (x, y) = [x2 − y 2 , 2xy] = [P, Q] along the
boundary of the rectangle [0, 2] × [0, 1]. Solution: curl(F⃗ ) = Qx − Py = 2y + 2y = 4y
⃗ = 2 1 4y dydx = 2y 2 |1 x|2 = 4.
so that C F⃗ dr
R R R
0 0 0 0
21.16. Let G be the region below the graph of a function f (x) on [a, b]. The line
integral around the boundary of G is 0 from (a, 0) to (b, 0) because F⃗ (x, y) = [0, 0] there.
The line integral is also zero from (b, 0) to (b, f (b)) and (a, f (a)) to (a, 0) because P = 0.
Rb Rb
The line integral along the curve (t, f (t)) is − a [−y(t), 0] · [1, f ′ (t)] dt = a f (t) dt.
Green’s theorem confirms that this is the area of the region below the graph.
21.17. An engineering application is the planimeter, a mechanical device for mea-
suring areas. We demonstrate it in class. Historically it had been used in medicine to
measure the size of the cross-sections of tumors, in biology to measure the area of leaves
or wing sizes of insects, in agriculture to measure the area of forests, in engineering to
measure the size of profiles. There is a vector field F⃗ associated to the device which
is obtained by placing a unit vector perpendicular to the arm). One can prove that F⃗
has vorticity 1. The planimeter calculates the line integral of F⃗ along a given curve.
Green’s theorem assures this is the area.
Homework
Multivariable Calculus
Problem 21.2: Find the area of the region bounded by the hypocycloid
⃗r(t) = [cos3 (t), sin3 (t)], 0 ≤ t ≤ 2π.
Problem 21.4: Let C be the boundary curve of the white Yang part of
the Ying-Yang symbol in the disc of radius 6. You can see in the image
that the curve C has three parts, and that the orientation of each part is
given. Find the line integral of the vector field F⃗ (x, y) = [−y + sin(ex ), 5x]
around C.
R √
Problem 21.5: Use Green’s Theorem to evaluate C [sin( 1 + x7 ) +
21y, 121x] · d⃗r, where C is the boundary of the region K(4). You see in
the picture K(0), K(1), K(2), K(3), K(4). The first K(0) is an equilateral
triangle of length 1. The second K(1) is K(0) with 3 equilateral triangles
of length 1/3 added. K(2) is K(1) with 3 ∗ 41 equilateral triangles of
length 1/9 added. Remark. We could now find the line integral in the
limit K = K(∞), a fractal called the Koch snowflake It has dimension
log(4)/ log(3) = 1.26 . . . which is between 1 and 2.
MATH S-21A
Lecture
22.1. In two dimensions, the curl of F⃗ was the scalar field curl(F⃗ ) = Qx − Py . By
Green’s theorem, the curl evaluated at (x, y) is limr→0 Cr F⃗ dr/(πr2 ), where Cr is
R
a small circle of radius r oriented counter clockwise an centered at (x, y). Green’s
theorem explains that curl measures how the field “curls” or rotates. As rotations in
two dimensions are determined by a single angle, in three dimensions, three parameters
in the form of a vector are needed A direction of this vector tells the axes of rotation
and the magnitude tells the amount of rotation.
22.2. In Nabla calculus, this is written as curl(F⃗ ) = ∇ × F⃗ . Note that the third
component Qx − Py of the curl is for fixed z just the curl of the two-dimensional vector
field F⃗ = [P, Q]. While the curl in two dimensions is a scalar field, it is a vector field in
3 dimensions. In n dimensions, it would have n(n − 1)/2 components, the number of
2-dimensional coordinate planes. The curl measures the “vorticity” of the field. Each
of the components is the rotation projected onto one the three coordinate planes.
22.3. The curl is frequently visualized using a “paddle wheel”. If the rotation axes
points into direction ⃗v , the signed rotation speed is F⃗ · ⃗v . If the vector ⃗v is chosen
into the direction so that the wheel turns fastest, this is the direction of curl(F⃗ ). The
angular velocity of the wheel is the magnitude of the curl.
Multivariable Calculus
22.4. In two dimensions, we had two derivatives, the gradient and curl. In three
dimensions, there are now three fundamental derivatives: the gradient, the curl and
the divergence.
22.5. The divergence can also be defined in two dimensions, but it is not as funda-
mental because it is not an “exterior derivatives”. We want in d dimensions to have
d fundamental derivatives and d fundamental integrals and d fundamental theorems.
Distinguishing dimensions helps to organize the integral theorems. While Green looks
like Stokes, we urge you to look at it as a different theorem taking place in “flatland”.
It is a small matter but it is much clearer to have in every dimension d a separate
calculus. This prevents mixing up the theorems and makes things easier.
22.6. In two dimensions, the divergence can be written as the curl of a −90 degrees
⃗ = [Q, −P ] because div(G)
rotated field G ⃗ = Qx − Py = curl(F⃗ ). It measures the
“expansion” of the field F⃗ = [P, Q] If a field has zero divergence everywhere, the field
is called incompressible.
22.7. With the ”vector” ∇ = [∂x , ∂y , ∂z ], we can write curl(F⃗ ) = ∇ × F⃗ and div(F⃗ ) =
∇ · F⃗ . Rewriting formulas using the “Nabla vector” and using rules from geometry is
called Nabla calculus. This works both in 2 and 3 dimensions even so the ∇ vector
is not an actual vector but an operator. The following combination of divergence and
gradient often appears in physics:
Definition:
∆f = div(grad(f )) = fxx + fyy + fzz
is called the Laplacian of f . One can write ∆f = ∇2 f .
Examples
22.9. Question: Is there a vector field G⃗ such that F⃗ = [x + y, z, y 2 ] = curl(G)?
⃗
Answer: No, because div(F⃗ ) = 1 is incompatible with div(curl(G))
⃗ = 0.
22.10. Show that in simply connected region, every irrotational and incompressible
field can be written as a vector field F⃗ = grad(f ) with ∆f = 0. Proof. Since F⃗ is
irrotational, there exists a function f satisfying F = grad(f ). Fromdiv(F ) = 0 one has
divgrad(f ) = ∆f = 0.
In two dimensions, the divergence at a point (x, y) is the average flux of the field
through a small circle of radius r around the point in the limit when the radius of
the circle goes to zero.
We have now all the derivatives we need. In dimension d, there are d fundamental
derivatives.
1
grad
1 −→ 1
grad curl
1 −→ 2 −→ 1
grad curl div
1 −→ 3 −→ 3 −→ 1
Multivariable Calculus
Homework
This homework is due on Tuesday, 8/2/2022.
⃗ where S
RR
Problem 22.3: Evaluate the flux integral S
[0, 0, yz] · dS,
is the surface with parametric equation x = uv, y = u + v, z = u − v on
R : u2 + v 2 ≤ 4 and u > 0.
⃗ for
RR
Problem 22.4: Evaluate the flux integral S
curl(F ) · dS
F⃗ (x, y, z) = [3xy, 3yz, 3zx] .
where S is the part of the paraboloid z = 4 − x2 − y 2 that lies above the
square [0, 2] × [0, 2] and has an upward orientation.
Problem 22.5: a) What is the relation between the flux of the vector
field F⃗ = ∇g/|∇g| through the surface S : {g = 1} with g(x, y, z) =
x6 + y 4 + 2z 8 and the surface area of S?
⃗ = ∇g × [0, 0, 2] through the surface
b) Find the flux of the vector field G
S.
1
1Botha and b) do not need any computation. You can answer each question with one sentence. In
⃗ with dS in that case.
part a) compare F⃗ · dS
MULTIVARIABLE CALCULUS
MATH S-21A
Lecture
23.1. If a surface S is parametrized as ⃗r(u, v) = [x(u, v), y(u, v), z(u, v)] over a domain
R in the uv-plane, the flux integral of F⃗ through S is defined as the double integral
ZZ
F⃗ (⃗r(u, v)) · (⃗ru × ⃗rv ) dudv .
R
23.2. The boundary of S is a collection of closed curves. Each is oriented so that the
surface is to the “left” if the normal vector to the surface is pointing “up”. In other
words, the velocity vector ⃗v , a vector w
⃗ pointing towards the surface and the normal
vector ⃗n to the surface are right-handed.
23.3. Stokes theorem can be verified in the same way than Green’s theorem. Chop up
S into a collection of small triangles. As before, the sum of the fluxes through all these
triangles adds up to the flux through the surface and the sum of the line integrals along
the boundaries adds up to the line integral of the boundary of S. Stokes theorem for
a small triangle can be reduced to Green’s theorem because with a coordinate system
such that the triangle.
Examples
23.4. Let F⃗ (x, y, z) = [−y, x, 0] and let S be the upper hemisphere oriented upwards.
We have curl(F⃗ )(x, y, z) = [0, 0, 2]. The surface is parameterized by
⃗r(ϕ, θ) = [cos(θ) sin(ϕ), sin(θ) sin(ϕ), cos(ϕ)]
on R = [0, π/2] × [0, 2π] and ⃗rϕ × ⃗rθ = sin(ϕ)⃗r(ϕ, θ) so that curl(F⃗ )(x, y, z) · ⃗rϕ × ⃗rθ =
R π/2 R 2π
cos(ϕ) sin(ϕ)2. The integral 0 0
sin(2ϕ) dθdϕ = 2π.
The boundary C of S is parameterized by ⃗r(t) = ⃗ = ⃗r ′ (t)dt =
[cos(t), sin(t), 0] so that dr
2π
[− sin(t), cos(t), 0] dt and F⃗ (⃗r(t)) ⃗r ′ (t)dt = 0 sin(t)2 + cos2 (t) dt = 2π.
R R
23.6. For every surface bounded by a curve C, the flux of curl(F⃗ ) through the surface
is the same. Proof: the flux of the curl of a vector field through a surface S depends
only on the boundary of S. Compare this with the earlier statement that for every
curve between two points A, B the line integral of grad(f ) along C is the same. The
line integral of the gradient of a function of a curve C depends only on the end points
of C.
23.7. Electric and magnetic fields are linked by the Maxwell equation like curl(E) ⃗ =
− 1c Ḃ, anRRexample of a partial differential equation. If a closed wire C bounds a surface
S, then S B · dS is the flux of the magnetic field through S. Its change can be related
⃗ ·
RR RR RR
with a voltage using Stokes theorem: d/dt S B · dS = S Ḃ · dS = S −c curl(E)
⃗ = −c E ⃗ = U , where U is the voltage. If we change the flux of the magnetic
⃗ dr
R
dS C
field through the wire, then this induces a voltage. The flux can be changed by changing
the amount of the magnetic field but also by changing the direction. If we turn around
a magnet around the wire or the wire inside the magnet, we get an electric voltage.
This happens in a power-generator, like the alternator in a car. Stokes theorem explains
why we can generate electricity from motion.
23.8. The history of Stokes theorem is a bit hazy. 1. A version of Stokes theorem was
known by André Ampère in 1825. William Thomson (Lord Kelvin) mentioned the
theorem to Stokes in 1850). George Gabriel Stokes (1819-1903), who found parts
of the identity earlier 1840, formulated it in a prize exam from 1854 in which giving a
proof was one of the exam problems. The first published proof of Stokes theorem was
provided by Hermann Hankel in 1861.
1See V. Katz, the History of Stokes theorem, Mathematics Magazine 52, 1979, p 146-156
Multivariable Calculus
Homework
This homework is due on Tuesday, 8/2/2022.
Problem 23.2: Assume S is the surface x1000 + y 8000 +RRz 1000 = 1000000
and F⃗ = [9+ee , x8 yz, 3x−5y−6 cos(zx)]. Explain why S curl(F⃗ )·dS
xyz
⃗ =
0.
⃗ where
curl(F⃗ ) · dS,
RR
Problem 23.3: Evaluate the flux integral S
2 2 2 2
F⃗ (x, y, z) = [xey z 3 + 2xyzex +z , x + z 2 ex +z , yex +z + zex ]
and where S is the part of the ellipsoid x2 + y 2 /4 + (z + 1)2 = 2, z > 0
oriented so that the normal vector points upwards.
Problem 23.4: Find the line integral C F⃗ dr, ⃗ where C is the circle of
R
radius 5 in the xz-plane oriented counter clockwise when looking from the
point (0, 1, 0) onto the plane and where F⃗ is the vector field
F⃗ (x, y, z) = [x2 z + x5 , cos(ey ), −xz 2 + sin(sin(z)] .
Use a convenient surface S which has C as a boundary.
curl(F⃗ )·dS,
⃗ where F⃗ (x, y, z) =
RR
Problem 23.5: Find the flux integral S
MATH S-21A
Lecture
24.1. We have already seen the fundamental theorem of line integrals and Stokes
theorem. The divergence theorem completes the list of integral theorems in three
dimensions:
24.2. To see why this is true, take a small box [x, x + dx] × [y, y + dy] × [z, z + dz]. The
flux of F⃗ = [P, Q, R] through the faces perpendicular to the x-axes is [F⃗ (x + dx, y, z) ·
[1, 0, 0] + F⃗ (x, y, z) · [−1, 0, 0]]dydz = (P (x + dx, y, z) − P (x, y, z))dydz ∼ Px dxdydz.
Similarly, the flux through the y-boundaries is Py dydxdz and the flux through the
two z-boundaries is Pz dzdxdy. The total flux through the faces of the cube is
(Px + Qy + Rz ) dxdydz = div(F⃗ ) dxdydz. A general solid can be approximated as
a union of small cubes. The sum of the fluxes through all the cubes consists now
of the flux through all faces without neighboring faces. The fluxes through adjacent
sides cancel and only the flux through the boundary survives. RRR The sum of all the
div(F⃗ ) dxdydz is a Riemann sum approximation for the integral G
div(F⃗ ) dxdydz.
In the limit, when dx, dy, dz all go to zero, we obtain the divergence theorem.
Multivariable Calculus
24.3. The theorem explains what divergence means. If we integrate the divergence
over a small cube, it is equal the flux of the field through the boundary of the cube.
If this is positive, then more field exits the cube than entering the cube. There is field
“generated” inside. The divergence measures the “expansion” of the field.
Examples
24.4. Let F⃗ (x, y, z) = [x, y, z] and RRR
let S be the unit sphere. The divergence of F⃗ is the
⃗
constant function div(F ) = 3 and div(F⃗ ) dV = 3 · 4π/3 = 4π. The flux through
RR G
RR R π R 2π
the boundary is S ⃗r · ⃗ru × ⃗rv dudv = S |⃗r(u, v)|2 sin(v) dudv = 0 0 sin(v) dudv =
4π also. We see that the divergence theorem allows us to compute the area of the
sphere from the volume of the enclosed ball or compute the volume from the surface
area.
24.5. What is the flux of the vector field F⃗ (x, y, z) = [2x, 3z 2 + y, sin(x)] through the
solid G = [0, 3]×[0, 3]×[0, 3]\([0, 3]×[1, 2]×[1, 2]∪[1, 2]×[0, 3]×[1, 2]∪[0, 3]×[0, 3]×[1, 2])
which is a cube where three perpendicular cubic holes RRRhave been removed?RRR Solution:
Use the divergence theorem: div(F⃗ ) = 2 and so G
div( ⃗ ) dV = 2
F G
dV =
2Vol(G) = 2(27−7) = 40. Note that the flux integral here would be over a complicated
surface over dozens of rectangular planar regions.
24.6. Find the flux of curl(F⃗ ) through a torus if F⃗ = [yz 2 , z + sin(x) + y, cos(x)] and
the torus has the parametrization
⃗r(θ, ϕ) = [(2 + cos(ϕ)) cos(θ), (2 + cos(ϕ)) sin(θ), sin(ϕ)] .
Solution: The answer is 0 because the divergence of curl(F⃗ ) is zero. By the divergence
theorem, the flux is zero.
24.7. Similarly as Green’s theorem allowed us to calculate the area of a region by
passing along the boundary, the volume of a region can be computed as a flux integral:
Take for example the vector field F⃗ (x, y, z) = [x, 0, 0] which has divergence 1. The flux
of thisRR
vector field through the boundary of a solid region is equal to the volume of the
⃗ = Vol(G).
solid: δG [x, 0, 0] · dS
24.8. How heavy are we at distance r from the center of the earth?
Solution: The law of gravity can be formulated as div(F⃗ ) = 4πρ, where ρ is the mass
density. We assume that the earth is a ball of radius R. By rotational symmetry,
the gravitational force is normal to the surface: F⃗ (⃗x) = F⃗ (r)⃗x/||⃗x||. The flux of F⃗
⃗ = 4πr2 F⃗ (r). By the divergence theorem,
through a ball of radius r is Sr F⃗ (x) · dS
RR
RRR
this is 4πMr = 4π Br
ρ(x) dV , where Mr is the mass of the material inside Sr .
We have (4π) ρr /3 = 4πr2 F⃗ (r) for r < R and (4π)2 ρR3 /3 = 4πr2 F⃗ (r) for r ≥ R.
2 3
Inside the earth, the gravitational force F⃗ (r) = 4πρr/3. Outside the earth, it satisfies
F⃗ (r) = M/r2 with M = 4πR3 ρ/3.
1.0
0.8
0.6
0.4
0.2
24.9. We conclude with an overview over the integral theorems and give an other typ-
ical example in each case.
Multivariable Calculus
24.10. Remarks.
⃗ is zero.
R
1) For closed curves, the line integral C ∇f · dr
2) Gradient fields are path independent: if F⃗ = ∇f , then the line integral between
two points P and Q does not depend on the path connecting the two points.
3) The line integral theorem holds in any dimension. In one dimension, it reduces to
Rb
the fundamental theorem of calculus a f ′ (x) dx = f (b) − f (a)
4) The theorem justifies the name conservative for gradient vector fields.
5) The term “potential” was coined by George Green who lived from 1783-1841.
24.11. Example. Let f (x, y, z) = x2 + y 4 + z. Find the line integral of the vector
field F⃗ (x, y, z) = ∇f (x, y, z) along the path ⃗r(t) = [cos(5t), sin(2t), t2 ] from t = 0 to
t = 2π.
Solution. ⃗r(0) = [1, 0, 0] and ⃗r(2π) = [1, 0, 4π 2 ] and f (⃗r(0)) = 1 and f (⃗r(2π)) = 1 +
⃗ = f (r(2π)) − f (r(0)) =
R
4π 2 . The fundamental theorem of line integral gives C ∇f dr
2
4π .
24.12. Remarks.
1) Greens theorem allows to switch from double integrals to one-dimensional integrals.
2) The curve is oriented in such a way that the region is to the left.
3) The boundary of the curve can consist of piecewise smooth pieces.
Rb
4) If C : t 7→ ⃗r(t) = [x(t), y(t)], the line integral is a [P (x(t), y(t)), Q(x(t), y(t))] ·
[x′ (t), y ′ (t)] dt.
5) Green’s theorem was found by George Green (1793-1841) in 1827 and by Mikhail
Ostrogradski (1801-1862).
6) If curl(F⃗ ) = 0 in a simply connected region, then the line integral along a closed
curve is zero. If two curves connect two points then the line integral along those curves
agrees.
7) Taking F⃗ (x, y) = [−y, 0] or F⃗ (x, y) = [0, x] gives area formulas.
24.13. Example. Find the line integral of the vector field F⃗ (x, y) = [x4 + sin(x) +
y, x + y 3 ] along the path ⃗r(t) = [cos(t), 5 sin(t) + log(1 + sin(t))], where t runs from
t = 0 to t = π/2.
Solution. curl(F⃗ ) = 0 implies that the line integral depends only on the end points
′
R 1 4⃗r(t) = [−t, 0], −1 ≤ t ≤ 1, which
(1, 0), (0, 5) of the path. Take the simpler path
5 1
has
velocity ⃗r (t) = [−1, 0]. The line integral is −1 [t − sin(t), −t] · [−1, 0] dt = −t /5|−1 =
−2/5.
24.14. Remarks.
1) Stokes theorem allows to derive Greens theorem: if F⃗ is z-independent and the
surface S is contained in the xy-plane, one obtains the result of Green.
2) The orientation of C is such that if you walk along C and have your head in the
direction of the normal vector ⃗ru × ⃗rv , then the surface to your left.
3) Stokes theorem was found by André Ampère (1775-1836) in 1825 and rediscovered
by George Stokes (1819-1903).
4) The flux of the curl of a vector field does not depend on the surface S, only on the
boundary of S.
5) The flux of the curl through a closed surface like the sphere is zero: the boundary
of such a surface is empty.
24.15. Example. Compute the line integral of F⃗ (x, y, z) = [x3 + xy, y, z] along the
polygonal path C connecting the points (0, 0, 0), (2, 0, 0), (2, 1, 0), (0, 1, 0) in that order.
Solution. The path C bounds a surface S : ⃗r(u, v) = [u, v, 0] parameterized by
R = [0, 2] × [0, 1]. By Stokes theorem, the line integral is equal to the flux of
curl(F⃗ )(x, y, z) = [0, 0, −x] through S. The normal vector of S is ⃗ru × ⃗rv = [1, 0, 0] ×
⃗ = 2 1 [0, 0, −u]·[0, 0, 1] dudv = 2 1 −u dudv =
[0, 1, 0] = [0, 0, 1] so that S curl(F⃗ ) dS
RR R R R R
0 0 0 0
−2.
Multivariable Calculus
24.16. Remarks.
1) The divergence theorem is also called Gauss theorem.
2) It is useful to determine the flux of vector fields through surfaces.
3) It can be used to compute volume.
4) It was discovered in 1764 by Joseph Louis Lagrange (1736-1813), later it was redis-
covered by Carl Friedrich Gauss (1777-1855) and by George Green.
5) For divergence free vector fields F⃗ , the flux through a closed surface is zero. Such
fields F⃗ are also called incompressible or source free.
24.17. Example. Compute the flux of the vector field F⃗ (x, y, z) = [−x, y, z 2 ] through
the boundary S of the rectangular box [0, 3] × [−1, 2] × [1, 2].
Solution. ByRGauss theorem, the flux is equal to the triple integral of div(F ) = 2z
3R2 R2
over the box: 0 −1 1 2z dxdydz = (3 − 0)(2 − (−1))(4 − 1) = 27.
24.18. How do these theorems fit together? In n-dimensions, there are n theorems.
We have here seen the situation in dimension n = 2 and n = 3, but one could continue.
The fundamental theorem of line integrals generalizes directly to higher dimensions.
Also the divergence theorem generalizes directly to n dimensions. The generalization
of curl and flux would need more explanation as for n = 4 already, the curl of a vector
field is a 6-dimensional object. It is a n(n − 1)/2 dimensional object in general.
1
FTC
1 −→ 1
FTL Green
1 −→ 2 −→ 1
FTL Stokes Gauss
1 −→ 3 −→ 3 −→ 1
24.19. In one dimension, there is one derivative: f (x) → f ′ (x). It maps scalar func-
tions to scalar functions. It corresponds to the entry 1 − 1 in the Pascal triangle. The
next entry 1 − 2 − 1 corresponds to differentiation in two dimensions, where we have
the gradient f → ∇f mapping a scalar function to a vector field with 2 components as
well as the curl, F → curl(F ) which corresponds to the transition 2 − 1 going back to a
scalar function. The situation in three dimensions is captured by the entry 1 − 3 − 3 − 1
in the Pascal triangle. The first derivative 1 − 3 is the gradient. The second derivative
3 − 3 is the curl and the third derivative 3 − 1 is the divergence which gives again a
scalar. In n = 4 dimensions, we would have to look at 1 − 4 − 6 − 4 − 1. The first
derivative 1 − 4 is still the gradient. Then we have a first curl, which maps a vector
field with 4 components into an object with 6 components. Then there is a second
curl, which maps an object with 6 components back to a vector field, we would have
to look at 1 − 4 − 6 − 4 − 1.
24.20. When setting up calculus in dimension n, one talks about differential forms
instead of scalar fields or vector fields. Functions are 0 forms or n-forms. Vector fields
can be described by 1 or n − 1 forms. The general formalism defines a derivative d
called exterior derivative on differential forms. It maps k forms to k+1 forms. There
is also an integration of k-forms on k-dimensional objects. The boundary operation
δ which maps a k-dimensional object into a k − 1 dimensional object. This boundary
operation is dual to differentiation. They both satisfy the same relation dd(F ) = 0 and
δδG = 0. Differentiation and integration are linked by the general Stokes theorem:
Z Z
F = dF
δG G
24.21. One can see this as a single theorem, the fundamental theorem of multi-
variable calculus. The theorem is simpler in quantum calculus, where geometric
objects and fields are on the same footing. There are various ways how one can gen-
eralize this. One way is to write it as < δG, F >=< G, dF > which in linear algebra
would be written as [AT v, w] = [v, Aw], where AT is the transpose of a matrix A [v, w]
is the dot product. Since traditional calculus we deal with ”smooth” functions and
fields, we have to pay a price and consider in turn ”singular” objects like points or
curves and surfaces. These are idealized objects which have zero diameter, radius or
thickness.
24.22. So, it is all about geometries and fields. Geometries are curves, or surfaces
or solids. Fields are scalar functions or vector fields. Geometries G can be “dif-
ferentiated” by taking the boundary δG. Fields F can be differentiated by applying
differential operators dF like grad, curl or div. And then there Ris integration
R which
pairs up geometries G and fields F . The fundamental theorem δG F = G dF tells
that taking the boundary on the object is dual to taking the derivative of the field.
24.23. Nature likes simplicity and elegance 1 and therefore found a quantum mathe-
matics to be more fundamental. But a geometry in which geometries and fields are
indistinguishable manifests only in the very small.
1Leibniz: 1646-1716
Multivariable Calculus
Homework
This homework is due on Tuesday, 8/2/2022.
Problem 24.2: Find the flux of the vector field F⃗ (x, y, z) = [xy, yz, zx]
through the cylinder x2 + y 2 ≤ 1, 0 ≤ z ≤ 2 without the bottom disk
z = 0. Hint: close the surface first and then also find the flux through the
bottom.