Multivariable Calculus Notes - MIT OCW
Multivariable Calculus Notes - MIT OCW
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 1. – Thu, Sept 6, 2007
Handouts: syllabus; PS1; flashcards.
Goal of multivariable calculus: tools to handle problems with several parameters – functions of
several variables.
Vectors. A vector (notation: A � ) has a direction, and a length (|A � |). It is represented by
a directed line segment. In a coordinate system it’s expressed by components: in space, A � =
�a1 , a2 , a3 � = a1 ı̂ + a2 ĵ + a3 k̂. (Recall in space x-axis points to the lower-left, y to the right, z up).
Scalar multiplication
Formula for length? Showed√picture of �3, 2, 1� and used flashcards to ask for its length. Most
students got the right answer ( 14).
� | = a2 + a2 + a2 by reducing to the Pythagorean theorem in the
�
You can explain why |A 1 2 3
plane (Draw a picture, showing A � and its projection to the xy-plane, then derived |A
� | from length
of projection + Pythagorean theorem).
Vector addition: A � +B� by head-to-tail addition: Draw a picture in a parallelogram (showed how
� �
the diagonals are A + B and B � −A� ); addition works componentwise, and it is true that
A� = 3ı̂ + 2ĵ + k̂ on the displayed example.
Dot product.
�·B
Definition: A � = a1 b1 + a2 b2 + a3 b3 (a scalar, not a vector).
�·B
Theorem: geometrically, A � = |A � ||B
� | cos θ.
Explained the theorem as follows: first, A � ·A� = |A
� |2 cos 0 = |A � |2 is consistent with the definition.
Next, consider a triangle with sides A �, B
�, C � = A�−B � . Then the law of cosines gives |C � |2 =
� |2 + |B
|A � |2 − 2|A
� ||B
� | cos θ, while we get
|C� |2 = C
� ·C� = (A�−B � ) · (A
�−B � ) = |A � |2 + |B|
� 2 − 2A� · B.
�
Hence the theorem is a vector formulation of the law of cosines.
�·B
A �
Applications. 1) computing lengths and angles: cos θ = .
� ||B
|A �|
Example: triangle in space with vertices P = (1, 0, 0), Q = (0, 1, 0), R = (0, 0, 2), find angle at P :
−−→ −−→
PQ · PR �−1, 1, 0� · �−1, 0, 2� 1
cos θ = −−→ −−→ = √ √ =√ , θ ≈ 71.5◦ .
|P Q ||P R | 2 5 10
Note the sign of dot product: positive if angle less than 90◦ , negative if angle more than 90◦ ,
zero if perpendicular.
2) detecting orthogonality.
Example: what is the set of points where x + 2y + 3z = 0? (possible answers: empty set, a point,
a line, a plane, a sphere, none of the above, I don’t know).
Answer: plane; can see “by hand”, but more geometrically use dot product: call A � = �1, 2, 3�,
−
−→
� · OP = x + 2y + 3z = 0 ⇔ |A|| −
−→
� OP | cos θ = 0 ⇔ θ = π/2 ⇔ A �⊥− −→
P = (x, y, z), then A OP . So we
get the plane through O with normal vector A �.
1
2
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 3. – Tue, Sept 11, 2007
Remark: A × B = −B × A, A × A = 0.
Application of cross product: equation of plane through P1 , P2 , P3 : P = (x, y, z) is in the
−− −−−→ −−−→ −−→
plane iff det(P1 P , P1 P2 , P1 P3 ) = 0, or equivalently, P1 P · N = 0, where N is the normal vector
−−−→ −−−→
N = P1 P2 × P1 P3 . I explained this geometrically, and showed how we get the same equation both
ways.
Matrices. Often quantities are related by linear transformations; e.g. changing coordinate
systems, from P = (x1 , x2 , x3 ) to something more adapted to the problem, with new coordinates
(u1 , u2 , u3 ). For example ⎧
⎨ u1 = 2x1 + 3x2 + 3x3
u2 = 2x1 + 4x2 + 5x3
u3 = x1 + x2 + 2x3
⎩
⎡ ⎤⎡ ⎤ ⎡ ⎤
2 3 3 x1 u1
Rewrite using matrix product: ⎣ 2 4 5 ⎦ ⎣ x2 ⎦ = ⎣ u2 ⎦, i.e. AX = U .
1 1 2 x3 u3
Entries in the matrix product = dot product between rows of A and columns of X. (here we
multiply a 3x3 matrix by a column vector = 3x1 matrix).
More generally, matrix multiplication AB:
⎡ ⎤
⎡ ⎤ . 0 ⎡ ⎤
1 2 3 4 ⎢ . 14
⎣ . . . . ⎦⎢ . 3 ⎥ = ⎣ .
⎥
⎣ . 0 ⎦ . ⎦
. . . . . .
. 2
(Also explained one can set up A to the left, B to the top, then each entry of AB = dot product
between row to its left and column above it).
Note: for this to make sense, width of A must equal height of B.
What AB means: BX = apply transformation B to vector X, so (AB)X = A(BX) = apply
first B then A. (so matrix multiplication is like composing transformations, but from right to left!)
(Remark: matrix product is not commutative, AB is in general not the same as BA – one of the
two need not even make sense if sizes not compatible).
⎡ ⎤
1 0 0
Identity matrix: identity transformation IX = X. I3×3 = ⎣ 0 1 0 ⎦
0 0 1
� �
0 −1
Example: R = = plane rotation by 90 degrees counterclockwise.
1 0
Rı̂ = ĵ, Rĵ = −ı̂, R2 = −I.
Inverse matrix. Inverse of a matrix A (necessarily square) is a matrix M = A−1 such that
AM = M A = In .
A−1 corresponds to the reciprocal linear relation.
E.g., solution to linear system AX = U : can solve for X as function of U by X = A−1 U .
1
2
Cofactor method to find A−1 (efficient for small matrices; for large matrices computer software
uses other algorithms): A−1 = det(1A) adj(A) (adj(A) = “adjoint matrix”).
⎡ ⎤
2 3 3
Illustration on example: starting from A = ⎣ 2 4 5 ⎦
1 1 2
⎡ 1) matrix of⎤minors (= determinants formed by deleting one row and one column from A):
3 −1 −2 �
� 4 5 �
�
⎣ 3 1 −1 (e.g. top-left is �
⎦ � � = 3).
1 2 �
3 4 2
⎡ ⎤
+ − + 3 +1 −2
2) cofactors = flip signs according to checkerboard diagram − + − : get ⎣ −3 1 +1 ⎦
+ − + 3 −4 2
3) transpose = exchange
⎡ rows / columns ⎤ (read horizontally, write vertically) get the adjoint
3 −3 3
matrix M T = adj(A) = ⎣ 1 1 −4 ⎦
−2 1 2
⎡ ⎤
3 −3 3
1
4) divide by det(A) (here = 3): get A−1 = ⎣ 1 1 −4 ⎦.
3 −2 1 2
So, to find the equation of a plane, we really need to look for the normal vector N ; we can e.g.
find it by cross-product of 2 vectors that are in the plane.
Flashcard question: the vector v = �1, 2, −1� and the plane x + y + 3z = 5 are 1) parallel, 2)
perpendicular, 3) neither?
(A perpendicular vector would be proportional to the coefficients, i.e. to �1, 1, 3�; let’s test if
it’s in the plane: equivalent to being ⊥ N . We have v · N = 1 + 2 − 3 = 0 so v is parallel to
the plane.)
Interpretation of 3x3 systems. A 3x3 system asks for the intersection of 3 planes. Two
planes intersect in a line, and usually the third plane intersects it in a single point (picture shown).
The unique solution to AX = B is given by X = A−1 B.
3
Exception: if the 3rd plane is parallel to the line of intersection of the first two? What can
happen? (asked on flashcards for possibilities).
If the line P1 ∩ P2 is contained in P3 there are infinitely many solutions (the line); if it is
parallel to P3 there are no solutions. (could also get a plane of solutions if all three equations
are the same)
These special cases correspond to systems with det(A) = 0. Then we can’t invert A to solve the
system: recall A−1 = det(1A) adj(A). Theorem: A is invertible ⇔ det A �= 0.
Homogeneous systems: AX = 0. Then all 3 planes pass through the origin, so there is the
obvious (”trivial”) solution X = 0. If det A = � 0 then this solution is unique: X = A−1 0 = 0.
Otherwise, if det A = 0 there are infinitely many solutions (forming a line or a plane).
Note: det A = 0 means det(N 1 , N 2 , N 3 ) = 0, where N i are the normals to the planes Pi . This
means the parallelepiped formed by the N i has no area, i.e. they are coplanar (showed picture of 3
planes intersecting in a line, and their coplanar normals). The line of solutions is then perpendicular
to the plane containing N i . For example we can get a vector along the line of intersection by taking
a cross-product N 1 × N 2 .
General systems: AX = B: compared to AX = 0, all the planes are shifted to parallel
positions from their initial ones. If det A �= 0 then unique solution is X = A−1 B. If det A = 0,
either there are infinitely many solutions or there are no solutions.
(We don’t have tools to decide whether it’s infinitely many or none, although elimination will
let us find out).
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 6. – Tue, Sept 18, 2007
Handouts: Practice exams 1A and 1B.
Velocity and acceleration. Last time: position vector �r(t) = x(t)ı̂ + y(t)ĵ [+z(t)k̂].
E.g., cycloid: �r(t) = �t − sin t, 1 − cos t�.
d�r dx dy
Velocity vector: �v (t) = = � , �. E.g., cycloid: �v (t) = �1 − cos t, sin t�. (at t = 0, �v = �0:
dt dt dt
translation and rotation motions cancel out, while at t = π they add up and �v = �2, 0�).
� √
Speed (scalar): |�v |. E.g., cycloid: |�v | = (1 − cos t)2 + sin2 t = 2 − 2 cos t. (smallest at
t = 0, 2π, ..., largest at t = π).
d�v
Acceleration: �a(t) = . E.g., cycloid: �a(t) = �sin t, cos t� (at t = 0 �a = �0, 1� is vertical).
dt
r|
d|�
Remark: the speed is | d� r
dt |, which is NOT the same as dt !
ds
Arclength, unit tangent vector. s = distance travelled along trajectory. = speed = |�v |.
dt
Can recover length of trajectory by integrating ds/dt, but this is not always easy... e.g. the length
� 2π √
of an arch of cycloid is 0 2 − 2 cos t dt (can’t do).
�v d�r d�r ds ds
Unit tangent vector to trajectory: Tˆ = . We have: = = Tˆ = Tˆ|�v |.
|�v | dt ds dt dt
In interval Δt: Δ�r ≈ T̂ Δs, dividing both sides by Δt and taking the limit Δt → 0 gives us the
above identity.
Kepler’s 2nd law. (illustration of efficiency of vector methods) Kepler 1609, laws of planetary
motion: the motion of planets is in a plane, and area is swept out by the line from the sun to the
planet at a constant rate. Newton (about 70 years later) explained this using laws of gravitational
attraction.
Kepler’s law in vector form: area swept out in Δt is area ≈ 12 |�r × Δ�r| ≈ 12 |�r × �v | Δt
d
So dt (area) = 12 |�r × �v | is constant.
Also, �r × �v is perpendicular to plane of motion, so dir(�r × �v) = constant. Hence, Kepler’s 2nd
law says: �r × �v = constant.
The usual product rule can be used to differentiate vector functions: dt d
(�a · �b), dt
d
(�a × �b), being
careful about non-commutativity of cross-product.
d d�r d�v
(�r × �v ) = × �v + �r × = �v × �v + �r × �a = �r × �a.
dt dt dt
So Kepler’s law ⇔ �r × �v = constant ⇔ �r × �a = 0 ⇔ �a//�r ⇔ the force F� is central.
(so Kepler’s law really means the force is directed //�r; it also applies to other central forces –
e.g. electric charges.)
18.02 Lecture 7. – Thu, Sept 20, 2007
Handouts: PS2 solutions, PS3.
Review. Material on the test = everything seen in lecture. The exam is similar to the practice
exams, or very slightly harder. The main topics are (Problem numbers refer to Practice 1A):
�
1) vectors, dot product. A · B = |A||B| cos θ = ai bi . Finding angles. (e.g. Problem 1.)
1
2
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 8. – Tue, Sept 25, 2007
Is it a max, min or saddle? (pictures shown of each type). Systematic answer: next lecture.
For today: observe f = (x − y)2 + 2y 2 + 2x − 2y = (x − y + 1)2 + 2y 2 − 1 ≥ −1, so minimum.
Least squares.
Set up problem: experimental data (xi , yi ) (i = 1, . . . , n), want to find a best-fit line y = ax + b
(the unknowns here are a, b, not x, y!)
Deviations: yi − (axi + b); want to minimize the total square deviation D = i (yi − (axi + b))2 .
�
∂D ∂D
= 0 and = 0 leads to a 2 × 2 linear system for a and b (done in detail as in Notes LS):
∂a ∂b
�� � �� � �
x2i a + xi b = xi yi
�� � �
xi a + nb = yi
Goal: determine type of a critical point, and find the global min/max.
Note: global min/max may be either at a critical point, or on the boundary of the domain/at
infinity.
We start with the case of w = ax2 + bxy + cy 2 , at (0, 0).
Example from Tuesday: w = x2 −2xy+3y 2 : completing the square, w = (x−y)2 +2y 2 , minimum.
b b b2 1 b
If a �= 0, then w = a(x2 + xy)+cy 2 = a(x+ y)2 +(c− )y 2 = (4a2 (x+ y)2 +(4ac−b2 )y 2 ).
a 2a 4a 4a 2a
3 cases: if 4ac − b2 > 0, same signs, if a > 0 then minimum, if a < 0 then maximum; if
4ac − b2 < 0, opposite signs, saddle; if 4ac − b2 = 0, degenerate case.
� x x
This is related to the quadratic formula: w = y 2 a( )2 + b( ) + c .
�
y y
2 2
If b −4ac < 0 then no roots, so at +bt+c has a constant sign, and w is either always nonnegative
or always nonpositive (min or max). If b2 − 4ac > 0 then at2 + bt + c crosses zero and changes sign,
so w can have both signs, saddle.
General case: second derivative test.
∂2f
We look at second derivatives: fxx = , fxy , fyx , fyy . Fact: fxy = fyx .
∂x2
Given f and a critical point (x0 , y0 ), set A = fxx (x0 , y0 ), B = fxy (x0 , y0 ), C = fyy (x0 , y0 ), then:
– if AC − B 2 > 0 then: if A > 0 (or C), local min; if A < 0, local max.
– if AC − B 2 < 0 then saddle.
3
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 11. – Tue, Oct 2, 2007
Differentials.
Recall in single variable calculus: y =√f (x) ⇒ dy = f � (x) dx. Example: y = sin−1 (x) ⇒ x = sin y,
dx = cos y dy, so dy/dx = 1/ cos y = 1/ 1 − x2 .
Total differential: f = f (x, y, z) ⇒ df = fx dx + fy dy + fz dz.
This is a new type of object, with its own rules for manipulating it (df is not the same as Δf !
The textbook has it wrong.) It encodes how variations of f are related to variations of x, y, z. We
can use it in two ways:
1. as a placeholder for approximation formulas: Δf ≈ fx Δx + fy Δy + fz Δz.
2. divide by dt to get the chain rule: if x = x(t), y = y(t), z = z(t), then f becomes a function
df dx dy dz
of t and = fx + fy + fz
dt dt dt dt
Example: w = x2 y + z, dw = 2xy dx + x2 dy + dz. If x = t, y = et , z = sin t then the chain rule
gives dw/dt = (2tet ) 1 + (t2 ) et + cos t, same as what we obtain by substitution into formula for w
and one-variable differentiation.
Can justify the chain rule in 2 ways:
1. dx = x� (t) dt, dy = y � (t) dt, dz = z � (t) dt, so substituting we get dw = fx dx + fy dy + fz dz =
fx x� (t) dt + fy y � (t) dt + fz z � (t) dt, hence dw/dt.
2. (more rigorous): Δw � fx Δx + fy Δy + fz Δz, divide both sides by Δt and take limit as
Δt → 0.
Applications of chain rule:
Product and quotient formulas for derivatives: f = uv, u = u(t), v = v(t), then d(uv)/dt =
fu u� + fv v � = vu� + uv � . Similarly with g = u/v, d(u/v)/dt = gu u� + gv v � = (1/v) u� + (−u/v 2 ) v � =
(u� v − uv � )/v 2 .
Chain rule with more variables: for example w = f (x, y), x = x(u, v), y = y(u, v). Then
dw = fx dx + fy dy = fx (xu du + xv dv) + fy (yu du + yv dv) = (fx xu + fy yu ) du + (fx xv + fy yv ) dv.
Identifying coefficients of du and dv we get ∂f /∂u = fx xu + fy yu and similarly for ∂f /∂v.
It's not legal to “simplify by ∂x”.
Example: polar coordinates: x = r cos θ, y = r sin θ. Then fr = fx xr + fy yr = cos θ fx + sin θ fy ,
and similarly fθ .
1
2
Proof: take a curve �r = �r(t) contained inside level surface w = c. Then velocity �v = d�r/dt is in
the tangent plane, and by chain rule, dw/dt = �w · d�r/dt = 0, so �v ⊥ �w. This is true for every �v
in the tangent plane.
Application: tangent plane to a surface. Example: tangent plane to x2 + y 2 − z 2 = 4 at (2, 1, 1):
gradient�is �2x, 2y, −2z� = �4, 2, −2�; tangent plane is 4x + 2y − 2z = 8. (Here we could also solve
for z = x2 + y 2 − 4 and use linear approximation formula, but in general we can’t.)
(Another way to get the tangent plane: dw = 2x dx + 2y dy − 2z dz = 4dx + 2dy − 2dz. So
Δw ≈ 4Δx + 2Δy − 2Δz. The level surface is Δw = 0, its tangent plane approximation is
4Δx + 2Δy − 2Δz = 0, i.e. 4(x − 2) + 2(y − 1) − 2(z − 1) = 0, same as above).
Directional derivative. Rate of change of w as we move (x, y) in an arbitrary direction.
Take a unit vector û = �a, b�, and look at straight line trajectory �r(s) with velocity û, given by
x(s) = x0 + as, y(s) = y0 + bs. (unit speed, so s is arclength!)
dw
Notation: .
ds |û
Geometrically: slice of graph by a vertical plane (not parallel to x or y axes anymore). Directional
derivative is the slope. Shown on applet (Functions of two variables), with w = x2 + y 2 + 1, and
rotating slices through a point of the graph.
dw d�r
Know how to calculate dw/ds by chain rule: = �w · = �w · û.
ds |û ds
Geometric interpretation: dw/ds = �w · û = |�w| cos θ. Maximal for cos θ = 1, when û is in
direction of �w. Hence: direction of �w is that of fastest increase of w, and |�w| is the directional
derivative in that direction. We have dw/ds = 0 when û ⊥ �w, i.e. when û is tangent to direction
of level surface.
18.02 Lecture 13. – Fri, Oct 5, 2007 (estimated – written before lecture)
Practice exams 2A and 2B are on course web page.
Lagrange multipliers.
Problem: min/max when variables are constrained by an equation g(x, y, z) = c.
�
Example: find point of xy = 3 closest to origin ? I.e. minimize x2 + y 2 , or better f (x, y) =
x2 + y 2 , subject to g(x, y) = xy = 3. Illustrated using Lagrange multipliers applet.
Observe on picture: at the minimum, the level curves are tangent to each other, so the normal
vectors �f and �g are parallel.
So: there exists λ (“multiplier”) such that �f = λ�g. We replace the constrained min/max
problem in 2 variables with equations involving 3 variables x, y, λ:
⎧ ⎧
⎨fx = λgx
⎪ ⎨2x = λy
⎪
fy = λgy i.e. here 2y = λx
⎪ ⎪
g=c xy = 3.
⎩ ⎩
3
�
2x − λy = 0
In general solving may be hard and require a computer. Here, linear algebra:
−λx + 2y = 0
2
requires either x = y = 0 (impossible,
√ √ since xy =√3), or√ det = 4 − λ = 0. So λ = ±2. No solutions
for λ = −2, while λ = 2 gives ( 3, 3) and (− 3, − 3). (Checked on applet that �f = 2�g at
minimum).
Why the method works: at constrained min/max, moving in any direction along the constraint
df
surface g = c should give df /ds = 0. So, for any û tangent to {g = c}, ds |û
= �f · û = 0, i.e.
û ⊥ �f . Therefore �f is normal to tangent plane to g = c, and so is �g, hence the gradient
vectors are parallel.
Warning: method doesn’t say whether we have a min or a max, and second derivative test doesn’t
apply with constrained variables. Need to answer using geometric argument or by comparing values
of f .
Advanced example: surface-minimizing pyramid.
Triangular-based pyramid with given triangle as base and given volume V , using as little surface
area as possible.
Note: V = 13 Abase h, so height h is fixed, top vertex moves in a plane z = h.
We can set up problem in coordinates: base vertices P1 = (x1 , y1 , 0), P2 , P3 , and top vertex
P = (x, y, h). Then areas of faces = 12 |P�P1 × P�P2 |, etc. Calculations to find critical point of
function of (x, y) are very hard.
Key idea: use variables adapted to the geometry, instead of (x, y): let a1 , a2 , a3 = lengths of
sides of the base triangle; u1 , u2 , u3 = distances in the xy-plane from the projection of�
P to the
sides of the base triangle. Then each face is a triangle with base length ai and height u2i + h2
(using Pythagorean theorem).
� � �
So we must minimize f (u1 , u2 , u3 ) = 12 a1 u21 + h2 + 12 a2 u22 + h2 + 12 a3 u23 + h2 .
Constraint? (asked using flashcards; this was a bad choice, very few students responded at
all.) Decomposing base into 3 smaller triangles with heights ui , we must have g(u1 , u2 , u3 ) =
1 1 1
2 a1 u1 + 2 a2 u2 + 2 a3 u3 = Abase .
Lagrange multiplier method: �f = λ�g gives
a1 u a1
� 1 = λ , similarly for u2 and u3 .
2 u21 + h2 2
u1 u2 u3
We conclude λ = � 2 = � 2 = � 2 , hence u1 = u2 = u3 , so P lies above the
u1 + h 2 u2 + h 2 u 3 + h2
incenter.
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 14. – Thu, Oct 11, 2007
Handouts: PS5 solutions, PS6, practice exams 2A and 2B.
Non-independent variables.
Often we have to deal with non-independent variables, e.g. f (P, V, T ) where P V = nRT .
Question: if g(x, y, z) = c then can think of z = z(x, y). What are ∂z/∂x, ∂z/∂y?
Example: x2 + yz + z 3 = 8 at (2, 3, 1). Take differential: 2x dx + z dy + (y + 3z 2 ) dz = 0, i.e.
4 dx + dy + 6 dz = 0 (constraint g = c), or dz = − 46 dx − 16 dy. So ∂z/∂x = −4/6 = −2/3 and
∂z/∂y = −1/6 (taking the coefficients of dx and dy). Or equivalently: if y is held constant then
we substitute dy = 0 to get dz = −4/6 dx, so ∂z/∂x = −4/6 = −2/3.
In general: g(x, y, z) = c ⇒ gx dx + gy dy + gz dz = 0. If y held fixed, get gx dx + gz dz = 0, i.e.
dz = −gx /gz dx, and ∂z/∂x = −gx /gz .
Warning: notation can be dangerous! For example:
f (x, y) = x + y, ∂f /∂x = 1. Change of variables x = u, y = u + v then f = 2u + v, ∂f /∂u = 2.
x = u but ∂f /∂x �= ∂f /∂u !!
This is because ∂f /∂x means change x keeping y fixed, while ∂f /∂u means change u keeping v
fixed, i.e. change x keeping y − x fixed.
� �
∂f
When there’s ambiguity, we must precise what is held fixed: = deriv. / x with y held
∂x y
� �
∂f
fixed, = deriv. / u with v held fixed.
∂u v
� � � � � �
∂f ∂f ∂f
We now have = �
= .
∂u v ∂x v ∂x y
In above example, we computed (∂z/∂x)y . When there is no risk of confusion we keep the old
notation, by default ∂/∂x means we keep y fixed.
Example: area of a triangle with 2 sides a and b making an angle θ is A = 12 ab sin θ. Suppose
it’s a right triangle with b the hypothenuse, then constraint a = b cos θ.
3 ways in which rate of change of A w.r.t. θ makes sense:
∂A
1) view A = A(a, b, θ) independent variables, usual = Aθ (with a and b held fixed). This
∂θ
answers the question: a and b fixed, θ changes, triangle stops being a right triangle, what happens
to A?
2) constraint
� a� = b cos θ, keep a fixed, change θ, while b does what it must to satisfy the
∂A
constraint: .
∂θ a
3) constraint
� a� = b cos θ, keep b fixed, change θ, while a does what it must to satisfy the
∂A
constraint: .
∂θ b
How to compute e.g. (∂A/∂θ)a ? [treat A as function of a and θ, while b = b(a, θ).]
0) Substitution: a = b cos θ so b = a sec θ, A = 12 ab sin θ = 12 a2 tan θ, ( ∂A 1 2 2
∂θ )a = 2 a sec θ. (Easiest
here, but it’s not always possible to solve for b)
1) Total differentials: da = 0 (a fixed), dA = Aθ dθ + Aa da + Ab db = 12 ab cos θ dθ + 12 b sin θ da +
1
and constraint ⇒ da = cos θ db − b sin θ dθ. Plugging in da = 0, we get db = b tan θ dθ
2 a sin θ db,
1
2
and then
� �
1 1 ∂A 1 1 1
dA = ( ab cos θ + a sin θ b tan θ)dθ, = ab cos θ + a sin θ b tan θ = ab sec θ.
2 2 ∂θ a 2 2 2
2) Chain rule: (∂A/∂θ)a = Aθ (∂θ/∂θ)a + Aa (∂a/∂θ)a + Ab (∂b/∂θ)b = Aθ + Ab (∂b/∂θ)a . We
find (∂b/∂θ)a by using the constraint equation. [Ran out of time here]. Implicit differentiation of
constraint a = b cos θ: we have 0 = (∂a/∂θ)a = (∂b/∂θ)a cos θ − b sin θ, so (∂b/∂θ)a = b tan θ, and
hence � �
∂A 1 1 1
= ab cos θ + a sin θ b tan θ = ab sec θ.
∂θ a 2 2 2
The two systematic methods essentially involve calculating the same quantities, even though
things are written differently.
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 16. – Thu, Oct 18, 2007
Handouts: PS6 solutions, PS7.
Double integrals.
�b
Recall integral in 1-variable calculus: a f (x) dx = area below graph y = f (x) over [a, b].
��
Now: double integral R f (x, y) dA = volume below graph z = f (x, y) over plane region R.
�
Cut��R into small pieces ΔA ⇒ the volume is approximately f (xi , yi ) ΔAi . Limit as ΔA → 0
gives R f (x, y) dA. (picture shown)
How to compute the integral? By taking slices: S(x) = area of the slice by a plane parallel to
yz-plane (picture shown): then
� xmax �
volume = S(x) dx, and for given x, S(x) = f (x, y) dy.
xmin
In the inner integral, x is a fixed parameter, y is the integration variable. We get an iterated
integral.
Example 1: z = 1 − x2 − y 2 , region 0 ≤ x ≤ 1, 0 ≤ y ≤ 1 (picture shown):
� 1� 1
(1 − x2 − y 2 ) dy dx.
0 0
(note: dA = dy dx, limit of ΔA = Δy Δx for small rectangles).
How to evaluate:
1 3 1
� 1 � �
2 2 2 1 2
1) inner integral (x is constant): (1 − x − y ) dy = (1 − x )y − y = (1 − x2 ) − = − x2 .
0 3 0 3 3
� 1 � �1
2 2 1 2 1 1
2) outer integral: ( − x2 ) dx = x − x3 = − = .
0 3 3 3 0 3 3 3
Example 2: same function over the quarter disc R : x2 + y 2 < 1 in the first quadrant.
How to find the bounds of √ integration? Fix x constant: what is a slice parallel to y-axis? bounds
for y = from y = 0 to y = 1 − x2 in the inner integral. For the outer integral: first slice is x = 0,
last slice is x = 1. So we get:
� 1 � √1−x2
(1 − x2 − y 2 ) dy dx.
0 0
(note the inner bounds depend on the outer variable x; the outer bounds are constants!)
2 3
�√1−x2 2
= (1 − x2 )3/2 .
�
Inner: (1 − x )y − y /3 0
3
� 1
2 π
Outer: (1 − x2 )3/2 dx = · · · = .
0 3 8
(. . . = trig. substitution x = sin θ, dx = cos θ dθ, (1 − x2 )3/2 = cos3 θ. Then use double angle
formulas... complicated! I carried out part of the calculation to show how it would be done but
then stopped before the end to save time; students may be confused about what happened exactly.)
Exchanging order of integration.
�1�2 �2�1
0 0 dx dy = 0 0 dy dx, since region is a rectangle (shown). In general, more complicated!
1
2
√
1� x
ey
�
Example 3: dy dx: inner integral has no formula. To exchange order:
0 x y
√
1) draw the region (here: x < y < x for 0 ≤ x ≤ 1 – picture drawn on blackboard).
2) figure out bounds in other direction: fixing a value of y, what are the bounds for x? here: left
border is x = y 2 , right is x = y; first slice is y = 0, last slice is y = 1, so we get
� 1� y y � 1 y � 1
e e
dx dy = 2
(y − y ) dy = ey − yey dy = [−yey + 2ey ]10 = e − 2.
0 y2 y 0 y 0
(the last integration can be done either by parts, or by starting from the guess −yey and adjusting;).
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 18. – Tue, Oct 23, 2007
Change of variables.
Example 1: area of ellipse with semiaxes a and b: setting u = x/a, v = y/b,
�� �� ��
dx dy = ab du dv = ab du dv = πab.
(x/a)2 +(y/b)2 <1 u2 +v 2 <1 u2 +v 2 <1
1
2
�1
integral is v . The first slice is v = 0, the last is v = 1; so we get
� 1� 1
v du dv.
0 v
Besides the picture in xy coordinates (a square sliced by hyperbolas), I also drew a picture in uv
coordinates (a triangle), which some students may find is an easier way of getting the bounds for
u and v.
becomes � �
F� · d�r = M dx + N dy.
C C
The notation is dangerous: this is not a sum of integrals w.r.t. x and y, but really a line integral
along C. To evaluate one must express everything in terms of the chosen parameter.
In the above example, we have x = t, y = t2 , so dx = dt, dy = 2t dt by implicit differentiation;
then � � 1 � 1
2 1
−y dx + x dy = −t dt + t (2t) dt = t2 dt =
C 0 0 3
(same calculation as before, using different notation).
Geometric approach.
d�r ds
Recall velocity is = T̂ (where s = arclength, T̂ = unit tangent vector to trajectory).
dt
� dt �
So d�r = T̂ ds, and �
F · d�r = F� · T̂ ds. Sometimes the calculation is easier this way!
C C
Example: C = circle of radius a centered at origin, F� = xı̂ + yĵ, then F� · T̂ = 0 (picture drawn),
so C F� · T̂ ds = 0 ds = 0.
� �
Physical interpretation.
If the force field F� is the gradient of a potential f , then work of F� = change in value of potential.
E.g.: 1) F� = gravitational field, f = gravitational potential; 2) F� = electrical field; f = electrical
potential (voltage). (Actually physicists use the opposite sign convention, F� = −�f ).
Conservativeness means that energy comes from change in potential f , so no energy can be
extracted from motion along a closed trajectory (conservativeness = conservation of energy: the
change in kinetic energy equals the work of the force equals the change in potential energy).
We have four equivalent properties:
(1) F� is conservative ( C F� · d�r = 0 for any closed curve C)
�
�
(2) F · d�r is path independent (same work if same end points)
(3) F� is a gradient field: F� = �f = fx ı̂ + fy ĵ.
(4) M dx + N dy is an exact differential (= fx dx + fy dy = df .)
((1) is equivalent to (2) by considering C1 , C2 with same endpoints, C = C1 − C2 is a closed loop.
(3) ⇒ (2) is the FTC, ⇐ will be key to finding potential function: if we have path independence
� (x,y)
then we can get f (x, y) by computing (0,0) F� · d�r. (3) and (4) are reformulations of the same
property).
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 21. – Tue, Oct 30, 2007
Test for gradient fields.
Observe: if F� = Mı̂ + Nĵ is a gradient field then Nx = My . Indeed, if F� = �f then M = fx ,
N = fy , so Nx = fyx = fxy = My .
Claim: Conversely, if F� is defined and differentiable at every point of the plane, and Nx = My ,
then F� = Mı̂ + Nĵ is a gradient field.
Example: F� = −yı̂ + xĵ: Nx = 1, My = −1, so F� is not a gradient field.
Example: for which value(s) of a is F� = (4x2 + axy)ı̂ + (3y 2 + 4x2 )ĵ a gradient field? Answer:
Nx = 8x, My = ax, so a = 8.
Finding the potential: if above test says F� is a gradient field, we have 2 methods to find the
potential function f . Illustrated for the above example (taking a = 8):
Method 1: using line integrals (FTC backwards):
We know that if C starts at (0, 0) and ends at (x1 , y1 ) then f (x1 , y1 ) − f (0, 0) = C F� · d�r. Here
�
f (0, 0) is just an integration constant (if f is a potential then so is f + c). Can also choose the
simplest curve C from (0, 0) to (x1 , y1 ).
Simplest choice: take C = portion of x-axis from (0, 0) to (x1 , 0), then vertical segment from
(x1 , 0) to (x1 , y1 ) (picture drawn).
� �
Then �
F · d�r = (4x2 + 8xy) dx + (3y 2 + 4x2 ) dy:
C C1 +C2
4 3 x1
� � x1 � �
2 4
Over C1 , 0 ≤ x ≤ x1 , y = 0, dy = 0: = (4x + 8x · 0) dx = x = x31 .
C 0 3 0 3
�1 � y1
y
(3y 2 + 4x21 ) dy = y 3 + 4x21 y 01 = y13 + 4x21 y1 .
� �
Over C2 , 0 ≤ y ≤ y1 , x = x1 , dx = 0: =
C2 0
4
So f (x1 , y1 ) = x31 + y13 + 4x21 y1 (+constant).
3
Method 2: using antiderivatives:
We want f (x, y) such that (1) fx = 4x2 + 8xy, (2) fy = 3y 2 + 4x2 .
Taking antiderivative of (1) w.r.t. x (treating y as a constant), we get f (x, y) = 43 x3 + 4x2 y+
integration constant (independent of x). The integration constant still depends on y, call it g(y).
So f (x, y) = 43 x3 + 4x2 y + g(y). Take partial w.r.t. y, to get fy = 4x2 + g � (y).
Comparing this with (2), we get g � (y) = 3y 2 , so g(y) = y 3 + c.
Plugging into above formula for f , we finally get f (x, y) = 43 x3 + 4x2 y + y 3 + c.
Curl.
Now we have: Nx = My ⇔∗ F� is a gradient field ⇔ F� is conservative: C F� · d�r = 0 for any
�
closed curve.
(*): ⇒ only holds if F� is defined everywhere, or in a “simply-connected” region – see next week.
Failure of conservativeness is given by the curl of F� :
Definition: curl(F� ) = Nx − My .
Interpretation of curl: for a velocity field, curl = (twice) angular velocity of the rotation
component of the motion.
1
2
(Ex: F� = �a, b� uniform translation, F� = �x, y� expanding motion have curl zero; whereas
F� = �−y, x� rotation at unit angular velocity has curl = 2).
For a force field, curl F� = torque exerted on a test mass, measures how F� imparts rotation motion.
Force d
For translation motion: = acceleration = (velocity).
Mass dt
Torque d
For rotation effects: = angular acceleration = (angular velocity).
Moment of inertia dt
18.02 Lecture 22. – Thu, Nov 1, 2007
Handouts: PS8 solutions, PS9, practice exams 3A and 3B.
Green’s theorem.
If C is a positively oriented closed curve enclosing a region R, then
� �� � ��
�
F · d�r = �
curl F dA which means M dx + N dy = (Nx − My ) dA.
C R C R
��
Example (reduce a complicated line integral to an easy ):
Let C = unit circle centered at (2,0), counterclockwise. R = unit disk at (2, 0). Then
� �� �� ��
−x 1 2 −x −x −x
ye dx + ( x − e ) dy = Nx − My dA = (x + e ) − e dA = x dA.
C 2 R R R
This is equal to area · x̄ = π · 2 = 2π (or by direct computation of the iterated integral). (Note:
direct calculation of the line integral would probably involve setting x = 2 + cos θ, y = sin θ, but
then calculations get really complicated.)
Application: proof of our criterion for gradient fields.
Theorem: if F� = Mı̂ + Nĵ is defined and continuously differentiable in the whole plane, then
Nx = My ⇒ F� is conservative (⇔ F� is a gradient field).
If Nx = My then by Green, C F� · d�r = R curl F� dA = R 0 dA = 0. So F� is conservative.
� �� ��
Note: this only works if F� and its curl are defined everywhere inside R. For the vector field on
PS8 Problem 2, we can’t do this if the region contains the origin – for example, the line integral
along the unit circle is non-zero even though curl(F� ) is zero wherever it’s defined.
Proof of Green’s theorem. 2 preliminary remarks:
� �� � ��
1) the theorem splits into two identities, C M dx = − R My dA and C N dy = R Nx dA.
2) additivity:
� � if theorem
� is true for R1 and R2 then it’s true for the union R �� = R1 ∪��
R2 (picture
��
shown): C = C1 + C2 (the line integrals along inner portions cancel out) and R = R1 + R2 .
� ��
Main step in the proof: prove C M dx = − R My dA for “vertically simple” regions: a < x < b,
f0 (x) < y < f1 (x). (picture drawn). This involves calculations similar to PS5 Problem 3.
LHS: break
� C into �four sides (C1 lower, C2 right vertical segment, C3 upper, C4 left vertical
segment); C2 M dx = C4 M dx = 0 since x = constant on C2 and C4 . So
� � � � b � b
= + = M (x, f0 (x)) dx − M (x, f1 (x)) dx
C C1 C3 a a
(using along C1 : parameter a ≤ x ≤ b, y = f0 (x); along C2 , x from b to a, hence − sign; y = f1 (x)).
3
�� � b� f1 (x) � b
RHS: − My dA = − My dy dx = − (M (x, f1 (x)) − M (x, f0 (x)) dx (= LHS).
R a f0 (x) a
Finally observe:
� any region
�� R can be subdivided into �vertically simple
�� pieces (picture shown);
for each piece Ci M dx = − Ri My dA, so by additivity C M dx = − R My dA.
� ��
Similarly C N dy = R Nx dA by subdividing into horizontally simple pieces. This completes
the proof.
�
�� Example. The area of a region R can be evaluated using a line integral: for example, C x dy =
R 1dA = area(R).
This idea was used to build mechanical devices that measure area of arbitrary regions on a piece
of paper: planimeters (photo of the actual object shown, and principle explained briefly: as one
moves its arm along a closed curve, the planimeter calculates the line integral of a suitable vector
field by means of an ingenious mechanism; at the end of the motion, one reads the area).
Physical interpretation: if F� is a velocity field (e.g. flow of a fluid), flux measures how much
matter passes through C per unit time.
Look at a small portion of C: locally F� is constant, what passes through portion of C in unit
time is contents of a parallelogram with sides Δs and F� (picture shown with F� horizontal, and
portion of curve = diagonal line segment). The area of this parallelogram is Δs · height = Δs (F� · n̂).
(picture shown rotated with portion of C horizontal, at base of parallelogram). Summing these
contributions along all of C, we get that (F� · n̂) ds is the total flow through C per unit time;
�
counting positively what flows towards the right of C, negatively what flows towards the left of C,
as seen from the point of view of a point travelling along C.
Example: C = circle of radius a counterclockwise, F� = xı̂ + yĵ (picture shown): along C,
F� //n̂, and |F� | = a, so F� · n̂ = a. So
� �
�
F · n̂ ds = a ds = a length(C) = 2πa2 .
C C
Meanwhile, the flux of −yı̂ + xĵ across C is zero (field tangent to C).
That was a geometric argument. What about the general situation when calculation of the line
integral is required?
Observe: d�r = T̂ ds = �dx, dy�, and n̂ is T̂ rotated 90◦ clockwise; so n̂ ds = �dy, −dx�.
So, if F� = P ı̂ + Qĵ (using new letters to make things look different; of course we could call the
components M and N ), then
� � �
�
F · n̂ ds = �P, Q� · �dy, −dx� = −Q dx + P dy.
C C C
4
So we can compute flux using the usual method, by expressing x, y, dx, dy in terms of a parameter
variable and substituting (no example given).
Note: the counterclockwise orientation of C means that we count flux of F� out of R through C.
� �
Proof: �
F · n̂ ds = −Q dx + P dy. Call M = −Q and N = P , then apply usual Green’s
� C C ��
theorem M dx + N dy = (Nx − My ) dA to get
C R
� �� ��
−Q dx + P dy = (Px − (−Qy )) dA = div(F� ) dA.
C R R
Example: in the above example (xı̂ + yĵ across circle), div F� = 2, so flux = R 2 dA =
��
2 area(R) = 2πa2 . If we translate C to a different position (not centered at origin) (picture shown)
then direct calculation of flux is harder, but total flux is still 2πa2 .
Physical interpretation: in an incompressible fluid flow, divergence measures source/sink den
sity/rate, i.e. how much fluid is being added to the system per unit area and per unit time.
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 24. – Tue, Nov 6, 2007
Simply connected regions. [slightly different from the actual notations used]
Recall Green’s theorem: if C is a closed curve around R counterclockwise then line integrals can
be expressed as double integrals:
� �� � ��
�
F · d�r = �
curl(F ) dA, �
F · n̂ ds = div(F� ) dA,
C R C R
where curl(Mı̂ + Nĵ) = Nx − My , div(P ı̂ + Qĵ) = Px + Qy .
For Green’s theorem to hold, F� must be defined on the entire region R enclosed by C.
−y ı̂ + xĵ
Example: (same as in pset): F� = 2 , C = unit circle counterclockwise, then curl(F� ) =
x + y2
∂ x ∂ −y
( 2 2
)− ( 2 ) = · · · = 0. So, if we look at both sides of Green’s theorem:
∂x x + y ∂y x + y 2
� �� ��
F� · d�r = 2π (from pset), curlF� dA = 0 dA = 0 ?
C R R
circle, C2 = small circle / origin; so line integral is actually the same on C and C2 (or any other
curve encircling the origin).
Review for Exam 3.
2 main objects: double integrals and line integrals. Must know how to set up and evaluate.
Double integrals: drawing picture of region, taking slices to set up the iterated integral.
3) set up bounds in uv-coordinates by drawing picture. The actual example on the test will be
reasonably simple (constant bounds, or circle in uv-coords).
���
Triple integrals: f dV (dV = volume element).
R
Example 1: region between paraboloids z = x2 + y 2 and z = 4 − x2 − y 2 (picture drawn), e.g.
��� � ? � ? � 4−x2 −y2
volume of this region: 1 dV = dz dy dx.
R ? ? x2 +y 2
To set up bounds, (1) for fixed (x, y) find bounds for z: here lower limit is z = x2 +y 2 , upper limit
is z = 4 − x2 − y 2 ; (2) find the shadow of R onto the xy-plane, i.e. set of values of (x, y) above which
region lies. Here: R is widest at intersection of paraboloids, which is in plane z = 2; general method:
for which (x, y) is z on top surface > z on bottom surface?
√ Answer: when 4 − x2 − y 2 > x2 − y 2 ,
2 2
i.e. x + y < 2. So we integrate over a disk of radius 2 in the xy-plane. By usual method to set
up double integrals, we finally get:
� √2 � √2−x2 � 4−x2 −y2
V = √ √ dz dy dx.
− 2 − 2−x2 x2 +y 2
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 26. – Tue, Nov 13, 2007
Spherical coordinates (ρ, φ, θ).
ρ = rho = distance to origin. φ = ϕ = phi = angle down from z-axis. θ = same as in cylindrical
coordinates. Diagram drawn in space, and picture of 2D slice by vertical plane with z, r coordinates.
Formulas to remember: z = ρ cos φ, r = ρ sin φ (so x = ρ sin φ cos θ, y = ρ sin φ sin θ).
� √
ρ = x2 + y 2 + z 2 = r2 + z 2 . The equation ρ = a defines the sphere of radius a centered at 0.
On the surface of the sphere, φ is similar to latitude, except it’s 0 at the north pole, π/2 on the
equator, π at the south pole. θ is similar to longitude.
�
φ = π/4 is a cone (asked using flash cards) (z = r = x2 + y 2 ). φ = π/2 is the xy-plane.
Volume element: dV = ρ2 sin φ dρ dφ dθ.
To understand this formula, first study surface area on sphere of radius a: picture shown of a
“rectangle” corresponding to Δφ, Δθ, with sides = portion of circle of radius a, of length aΔφ, and
portion of circle of radius r = a sin φ, of length rΔθ = a sin φΔθ. So ΔS ≈ a2 sin φ ΔφΔθ, which
gives the surface element dS = a2 sin φ dφdθ.
The volume element follows: for a small “box”, ΔV = ΔS Δρ, so dV = dρ dS = ρ2 sin φ dρdφdθ.
Example: recall the complicated example at end of Friday’s lecture (region sliced by a plane
inside unit sphere). After rotating coordinate
√ system, the question becomes: volume of the portion
of unit sphere above the plane z = 1/ 2? (picture drawn). This can be set up in cylindrical (left
as exercise) or spherical coordinates.
For fixed φ, θ we √are slicing our region by rays straight out of the origin; ρ ranges from its value
on the plane z =√1/ 2 to its value√on the sphere ρ = 1. Spherical coordinate equation of the plane:
z = ρ cos φ = 1/ 2, so ρ = sec φ/ 2. The volume is:
� 2π � π/4 � 1
ρ2 sin φ dρ dφ dθ.
1
0 0 √ sec φ
2
(Bound for φ explained by looking at a slice by vertical plane θ = constant: the edge of the region
is at z = r = √12 ).
2π 5π
Evaluation: not done. Final answer: − √ .
3 6 2
Application to gravitation.
Gravitational force exerted on mass m at origin by a mass ΔM at (x, y, z) (picture shown)
G ΔM m �x, y, z� G ΔM m
is given by |F� | = , dir(F� ) = , i.e. F� = �x, y, z�. (G = gravitational
ρ2 ρ ρ3
constant).
If instead of a point mass we have a solid with density δ, then we must integrate contributions
to gravitational attraction from small pieces ΔM = δ ΔV . So
Gm �x, y, z�
��� ���
z
F� = 3
δ dV, i.e. z-component is Fz = Gm 3
δ dV, . . .
R ρ R ρ
If we can set up to use symmetry, then Fz can be computed nicely using spherical coordinates.
General setup: place the mass m at the origin (so integrand is as above), and place the solid
so that the z-axis is an axis of symmetry. Then F� = �0, 0, Fz � by symmetry, and we have only one
1
2
Example: Newton’s theorem: the gravitational attraction of a spherical planet with uniform
density δ is the same as that of the equivalent point mass at its center.
[[Setup: the sphere has radius a and is centered on the positive z-axis, tangent to xy-plane at
the origin; the test mass is m at the origin. Then
��� � 2π � π/2 � 2a cos φ
z 4 GM m
Fz = Gm 3
δ dV = Gm δ cos φ sin φ dρ dφ dθ = · · · = Gmδ πa =
R ρ 0 0 0 3 a2
where M = mass of the planet = 43 πa3 δ. (The bounds for ρ and φ need to be explained carefully,
by drawing a diagram of a vertical slice with z and r coordinate axes, and the inscribed right
triangle with vertices the two poles of the sphere + a point on its surface, the hypothenuse is the
diameter 2a and we get ρ = 2a cos φ for the spherical coordinate equation of the sphere).]]
In 3D, flux of a vector field is a double integral: flux through a surface, not a curve!
F� vector field, S surface, n̂ unit normal vector: F� · n̂ dS.
��
Flux =
� = n̂ dS. (We’ll see that dS
Notation: dS � is often easier to compute than n̂ and dS).
Remark: there are 2 choices for n̂ (choose which way is counted positively!)
Geometric interpretation of flux:
As in 2D, if F� = velocity of a fluid flow, then flux = flow per unit time across S.
Cut S into small pieces, then over each small piece: what passes through ΔS in unit time is the
contents of a parallelepiped with base ΔS and third side given by F� .
Volume of box = base × height = (F� · n̂) ΔS.
• Examples:
1) F� = xı̂ + yĵ + zk̂ through sphere of radius a centered at 0.
n̂ = a1 �x, y, z� (other choice: − a1 �x, y, z�; traditionally choose n̂ pointing out).
F� · n̂ = �x, y, z� · n̂ = a1 (x2 + y 2 + z 2 ) = a, so S F� · n̂dS = S a dS = a (4πa2 ).
�� ��
3
� · n̂ = z 2 .
� = zk̂: H
2) Same sphere, H a
�� 2 � 2π � π 2 � π
a cos2 φ 2
��
� · dS
�= z 4
H dS = a sin φ dφdθ = 2πa3 cos2 φ sin φ dφ = πa3 .
S S a 0 0 a 0 3
Setup. Sometimes we have an easy geometric argument, but in general we must compute the
surface integral. The setup requires the use of two parameters to describe the surface, and F� · n̂ dS
must be expressed in terms of them. How to do this depends on the type of surface. For now,
formulas to remember:
0) plane z = a parallel to xy-plane: n̂ = ±k̂, dS = dx dy. (similarly for planes // xz or yz-plane).
1) sphere of radius a centered at origin: use φ, θ (substitute ρ = a for evaluation); n̂ = a1 �x, y, z�,
dS = a2 sin φ dφ dθ.
2) cylinder of radius a centered on z-axis: use z, θ (substitute r = a for evaluation): n̂ is radially
out in horizontal directions away from z-axis, i.e. n̂ = a1 �x, y, 0�; and dS = a dz dθ (explained by
drawing a picture of a “rectangular” piece of cylinder, ΔS = (Δz) (aΔθ)).
3) graph z = f (x, y): use x, y (substitute z = f (x, y)). We’ll see on Friday that n̂ and dS
separately are complicated, but n̂ dS = �−fx , −fy , 1� dx dy.
Parametric surfaces. If we can describe S by parametric equations x = x(u, v), y = y(u, v),
�,
z = z(u, v) (i.e. �r = �r(u, v)), then we can set up flux integrals using variables u, v. To find dS
4
Physical interpretation (mentioned very quickly and verbally only): div F� = source rate =
flux generated per unit volume. So the divergence theorem says: the flux outwards through S (net
amount leaving D per unit time) is equal to the total amount of sources in D.
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 29. – Tue, Nov 20, 2007
�=
�� ���
Recall statement of divergence theorem: S F · dS D div F dV .
Del operator. � = �∂/∂x, ∂/∂y, ∂/∂z� (symbolic notation!)
�f = �∂f /∂x, ∂f /∂y, ∂f /∂z� = gradient.
� · F = �∂/∂x, ∂/∂y, ∂/∂z� · �P, Q, R� = Px + Qy + Rz = divergence.
Physical interpretation. div F = source rate = flux generated per unit volume. Imagine
an incompressible��fluid flow (i.e. a given mass occupies a fixed volume) with velocity F, then
���
D div F dV = S F · n̂ dS = flux through S is the net amount leaving D per unit time = total
amount of sources (minus sinks) in D.
�=
�� ���
Proof of divergence theorem. To show S �P, Q, R� · dS (P + Qy + Rz ) dV , we can
��� D x
�=
��
separate into sum over components and just show S Rk̂ · dS D z dV & same for P and Q.
R
If the region D is vertically simple, i.e. top and bottom surfaces are graphs, z1 (x, y) ≤ z ≤
z2 (x, y), with (x, y) in some region U of xy-plane: r.h.s. is
��� � � � z2 (x,y) ��
� �
Rz dV = Rz dz dx dy = (R(x, y, z2 (x, y)) − R(x, y, z1 (x, y)) dx dy.
D U z1 (x,y) U
1
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 30. – Tue, Nov 27, 2007
Handouts: practice exams 4A and 4B.
Clarification from end of last lecture: we derived the diffusion equation from 2 inputs. u =
concentration, F = flow, satisfy:
1) from physics: F = −k�u,
2) from divergence theorem: ∂u/∂t = −div F.
Combining, we get the diffusion equation: ∂u/∂t = −div F = +kdiv (�u) = k�2 u.
Line integrals in space.
Force field F = �P, Q, R�, curve C in space, d�r = �dx, dy, dz�
� �
⇒ Work = C F · d�r = C P dx + Q dy + R dz.
Example: F = �yz, xz, xy�. C: x = t3 , y = t2 , z = t. 0 ≤ t ≤ 1. Then dx = 3t2 dt, dy = 2tdt,
dz = dt and substitute:
� � � 1
F · d�r = yzdx + xzdy + xydz = 6t5 dt = 1
C C 0
(In general, express (x, y, z) in terms of a single parameter: 1 degree of freedom)
Same F, curve C � = segments from (0, 0, 0) to (1, 0, 0) to (1, 1, 0) to (1, 1, 1). In the xy-plane,
z = 0 =⇒ F = xyk̂, so F · d�r = 0, no �work. For the last segment, x = y = 1, dx = dy = 0, so
1
F = �z, z, 1� and d�r = �0, 0, dz�. We get 0 1 dz = 1.
Both give the same answer because F is conservative, in fact F = �(xyz).
Recall the fundamental theorem of calculus for line integrals:
� P1
�f · d�r = f (P1 ) − f (P0 ).
P0
Gradient fields.
F = �P, Q, R� = �fx , fy , fz � ?
Then fxy = fyx , fxz = fzx , fyz = fzy , so Py = Qx , Pz = Rx , Qz = Ry .
Theorem: F is a gradient field if and only if these equalities hold (assuming defined in whole
space or simply connected region)
Example: for which a, b is axyı̂ + (x2 + z 3 )ĵ + (byz 2 − 4z 3 )k̂ a gradient field?
Py = ax = 2x = Qx so a = 2; Pz = 0 = 0 = Rx ; Qz = 3z 2 = bz 2 = Ry so b = 3.
Systematic method to find a potential: (carried out on above example)
fx = 2xy, fy = x2 + z 3 , fz = 3yz 2 − 4z 3 :
fx = 2xy ⇒ f (x, y, z) = x2 y + g(y, z).
fy = x2 + gy = x2 + z 3 ⇒ gy = z 3 ⇒ g(y, z) = yz 3 + h(z), and f = x2 y + yz 3 + h(z).
fz = 3yz 2 + h� (z) = 3yz 2 − 4z 3 ⇒ h� (z) = −4z 3 ⇒ h(z) = −z 4 + c, and f = x2 y + yz 3 − z 4 + c.
�P
Other method: f (x1 , y1 , z1 ) = f (0, 0, 0) + P01 F · d�r (use a curve that gives an easy computation,
e.g. 3 segments parallel to axes).
Curl: encodes by how much F fails to be conservative.
curl �P, Q, R� = (Ry − Qz )ı̂ + (Pz − Rx )ĵ + (Qx − Py )k̂.
1
2
How to remember the formula? Use the del operator � = �∂/∂x, ∂/∂y, ∂/∂z�.
Recall from last week that � · F = �∂/∂x, ∂/∂y, ∂/∂z� · �P, Q, R� = Px + Qy + Rz = div F.
� �
� ı̂ ĵ k̂ ��
� ∂ ∂ ∂ �
Now we have: � × F = �� ∂x ∂y ∂z �
= curl F.
� P Q R �
Interpretation of curl for velocity fields: curl measures angular velocity.
Example: rotation around z-axis at constant angular velocity ω (trajectories are circles centered
on z-axis): v = �−ωy, ωx, 0�.
Then � × v = ... = 0ı̂ + 0ĵ + (ω + ω)k̂ = 2ωk̂. So length of curl = twice angular velocity, and
direction = axis of rotation.
A general motion can be complicated, but decomposes into various effects.
• curl measures the rotation component of a complex motion.
with those coordinates, the expressions of work, curl, flux will be the familiar ones replacing x, y, z
with u, v, w.
3) in general, we can decompose S into small pieces, each piece is nearly flat (slanted plane); on
each piece we have approximately work = flux by Green’s theorem. When adding pieces, the line
integrals over the inner boundaries cancel each other and we get the line integral over C; the flux
integrals add up to flux through S.
Example: verify Stokes for F = zı̂ + xĵ + yk̂, C = unit circle in xy-plane (counterclockwise),
S = piece of paraboloid z = 1 − x2 − y 2 .
� � �
Direct calculation: x = cos θ, y = sin θ, z = 0, so C F · d�r = C z dx + x dy + y dz = C x dy =
� 2π 2
0 cos θ dθ = π.
By Stokes: curl F = �1, 1, 1�, and n̂ dS = �−fx , −fy , 1�dx dy = �2x, 2y, 1� dx dy.
�� �� ��
�
(� × F) · dS = �(2x + 2y + 1) dx dy = 1 dx dy = area(disk) = π.
S
��
( x dx dy = 0 by symmetry and similarly for y).
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.02 Lecture 33. – Thu, Dec 6, 2007
Handouts: PS12 solutions; exam 4 solutions; review sheet and practice final.
Applications of div and curl to physics.
Recall: curl of velocity field = 2· angular velocity vector (of the rotation component of motion).
E.g., for uniform rotation about z-axis, v = ω(−yı̂ + xĵ), and � × v = 2ωk̂.
Curl singles out the rotation component of motion (while div singles out the stretching compo
nent).
Interpretation of curl for force fields.
If we have a solid in a force field (or rather an acceleration field!) F such that the force exerted
on Δm at (x, y, z) is F(x, y, z) Δm:��� recall the torque of the force about the origin is defined as
τ = �r × F (for the entire solid, take . . . δ dV ), and measures how F imparts rotation motion.
Force d
For translation motion: = acceleration = (velocity).
Mass dt
Torque d
For rotation effects: = angular acceleration = (angular velocity).
Moment of inertia dt
Force Torque
Hence: curl( )=2 .
Mass Moment of inertia
Consequence: if F derives from a potential, then �×F = �×(�f ) = 0, so F does not induce any
rotation motion. E.g., gravitational attraction by itself does not affect Earth’s rotation. (not strictly
true: actually Earth is deformable; similarly, friction and tidal effects due to Earth’s gravitational
attraction explain why the Moon’s rotation and revolution around Earth are synchronous).
Div and curl of electrical field. – part of Maxwell’s equations for electromagnetic fields.
1) Gauss-Coulomb law: � · E � = ρ (ρ = charge density, �0 = physical constant).
�0
�� ���
By divergence theorem, can reformulate as: � · n̂ dS =
E �·E � dV = Q , where Q =
S D �0
total charge inside the closed surface S.
This formula tells how charges influence the electric field; e.g., it governs the relation between
voltage between the two plates of a capacitor and its electric charge.
�
2) Faraday’s law: � × E � = − ∂B (B � = magnetic field).
∂t
So in presence of a varying magnetic field, E � is no longer conservative: if we have a closed loop
� ��
of wire, we get a non-zero voltage (“induction” effect). By Stokes, � · d�r = − d
E � · n̂ dS.
B
C dt S
This principle is used e.g. in transformers in power adapters: AC runs through a wire looped
around a cylinder, which creates an alternating magnetic field; the flux of this magnetic field
through another output wire loop creates an output voltage between its ends.
There are two more Maxwell equations, governing div and curl of B �: � · B � = 0, and � × B � =
�
∂E
µ0 J� + �0 µ0 (where J� = current density).
∂t