Darve Cme100 Notes
Darve Cme100 Notes
Eric Darve
1 Vectors in 2D and 3D
1.1 Definition of vectors
Many times in engineering, one wants to model quantities that are not adequately described by a
single number, like temperature or pressure, but rather by a direction and magnitude. These are
called vector quantities or simply vectors. Examples of vector quantities are:
• Acceleration.
1.2 Notation
If a quantity is a vector, then it is either going to be in boldface, such as u or have an arrow over
it, such as ~u.
1 (2, 3, 1)
(4, 3)
3 ~v
~u 3
(0,0,0) y
2
(0,0) 4 x
x
(a) 2D Vector (b) 3D Vector
Multiplying a vector with a scalar does not change its direction, but it changes the length of the
vector. To see this, note that k~u = (ku1 , ku2 , ku3 ) and the length is now given as
|k~u| = (ku1 )2 + (ku2 )2 + (ku3 )2
p
q
= |k| u21 + u22 + u23
= |k| |~u|
A common mistake in computing the length of a vector is to forget the absolute value, | · |, around
k. Remember that length cannot be negative!
The effect of multiplying a vector ~u with scalars 2.5, −1 and 0.3 is given in Figure 2 in different
colors. Note that the different vectors all lie on top of each other as scalar multiplication of a vector
cannot change the direction of the vector, except for reversing it. But scalar multiplication does
change the magnitude of ~u!
y
2.5~u
~u
0.3~u
−~u
(0,0) x
~u + ~v ~u + ~v
~v ~v
~u ~u
Figure 3: The parallelogram law and the triangle law of vector addition. The parallelogram law
states that if one draws a parallelogram with ~u on one side and ~v on the other then ~u + ~v is given
by the diagonal of the parallelogram. The triangle law states that if you draw vector ~u and vector
~v starting at the end of ~u, and then join the first and last points, you obtain vector ~u + ~v .
Each of these vectors ~i, ~j and ~k has only one non-zero component out of three. Any vector
~u = (u1 , u2 , u3 ) can be written using the standard basis as
~u = (u1 , u2 , u3 )
= (u1 , 0, 0) + (0, u2 , 0) + (0, 0, u3 )
= u1 (1, 0, 0) + u2 (0, 1, 0) + u3 (0, 0, 1)
= u1~i + u2~j + u3~k
Note each of these standard basis vectors points in the direction of one axis in the Cartesian
coordinate system.
Example 1. Given two points P = (1, −1, 2) and Q = (−1, 1, 1), compute the distance between the
two points.
−−→
First, let us compute the displacement vector P Q:
−−→
P Q = (−1 − 1, 1 − (−1), 1 − 2) = (−2, 2, −1)
4/131 CME 100 Fall 2009
Q = (x2 , y2 , z2 )
−→
PQ
P = (x1 , y1 , z1 )
y
x
Figure 4: The displacement vector from P to Q
= 1 |~u| = 1
~u
|~u| |~u|
Example 2. Given the vector ~u = (3, −1, 2), find its length and direction.
We can compute the length of ~u as
√
|~u| = 32 + (−1)2 + 22 = 14
p
Example 3. An airplane flying due east at 500 mph in still air encounters a 70 mph tailwind
acting in the direction 60◦ north of east. Determine the airplanes ground speed and direction.
r
w
r
v
θ
r
u
Matlab code:
% Define vectors
% u velocity of plane with respect
% to wind
% v velocity of wind with respect to
% ground
u=[500,0]
u =
500 0
v=[70*cos(60*pi/180), 70*sin(60*pi/180)]
v =
35.0000 60.6218
% Add u and v
w=u+v
w =
535.0000 60.6218
% Find magnitude of w
speed=norm(w)
speed =
538.4236
% Determine direction
theta=atan(w(2)/w(1))*180/pi
theta =
6.4647
2 Dot Product
The dot product of two vectors ~u = (u1 , u2 , u3 ) and ~v = (v1 , v2 , v3 ) is defined as
~u · ~v = u1 v1 + u2 v2 + u3 v3
Note that the dot product of two vectors always results in a scalar.
2.1 Properties
A few properties of the dot product are:
6/131 CME 100 Fall 2009
1. The dot product of a vector with itself gives the square of its magnitude:
~u · ~u = |~u|2
~u
~u − ~v
θ
~v
Figure 5: The law of cosines
Using the properties of the dot product, we can calculate |~u − ~v |2 in the following manner:
|~u − ~v |2 = (~u − ~v ) · (~u − ~v )
= ~u · ~u − ~u · ~v − ~v · ~u + ~v · ~v
= |~u|2 + |~v |2 − 2(~u · ~v ) (2)
Comparing Equation (1) and (2), we have
2.3 Projections
By projection of ~u along ~v , we mean the component of ~u in the direction of ~v . The scalar component
of ~u in the direction of ~v is given by:
~v
|~u| cos θ = ~u ·
|~v |
We can also define the vector projection of ~u onto ~v as (see Figure 6):
~u · ~v ~u · ~v
~v
proj~v ~u = · = ~v
|~v | |~v | |~v |2
~u
θ
~v proj~v ~u
The component of ~u perpendicular to ~v can be computed by subtracting from ~u, the component of
~u along ~v :
~u · ~v
~u − ~v
|~v |2
W = F~ · d~
F~
θ
d~
Figure 7: Work done by the force F~ .
Example 5. A child pulls a sled up a hill with force F~ = (8, 2) (in pounds) and displacement
d~ = (100, 20) (in feet), as shown in figure 8. Find the work done by the child.
8/131 CME 100 Fall 2009
F~ (8, 2)
(100, 20)
2. Determine the component of drag in the direction perpendicular to the direction of thrust
y
T
45 0
Matlab code:
% Define vectors
T=[10*cos(45*pi/180), 10*sin(45*pi/180)]
T =
7.0711 7.0711
f=[0,-0.5]
f =
0 -0.5000
% Find projection of f in the direction of T
proj_T_f=dot(f,T)/(norm(T)^2)*T
proj_T_f =
-0.2500 -0.2500
% Find magnitude of projection
norm(proj_T_f)
ans =
0.3536
% Find effective thrust level
Thrust=10-norm(proj_T_f)
CME 100 Fall 2009 9/131
Thrust =
9.6464
% Find the component of f perpendicular to T
f_perp_T=f-proj_T_f
f_perp_T =
0.2500 -0.2500
3 Cross product
Definition: Given ~u and ~v , we define their cross product as
~u × ~v = (u2 v3 − v2 u3 , u3 v1 − v3 u1 , u1 v2 − v1 u2 )
A simple mnemonic to remember the cross product formula can be seen in Figure 9 which says
that to compute the first component of ~u × ~v , we use the second component of ~u and the third
component of ~v and so on.
~u · (~u × ~v ) = 0, therefore ~u is ⊥ to ~u × ~v
~v · (~u × ~v ) = 0, therefore ~v is ⊥ to ~u × ~v .
Note that there are two vectors that are perpendicular to the plane containing ~u and ~v , one pointing
up and one down. Among these two, we choose the cross product direction according to the Right
Hand Rule which states that if you curl the fingers of your right hand going from ~u to ~v then the
thumb points in the direction of ~u × ~v .
The length of the cross product, i.e., |~u × ~v |, is equal to:
~u × ~v ~v
~u
This is the same as the area of the parallelogram formed by the two vectors. The area of the
triangle formed by ~u and ~v is half the area of the parallelogram and hence given by 12 |~u × ~v |.
2. Using the above identity, show that: |~u × ~v | = |~u| |~v | sin θ
Question 1 can be proved by direct calculation. Here is a sketch of the proof. The cross product is
given by:
~u × ~v = (u2 v3 − v2 u3 , u3 v1 − v3 u1 , u1 v2 − v1 u2 )
From this equation |~u × ~v |2 can be computed. Using the following three equations:
Therefore |~u × ~v |2 = |~u|2 |~v |2 (sin θ)2 which gives the desired result.
3.2 Properties
A few properties of the cross product are:
1. Skew-commutativity:
~u × ~v = −~v × ~u
~u × (~v + w)
~ = ~u × ~v + ~u × w
~
CME 100 Fall 2009 11/131
Example 9. Find the area of a triangle whose vertices are A(1,0,0), B(0,3,0) and C(0,0,2).
Matlab code:
AB=[-1 3 0]
AB =
-1 3 0
AC=[-1 0 2]
AC =
-1 0 2
X=cross(AB,AC)
X =
6 2 3
Area = norm(X)/2
Area =
3.5000
Example 10. An airplane is in a steady flight as shown in the diagram. Determine the lift force
produced by the tail such that there is no net torque on the aircraft. Assume Fw = 500,000 N.
Fw
Ft
2m
2m
10 m
Fg
Since we assume the flight is steady, the net torque should be equal to zero. The torque due to Fw
is equal to 1,000,000. The torque due to the tail is 10Ft . Since they have to be equal we have:
~r
F~
We know that the torque is given by |~r| |F~ | sin θ. This can also be expressed using the cross product
as |~r × F~ |. The vector torque is given by ~r × F~ . The advantage of computing the vector torque is
that it gives us the direction of the torque as well as the magnitude.
The torque is important to study the rotational motion of objects. For example, in rotational
equilibrium, the torque is zero. Let’s assume that the force F~ is in the direction of ~r. Then we
know that the torque is zero. This can be verified from the definition of the cross product:
~ Thus,
Moving charge. We have a charge q that is moving with velocity ~v in a magnetic field B.
the force on the charge is given by (see Figure 12, 13 and 14)
F~ = (q~v ) × B
~
~v
F~
From the properties of the cross product, we know that the force is therefore perpendicular to the
velocity. Let’s assume that the particle is moving in a straight line and has moved along a segment
~ the velocity vector ~v is in the direction of the motion and is therefore parallel to d.
d; ~ Hence, we
have:
W = F~ · d~ = |F~ | |d|
~ cos θ = 0 because F~ is perpendicular to d.
~
The work done is always 0. Thus, the particle cannot be accelerated using a magnetic field! One
can only deflect the particle using a magnetic field, i.e., we can change the direction of the particle
velocity but not its magnitude by using a magnetic field.
CME 100 Fall 2009 13/131
These properties have immense practical significance in particle accelerators where a magnetic field
is used to ensure that the particle moves around in a tunnel, while an electric field accelerates the
particle, as shown in Figures 13 and 14.
~
B
~
E
(x − x0 )n1 + (y − y0 )n2 = 0
4.2 Lines in 3D
The parametric representation for the equation of a 3D line turns out to be easier than an explicit
equation so we will derive a parametric equation of a line in 3D. We are given the vector ~v (v1 , v2 , v3 )
which points in the direction of the line and a point P0 (x0 , y0 , z0 ) lying on the line. If the point
P (x, y, z) lies on the line (see Figure 16), then there must exist a number t such that:
−−→
P0 P = t ~v
This is the parametric equation of a line. This vector equation is equivalent to three scalar
equations:
x − x0 = t v1
y − y0 = t v2
z − z0 = t v3
14/131 CME 100 Fall 2009
4.3 Planes in 3D
Given a point P0 (x0 , y0 , z0 ) lying on the plane and the unit normal ~n(n1 , n2 , n3 ) coming out of the
plane, we are going to find the equation of the plane. If the point P (x, y, z) lies on the plane (see
−−→ −−→
Figure 17), then clearly the vector P P0 is perpendicular to ~n as P P0 lies in the plane. Thus, we
have:
−−→
P P0 · ~n = 0
This equation can be expanded to get:
Example 11. Find an equation of the plane through A(0, 0, 1), B(2, 0, 0) and C(0, 3, 0).
We can find a vector normal to the plane (see Figure 18) as:
−−→ −→
~n = AB × AC = (3, 2, 6)
CME 100 Fall 2009 15/131
~n(n1 , n2 )
P0 (x0 , y0 )
P (x, y)
x
Figure 15: A line in 2D
P0 (x0 , y0 , z0 )
~v (v1 , v2 , v3 )
y
P (x, y, z)
x
Figure 16: A line in 3D
P0 (x0 , y0 , z0 )
~n(n1 , n2 , n3 )
P (x, y, z)
x
Figure 17: A plane in 3D
16/131 CME 100 Fall 2009
A(0, 0, 1)
~n(n1 , n2 , n3 )
y
C(0, 3, 0)
B(2, 0, 0)
x
Figure 18: A plane through the three points A, B and C
which simplifies to
3x + 2y + 6z = 6
MATLAB code:
>> A = [0 0 1];
>> B = [2 0 0];
>> C = [0 3 0];
>> n = cross(B-A,C-A)
n = 3 2 6
Example 12. Find the equation of the line of intersection of the two planes: 3x − 6y − 2z = 15
and 2x + y − 2z = 5 (see Figure 19).
First, we find a point lying on the line of intersection. Since there are an infinite number of such
points, we find one point on this line by taking z = 0 and solving
3x − 6y = 15
2x + y = 5
The solution of the above equations, Q(3, −1, 0), is a point lying on the line of intersection of the
planes. Now, considering the normal vectors ~n1 and ~n2 to the two planes, we can see that a vector
~v in the direction of the line of intersection is perpendicular to both ~n1 and ~n2 . Thus, we can take:
3x − 6y − 2z = 15
n~1
2x + y − 2z = 5
n~2 ~v
Q
x = 3 + 14t
y = −1 + 2t
z = 15t
Example 13. Find the shortest distance from the point Q(0, 1, 1) to the plane 4y + 3z = −12 (see
figure 20).
Q
~n h θ
P
4y + 3z = −12
First, note that the components of the normal vector to the plane, ~n, are (0, 4, 3). Looking at the
equation of the plane again, we can see that the point P (0, −3, 0) satisfies the equation of the plane
−−→
and hence lies on the plane. Take vector P Q and draw the projection onto ~n. The distance to the
plane h is then given by: −−→
−
−→ P Q · ~n
h = proj~n P Q = = 3.8
|~n|
MATLAB code:
18/131 CME 100 Fall 2009
>> P = [0 -3 0];
>> Q = [0 1 1];
>> n = [0 4 3];
>> abs(dot(Q-P,n)/norm(n))
ans = 3.8000
Example 14. Find the distance (i.e., the shortest distance) from the point P (0, 0, 12) to the line:
x = 4t, y = −2t, z = 2t (see Figure 21).
P
O θ
h
~v
Let O be any point lying on the line and let ~v be a vector in the direction of the line. From the
figure, we can see that the distance h is given by:
−−→
h = |OP | sin θ
We also know that: −−→
OP × ~v = |−
−→
OP | |~v | sin θ
Thus, we have:
−−→
|OP × ~v |
h=
|~v |
It is easy to check that the point O(0, 0, 0) lies on the line and the vector ~v is given by (4,−2,2).
Hence we have
|(24, 48, 0)| √
h= = 120
|(4, −2, 2)|
Example 15. Find the angle between the two planes: x + y = 1 and 2x + y − 2z = 2 (see figure 22).
First, note that the angle between two planes is defined as the angle between the normal vectors
of the planes. The normal to the first plane is ~n1 (1, 1, 0) and the normal to the second plane is
~n2 (2, 1, −2). The angle between the two vectors can be computed using the dot product as
~n1 · ~n2
cos θ =
|~n1 | |~n2 |
This can be computed using MATLAB as follows
CME 100 Fall 2009 19/131
n~1
n~2 θ
Example 16. Find the distance between two skewed lines. The parametric equation of the first line
is (0, 5, −1) + t (2, 1, 3) and the parametric equation of the second line is (−1, 2, 0) + t (1, −1, 0).
~v1
P1
P
h ~v2
Q Q1
First of all, note that we have ~v1 = (2, 1, 3) and ~v2 = (1, −1, 0) and also two points lying on the
two lines as P = (0, 5, −1) and Q = (−1, 2, 0) respectively. From Figure 23, if points P1 and Q1
−−−→
are such that P1 Q1 is perpendicular to ~v1 and ~v2 , then the distance h between P1 and Q1 is equal
to the distance between the 2 lines. Thus, we can compute
>> P = [0 5 -1];
>> Q = [-1 2 0];
>> v1 = [2 1 3];
>> v2 = [1 -1 0];
>> abs(dot(Q-P,cross(v1,v2))/norm(cross(v1,v2)))
ans = 2.8868
(c) The DNA molecule forms a double (d) Collagen, a protein found in mus-
helix cles and bones, forms a triple helix
~v (t)
~r(t)
The velocity is always tangent to the curve parameterized by the path as shown in Figure 25.
Similarly, the acceleration of the particle along the path is given by
d~v
~a =
dt
d d~u d~v
[~u(t) + ~v (t)] = +
dt dt dt
d d~u
[c ~u(t)] = c
dt dt
d dh d~u
[h(t)~u(t)] = ~u + h
dt dt dt
d d~u d~v
[~u(t) · ~v (t)] = · ~v + ~u ·
dt dt dt
d d~u d~v
[~u(t) × ~v (t)] = × ~v + ~u ×
dt dt dt
d df d~u
[~u(f (t))] =
dt dt df
Example 17. A particle is moving along the parabola y = x2 . The path is: ~r(t) = t~i + t2~j. Find
the velocity, acceleration and speed at t = 2.
We can find the velocity and acceleration of the particle using our definitions as:
d~r ~
~v = = i + 2t~j
dt
d~v
~a = = 2~j
dt
√ √
At t = 2, the speed is |~v (2)| = |~i + 4~j| = 1 + 42 = 17.
Example 18. A path is given by ~r = b cos ωt~i + b sin ωt ~j + ct ~k. Find the velocity and acceleration.
d~r
~v = = −bω sin ωt~i + bω cos ωt ~j + c ~k
dt
d~v
~a = = −bω 2 cos ωt~i − bω 2 sin ωt ~j
dt
Note that the path is a helix which translates in the ~k direction; the computed acceleration always
points towards the center of the circle that the helix moves in. This can be seen in Figure 26.
Application of this example: Assume we have a charged particle with charge q, moving in a
magnetic field B ~ along the path defined above. We know that the force on the particle is given by
F~ = (q~v ) × B,
~ where B~ = B~k. Thus, the force is equal to:
~a ~a
~a
x
Figure 26: Acceleration of a helical path (top view)
Also, from Newton’s second law we have F~ = m~a. Equating these two, we get:
−mbω 2 = qbωB
For example, we can integrate the velocity vector ~v (t) to get the trajectory ~r(t):
Z t
~r(t) − ~r(0) = ~v (τ ) dτ
0
The only force on the projectile is due to gravity which is acting vertically down and hence Newton’s
second law gives us F~ = m~a = −mg ~j, which in turn says that the acceleration is given by ~a = −g ~j.
We can now integrate the expression for acceleration to get the velocity as:
Z t
~v (t) − ~v0 = ~a(τ ) dτ = −gt ~j
0
24/131 CME 100 Fall 2009
y
~v0 = ~v (0)
h
θ
x
The initial velocity ~v0 is given by v0 (cos θ ~i + sin θ ~j). Using this initial condition, we get
Now, note that the projectile reaches the maximum height when the ~j component of the velocity
is zero, i.e., at t = v0 sin θ/g. We can use this time to compute the maximum height h as
2
v0 sin θ v0 sin θ v02 sin2 θ
g
h = v0 sin θ − =
g 2 g 2g
To compute the flight time, note that the flight ends when the projectile hits the ground, i.e., when
the ~j component of ~r is 0, which gives us the condition:
g t2F
v0 (sin θ)tF − =0
2
Thus, we have the flight time tF as:
2v0 sin θ
tF =
g
Finally, now that we know the flight time, we can use it to easily compute the range by computing
the horizonal (that is along ~i) component of ~r(t) when t is equal to the flight time:
v0
Plane
φ hay bale
h ~v
Cattle
x
Figure 28: Snow bound cattle
Example 20. Snow bound cattle. A plane is flying at an altitude of 1600 ft at a speed of 220
ft/sec. What is the angle of sight at which the plane should release hay bales for snow bound cattle
(see figure 28)?
We will denote the height of the plane as h = 1600 ft and the horizonal velocity of the plane as
v0 = 220 ft/sec. Also, let the horizontal distance between the plane and the cattle be x ft. Then
from the figure, we have tan φ = hx . Also, the only force acting on the hay bales is gravity and
hence the acceleration of the hay bales is given by ~a = −g ~j which can be integrated w.r.t. time to
get the velocity of the hay bales as
~v = v0 ~i − gt ~j
Integrate this again to get the trajectory of the hay bales as:
gt2 ~
~r = v0 t~i + h~j − j
2
q
gt2
The hay bales hit the ground when h − 2 = 0, i.e., when t = g .
2h
Thus, we have:
s
2h
x = v0
g
1
r
gh
tan φ =
v0 2
MATLAB code
6 Differential geometry
Differential geometry deals with application of calculus to geometry, e.g., calculus and analysis are
used to understand the geometry of curves and surfaces.
~r(t)
∆L
~r(t + ∆t)
Example 21. Find the arc length for one turn of ~r = b cos ωt~i + b sin ωt ~j + ct ~k.
The given path describes a helix (see Figure 30) whose axis points in the positive z direction. We
can compute the velocity along the path by differentiating the position vector as follows:
~v (t) = −b ω sin ωt~i + b ω cos ωt ~j + c ~k
This gives the magnitude of the velocity (speed) as
q
|~v (t)| = (b ω)2 sin2 ωt + (b ω)2 cos2 ωt + c2 = (b ω)2 + c2
p
Thus the arc length of one turn is given by integrating the speed as:
Z 2π
ω 2π p
L= |~v (τ )| dτ = (b ω)2 + c2
0 ω
s(t)
0
t, ~r(t)
Figure 31: The arc length function
The above expression depends solely on the geometry of the curve and not how fast the curve is
traced by ~r(t). In fact ~r(s) has unit speed, i.e., s(t) is such that the particle is tracing the curve
with unit speed.
Example 22. Re-parameterize the helix ~r(t) = cos t~i + sin t ~j + t ~k with respect to arc length
measured from (1, 0, 0).
√
We can calculate ds
dt = | d~rdt(t) | = 2, and so:
d~r(τ )
Z t √
s = s(t) = dτ dτ = ( 2) t
0
Therefore t = √s
2
and the re-parametrization is obtained by substituting for t:
s ~i + sin s ~j + s ~k
~r(t(s)) = cos √ √ √
2 2 2
You can check that with this re-parametrization, the speed of ~r(t(s)) is 1.
d~r
T~ =
ds
T~
This is a unit vector and it is parallel to the velocity vector ~v . We can compute T~ using the above
definition in terms of the velocity vector as:
6.4 Curvature
Intuitively, we can think of curvature as measuring the amount of “curviness” near a point. For
example, the curvature K of a straight line is 0 as the curve is straight; the curvature of a circle is
given by the reciprocal of the radius K = 1/r.
Formally, the curvature K is defined as the rate with which the direction of the unit tangent vector
T~ is changing, i.e.:
dT~
K=
ds
We can compute this by applying the chain rule to evaluate the right hand side as:
dT~ dT~ dt dT~ 1 1 dT~
= = =
ds dt ds dt ds
dt
|~v | dt
Thus, we get the following expression for the curvature:
1 dT~
K=
|~v | dt
This is easy to compute since curves are usually described using a parametrization ~r(t) from which
T~ (t) and ~v (t) can be easily calculated.
Example 23. For the trajectory ~r = b cos t~i + b sin t ~j + ct ~k, determine the following: velocity and
acceleration, unit tangent vector, and curvature.
Velocity and acceleration vectors: The velocity vector can be obtained by differentiating the
path w.r.t. time:
~v = −b sin t~i + b cos t ~j + c ~k
Similarly, the acceleration vector can be obtained by differentiating the velocity w.r.t. time:
~a = −b cos t~i − b sin t ~j
√
Unit tangent vector: Note that |~v | = b2 + c2 . We can thus compute the tangent vector as:
~v b b c ~k
T~ = = −√ sin t~i + √ cos t ~j + √
|~v | b +c
2 2 b +c
2 2 b + c2
2
~ = T~ × N
B ~
7.2 Torsion
~ that ~ ~ . We can then define the
It can be shown from the above definition of B, dB
ds is parallel to N
torsion τ as the coefficient of proportionality:
~
dB ~ (s)
= −τ N
ds
We can rewrite this equation in terms of t to get the equation for torsion as
!
1 dB ~
τ =− ~
·N
|~v | dt
Intuitively, the torsion measures by how much the path twists out of the osculating plane. You can
visualize this on Figure 34.
Example 24. For the vector valued function ~r = b cos t~i+b sin t ~j +ct ~k, determine the unit tangent
vector, the curvature, the unit normal vector, the bi-normal vector, and the torsion.
CME 100 Fall 2009 31/131
• Unit normal vector: Recall from the previous lecture that we computed the following quan-
tities:
– The curvature
b
K=
b2 + c2
We can now find the unit normal vector using our definition as
~ (t) = − cos t~i − sin t ~j
N
• The curvature:
|~v × ~a|
K=
|~v |3
• The torsion (if you know how to compute the determinant of a 3 × 3 matrix):
ẋ ẏ ż
1
τ=
ẍ ÿ z̈
|~v × ~a| ... ...
2 ...
x y z
CME 100 Fall 2009 33/131
π
4
(1, 1)
(0, 0)
Joining the tracks with a straight line will not work as we want it to be smooth, i.e., the slope and
curvature should be continuous. Assume for simplicity that we look for a polynomial representation
of the tracks:
y(x) = Ax5 + Bx4 + Cx3 + Dx2 + Ex + F
For the curvature and slope to be continuous at (0,0) and (1,1), we need the following conditions
to be satisfied: y(0) = 0, y 0 (0) = 0, y 00 (0) = 0 and y(1) = 1, y 0 (1) = 1 and y 00 (1) = 0. The second
derivative conditions are due to the curvature. We can impose these conditions on our polynomial
function and solve for the 6 variables from the 6 equations that we get. The resulting curve is
depicted in Figure 36 and the resulting equation is:
y(x) = 3x5 − 8x4 + 6x3
34/131 CME 100 Fall 2009
Train tracks
1.6
1.4
1.2
(1,1)
0.8
0.6
0.4
0.2
(0,0)
0
8 Kepler’s laws
Kepler gave 3 laws for planetary motion which were based on his experimental observations. It
is interesting to note that these laws were not based on physics laws but were an attempt to
understand observations that Kepler had made during his study of planets. Later on, scientists like
Newton and Bernoulli proved these laws mathematically. Kepler’s laws are as follows:
1. The orbit of a planet is elliptical, with the sun at one of the foci of this ellipse. An ellipse is
shown in Figure 37.
Figure 37: An ellipse with the two foci F1 and F2 shown as blue dots and the length of semi-major
and semi-minor axis as a and b respectively.
2. During equal periods of time, a planet sweeps through equal areas with respect to the sun.
This is illustrated in Figure 38.
CME 100 Fall 2009 35/131
Figure 38: Kepler’s second law states that if t2 − t1 = t4 − t3 , then A1 = A2, where A1 and A2 are
the areas of the shaded regions.
3. Let T be the period of the revolution and a be the semi-major axis of the ellipse. Then we
have
4π 2 3
T2 = a
GM
where G = 6.67 × 1011 Nm2 Kg−2 and M is the mass of the object around which the planet is
orbiting, e.g., the sun for which M = 1.98892 × 1030 Kg.
In case you are interested, the proof of correctness of Kepler’s laws is in the textbook.
Example 25. A communications relay satellite is placed in a circular orbit around the Earth. Its
period of revolution is 24 hours. Given that the moon period is 27.32 days and that its circular
orbit is 238,850 miles, what is that semi-major axis a of the satellite?
Using Kepler’s third law, we have that T 2 ∝ a3 . Thus, we must have
2
Tmoon 2
Tsat
= 3
a3moon asat
Thus, we can compute
2/3
Tsat
asat = amoon = 26, 330 miles
Tmoon
1. Graph of the function f (x, y): this is the set of all points (x, y, f (x, y)). An example of a
graph is shown in Figure 39.
2. Contour curves are defined as the locus of points (x, y, z) (a curve in 3D) such that f (x, y) =
z = c. They are obtained by intersecting the graph with planes of constant height: z = c.
An example of the contour curves is shown in Figure 40.
3. Level curves are the projection of contour lines in the x-y plane. For example, the level
curves for the function f (x, y) = y 2 − x2 are plotted in Figure 41. Another application of
level curves is topographic maps, which are used very frequently to generate terrain maps, an
example of which is the lonely mountain map shown in Figure 42.
lim f (x) = L
x→a
CME 100 Fall 2009 37/131
Figure 40: Contour curves for the function f (x, y) = y 2 − x2 (plotted using MATLAB)
Figure 41: Level curves of the function f (x, y) = y 2 − x2 (plotted using MATLAB)
38/131 CME 100 Fall 2009
lim f (x, y) = L
(x,y)→(x0 ,y0 )
Definition: L is the limit of f at (x0 , y0 ) if one can make the value of f arbitrarily close to L by
keeping (x, y) close to (x0 , y0 ).
Answer:
lim xy = 2 · 3 = 6
(x,y)→(2,3)
t2 00
f (x) = f (0) + tf 0 (0) + f (0) + · · ·
2!
Use the Taylor expansion of sin(t):
t3
sin(t) = t − + ···
6
Thus, we have
sin(t) t2
= 1 − + ···
t 6
Using this fact, we have
sin(x2 + y 2 ) sin t
lim = lim =1
(x,y)→(0,0) x +y
2 2 t→0 t
CME 100 Fall 2009 39/131
sin(x2 +y 2 )
Figure 43: Plot of the function f (x, y) = x2 +y 2
sin(x2 +y 2 )
We can also find this answer using l’Hôpital’s rule. The function f (x, y) = x2 +y 2
is plotted in
Figure 43.
1. Approaching (0,0) along y = 0: we know that f (x, y) = 0 along the x-axis and hence the
limit along this line is 0.
2. Approaching (0,0) along x = 0: we know that f (x, y) = 0 along the y-axis and hence the
limit along this line is also 0.
x(mx) m
f= =
x2 + (mx)2 1 + m2
Thus, depending on the direction of approach, f converges to different values which implies that
the function has no limit at (0,0).
The above computations can be visualized on the function plot shown in Figure 44.
9.2.2 Continuity
The function f is continuous at point P if:
1. f is defined at P .
40/131 CME 100 Fall 2009
xy
Figure 44: MATLAB plot of the function f (x, y) = x2 +y 2
2. f has a limit at P .
3. limQ→P f (Q) = f (P ).
10 Partial derivatives
Given a function f (x, y, z), we define the partial derivative as
∂f f (x + h, y, z) − f (x, y, z)
= lim
∂x h→0 h
This is the same as computing an ordinary derivative with respect to x if we imagine that y and z
are fixed parameters. The derivatives with respect to y and z are defined in a similar fashion.
Example 31. For the function f (x, y, z) = xy 2 sin(yz), find all the first and second order partial
derivatives.
∂f
= y 2 sin(yz)
∂x
∂f
= x(2y) sin(yz) + xy 2 (z cos(yz))
∂y
∂f
= xy 2 (y cos(yz))
∂z
CME 100 Fall 2009 41/131
∂2f
∂ ∂f
= = 2y sin(yz) + y 2 z cos(yz)
∂x∂y ∂x ∂y
Note that the order of the derivatives does not matter and we have the important result:
∂2f ∂2f
=
∂x∂y ∂y∂x
There are 2 independent variables x and y here, while z is a dependent variable which depends on
x and y. Even though there is no explicit expression for z, such as z = f (x, y), the solution z of
the equation can be viewed as a function of x and y. Thus, to compute the partial derivative of
z w.r.t. x, we consider y as fixed, and use the chain rule and the product rule to differentiate the
equation:
∂
x3 z + y cos z = 0
∂x
∂z ∂z
3x2 z + x3 + y(− sin z) =0
∂x ∂x
∂z 3x2 z
=− 3
∂x x − y sin z
We can do the same calculation with y to get
∂z cos z
=− 3
∂y x − y sin z
10.2 Applications
10.2.1 Partial Differential Equations
These arise in many areas, such as
1. Steady state temperature: the Laplace equation governs the variation of temperature T (x, y)
in space at steady state:
∂2T ∂2T
+ =0
∂x2 ∂y 2
42/131 CME 100 Fall 2009
2. The displacement y(x, t) of a vibrating string is described by the one dimensional wave equa-
tion:
∂2y ∂2y
= a
∂t2 ∂x2
where the coefficient a depends on density and tension.
3. The temperature T (t, x, y) of an insulated thin plate follows the heat equation:
2
∂2T
∂T ∂ T
=k +
∂t ∂x2 ∂y 2
4. A surface such that it has the least surface area for a given boundary is called a minimal
surface. This is the case for soap bubbles for example. Then z = f (x, y) must satisfy
Given a function f (x, y, z) where x, y and z depend on u and v, i.e., we have functions x(u, v),
y(u, v) and z(u, v), the chain rule of differentiation gives:
∂ ∂f ∂x ∂f ∂y ∂f ∂z
f (x(u, v), y(u, v), z(u, v)) = + +
∂u ∂x ∂u ∂y ∂u ∂z ∂u
The derivative with respect to v can be computed in a similar fashion.
∂f ∂f
Example 34. Given a function f (x, y) and x = r cos θ, y = r sin θ, compute ∂r and ∂θ .
To find ∂f ∂f ∂f ∂f
∂x and ∂y , we can solve for these in terms of ∂r and ∂θ using equations (3) and (4). This
is easier than re-computing these using the chain rule. We obtain:
∂f ∂f sin θ ∂f
= cos θ −
∂x ∂r r ∂θ
∂f ∂f cos θ ∂f
= sin θ +
∂y ∂r r ∂θ
44/131 CME 100 Fall 2009
Example 35. Folium of Descartes. Given the implicit function F (x, y) = x3 + y 3 − 3xy = 0,
dy
compute dx . This function is plotted in Figure 46.
We have
Fx = 3x2 − 3y
and also
Fy = 3y 2 − 3x
Thus, using equation (5), we have:
dy Fx x2 − y
=− =− 2
dx Fy y −x
From this result, we conclude that the slope is zero when y = x2 and is infinite when x = y 2 . Look
at Figure 46 to verify this is correct.
Descartes was first to discuss this curve, which he discovered in an attempt to challenge Fermat’s
extremum-finding techniques, in 1638. Although Descartes found the correct shape of the curve in
the positive quadrant, he believed that this leaf shape was repeated in each quadrant like the four
petals of a flower. Descartes challenged Fermat to find the tangent line at arbitrary points. Fermat
achieved success immediately, much to the chagrin of Descartes. In French the Folium of Descartes
(leaf in latin) is sometimes called the nœud de ruban.
Reading: Thomas - 14.5, 14.6, 14.7, 14.8, 14.9
11 Partial derivatives
11.1 Linearization
The basic idea of linearization is to approximate a given function f (x) by a linear function (a line)
f (x0 ) + f 0 (x0 )(x − x0 ) in the neighborhood of a point x0 as shown in figure 47.
We can similarly approximate a multi-variable function f (x, y) by a tangent plane in the neighbor-
hood of a point (x0 , y0 ) as (see figure 48):
If we denote the function f (x, y) by z, then we get the equation of the tangent plane by rearranging
the above equation as
z − z0 = (x − x0 )fx + (y − y0 )fy
CME 100 Fall 2009 45/131
Folium of Descartes
2
(1.3,1.6)
(1.6,1.3)
1
0
y
(0,0)
−1
−2
−2 −1 0 1 2
x
f (x)
x0 x
(x0 , y0 , z0 )
Tangent plane
fx x + fy y − z = fx x0 + fy y0 − z0
We can now see that the normal to the plane is given by ~n = (fx , fy , −1).
The idea of linearization can be generalized to functions in any dimension N :
f (x1 , · · · , xN ) = f (x01 , · · · , x0N ) + (x1 − x01 )fx1 (x01 , · · · , x0N ) + · · · + (xN − x0N )fxN (x01 , · · · , x0N )
Example 36. Two resistors R1 and R2 are connected in parallel. If R1 = 200 Ω and R2 = 300 Ω
and if these values may be in error by as much as 2 Ω, estimate the maximum error in the calculated
value of the combined resistance.
R1
R
⇐⇒
R2
Figure 49: The resistor R is equivalent to the two resistors R1 and R2 connected in parallel
120 2 120 2
|∆R| ≤ 2+ 2 = 1.04 Ω
200 300
Example 37. Compute the partial derivative of the volume of a cylinder with respect to its height
and radius. Perform a linearization around r = 1, h = 5.
CME 100 Fall 2009 47/131
We know that the volume of a cylinder is given by V = πr2 h. This can be linearized using the
partial derivatives w.r.t. r and h:
∆V ≈ π 2rh∆r + r2 ∆h
If we reduce the radius by ε, i.e., ∆r = −ε and increase the height by 10ε, i.e., ∆h = 10ε, the
change in volume is:
∆V = π [−10ε + 10ε] = 0
The volume is roughly unchanged! This shows that it is 10 times more sensitive to the radius than
the height!
f (x + u1 h, y + u2 h) − f (x, y)
D~u f = lim
h→0 h
where D~u f denotes the directional derivative of the function f along the unit vector ~u.
To obtain a more explicit expression, define the function g(h) = f (x0 + u1 h, y0 + u2 h) which can
be differentiated to get
dg ∂f d ∂f d ∂f ∂f
= (x0 + u1 h) + (y0 + u2 h) = u1 + u2
dh ∂x dh ∂y dh ∂x ∂y
dg ∂f ∂f
D~u f = (0) = u1 + u2
dh ∂x ∂y
11.2.2 Gradient
→
−
The vector ∂f , ∂f
∂x ∂y is called the gradient of f and is denoted by ∇f . The gradient is also
sometimes written as ∇f (the notation that we will use). You should note that it is a vector.
The definition of the directional derivative gives us the following relationship with the gradient:
D~u f = ∇f · ~u
48/131 CME 100 Fall 2009
~j
~u
~i
In addition, D~u f is maximum when ~u points in the direction of ∇f and is minimum when ~u points
in the opposite direction. Note that:
1. D~u f = 0 if ~u is perpendicular to ∇f .
The function z = f (x, y) = y 2 − x2 is plotted in Figure 51 and its level curves and gradient are
plotted in Figure 52.
Figure 52: Plotting the gradient vectors and the level curves of the surface f (x, y) = y 2 − x2 . Note
that the vectors are normal to the level curves.
3~i+4 ~j
2. The directional derivative in the direction of ~u = 5 at (1,1)
4. A particle moves by a distance of 0.1 units in the direction of the gradient. Determine the
approximate change in z.
3~i+4 ~j
2. The directional derivative in the direction of ~u = 5 at (1,1):
We have
3 4 14
D~u f = ∇f · ~u = (−2, −2) · , =−
5 5 5
4. A particle moves by a distance of 0.1 units in the direction of the gradient. Determine the
approximate change in z:
50/131 CME 100 Fall 2009
11.2.4 Application
The gradient is very useful for numerically finding the maximum and the minimum of functions.
For example, to find the maximum of a function, you can start from a point (x0 , y0 ) and keep
taking a small step in the direction of the gradient until a maximum is found. This leads to the
important problem of optimization which is the goal of many engineering projects.
12 Optimization
Optimization is concerned with finding the extremum (maximum or minimum) of functions.
Global minimum: A function f (x) has a global minimum at point x0 if the value of f (x) at
any point in the entire domain of f (x) is greater than f (x0 ).
Local maximum: A function f (x) has a local maximum at point x0 if the value of f (x) at
all points x in the immediate neighborhood of x0 is less than f (x0 ).
Global maximum: A function f (x) has a global maximum at point x0 if the value of f (x)
at any point in the entire domain of f (x) is less than f (x0 ).
Figure 53 illustrates these different definitions.
We can formulate three conditions which must be met (necessary conditions) for a 2D function
f (x, y) to have an extremum at the point (a, b):
fx = fy = 0
CME 100 Fall 2009 51/131
Figure 53: This function has local and global maxima and minima
2. fx or fy is not defined.
3. The point (a, b) is on the boundary.
Example 39. Find the extremum of the function f (x, y) = x2 + y 2 .
Given the function, we can compute fx = 2x and fy = 2y. We can check that the function is
smooth and the domain includes the entire real plane. Hence, the conditions fx = 0 and fy = 0
give us the point (x, y) = (0, 0) as the global minimum. The global maximum is at infinity.
Example 40. Find the extremum of the function f (x, y) = x2 + y 2 in the region defined by
p
0 ≤ x2 + y 2 ≤ 1.
We can check that the function is smooth (except at the point (0,0)) and the domain is given to
us. And we can compute the partial derivatives as
x
fx = p
x + y2
2
y
fy = p
x + y2
2
At the point (0, 0) the derivatives are not defined and the function has a global minimum at that
point. The function attains its global maximum at all points that lie on the unit circle x2 + y 2 = 1.
The function is plotted in Figure 54. Note that the level curves of the function are circles and thus
the boundary of the given domain exactly matches one of the level curves: x2 + y 2 = 1.
Example 41. Find the extremum of the function f (x, y) = x2 − y 2 .
Note that there are no global extremum for this function as we can put y = 0 and take x as large
as we want to have f = ∞. Similarly, we can also have f = −∞ at (0, ∞). Now, we will look for
local extremum and compute fx = 2x and fy = −2y. Note that putting fx = fy = 0 gives us the
point (0, 0). But at that point the function has neither a maximum nor a minimum: such a point
is called a saddle point. This can be visualized in Figure 55 where two level curves intersect at the
point (0,0) and the function increases in the region on the left and right of these curves, while it
decreases in the region on the top and bottom, indicating that the function has a saddle point at
(0,0).
52/131 CME 100 Fall 2009
Figure 55: Level curves of the surface f (x, y) = x2 − y 2 . The blue arrows indicate the direction
in which the function decreases and the red arrows indicate the direction in which the function
increases.
CME 100 Fall 2009 53/131
1. ∆ > 0 and A > 0: the function has a local minimum at (a, b).
2. ∆ > 0 and A < 0: the function has a local maximum at (a, b).
4. ∆ = 0: the test provides no information. Higher order derivatives are needed (think about
x4 at x = 0).
Example 42. Show that f (x, y) = x2 − y 2 has a saddle point at (0, 0).
We have fx = 2x, fy = −2y and fx = fy = 0 at the point (0, 0). Now, we can compute A = fxx = 2,
B = fxy = 0 and C = fyy = −2. Thus, ∆ = 2(−2) − 02 = −4: we have a saddle point at (0,0)!
Example 43. Find the least amount of plywood needed to construct a closed rectangular box of a
given volume V (see Figure 56).
z
y
x
Figure 56: Calculating the plywood needed to construct a box
The surface area of the box is given by S = 2xz + 2xy + 2yz and the volume is given by V = xyz.
Thus, we have z = yzV
and can put this in the expression for the surface area to get
V V
S = 2x + 2xy + 2y
xy xy
V V
=2 + xy +
y x
We can compute the partial derivatives and set them equal to zero:
∂S 2V
= − 2 + 2y = 0
∂x x
∂S 2V
= − 2 + 2x = 0
∂y y
V = x2 y
V = xy 2
54/131 CME 100 Fall 2009
1
and consequently, we have x = y. We finally get that x = y = z = V 3 is the only critical point.
Now, to determine if this critical point is a minimum, we need to examine the second derivatives
according to the test described earlier. Computing the derivatives, we have A = Sxx = 4V
x3
= 4 and
similarly, B = 2 and C = 4. Thus, we can compute
∆ = AC − B 2 = 16 − 4 = 12
1 1 1
Since ∆ > 0 and A > 0, we can see that (V 3 , V 3 , V 3 ) is the local minimum and hence the least
amount of plywood is needed when all three dimensions of the box are equal.
Example 44. Determine an equation of the line that best fits n data points (x1 , y1 ), · · · , (xn , yn )
in the least squares sense.
Suppose that we have a line with slope a and intercept b. Then, the error (see Figure 57) in the
ith measurement is given by
Ei = axi + b − yi
where (xi , yi ) is the ith measurement.
y
y = ax + b
yi
Ei
xi x
Figure 57: Error in a measurement
Since we want the “best” fit of the line, our objective can be stated as minimizing the sum of all
the errors. For the least square approximation, we use the following function to be minimized:
n n
(axi + b − yi )2
X X
E= Ei2 =
i=1 i=1
and
n
∂E X
= −2 2 (axi + b − yi ) = 0
∂b
i=1
Xn n
X
⇒ a xi + nb − yi = 0 (7)
i=1 i=1
n
1 X
b= yi − a xi
n
i=1
Figure 58: Computing the least squares line for given points (shown as circles)
Example 45. The temperature over a semicircular disk of radius 1 is given by: T (x, y) = xy + x2 .
Find the absolute maxima and minima (if any) over the specified region.
We first look for the critical points of the function T inside the semicircular disk using the equations:
∂T
= y + 2x = 0
∂x
∂T
=x=0
∂y
The solution to these equations is given by x = y = 0.
Now, we look for extremum points on the boundary. For the diameter of the disk, i.e., −1 ≤ x ≤ 1
and y = 0, we have T = x2 . By inspection, we can see that the minimum of this function is T = 0
at x = 0 and the maximum of the function is T = 1 and x = ±1.
56/131 CME 100 Fall 2009
For the circular part, we can parameterize the coordinates as x = cos θ and y = sin θ. Thus we
have
T (θ) = cos θ sin θ + cos2 θ
1
= (1 + cos(2θ) + sin(2θ))
2
We can now find the critical points of this 1D function by solving dT
dθ = 0 which gives
−2 sin(2θ) + 2 cos(2θ) = 0
tan(2θ) = ±1
The solution is given by:
π 5π π 5π
2θ =
, ⇒ θ= ,
4 4 8 8
We can compute the value of the function at these points:
π 1 + √2
T = ≈ 1.2
8 2√
5π 1− 2
T = ≈ 0.2
8 2
√
Thus the absolute maximum value of the function is 1+ 2
which occurs at the point cos π8 , sin π8
√2
and the absolute minimum value of the function is 1− 2
which occurs at the point cos 5π
8 , sin 8 .
5π
2
The minimum and the maximum are shown in Figure 59.
1.2
1
1 Min
0.8
0.8
0.6 0.6
Figure 59: The minimum and the maximum temperature over the semi-circular region
−1
−2
−2 −1 0 1 2
Example 47. Suppose we want to cut a rectangular beam from a given elliptical log (with the length
of the semi-major axis 2 and the length of the semi-minor axis 1). We want to maximize the area
of the rectangular beam in order to extract the maximum wood from the log. Find the dimensions
of the maximum area rectangular beam that can be cut from this log.
2 2
We want to minimize the area function f (x, y) = 4xy subject to the constraint that x2 + y1 = 1.
We can write our 3 equations as:
2x
4y = λ
4
4x = λ 2y
x 2
+ y2 = 1
2
58/131 CME 100 Fall 2009
√
We can solve this system of equations to get x = 2, y = √12 and λ = 4. The situation is depicted
in Figure 61. Note that the area function is a hyperbola and it is tangent to the ellipse at the
optimal points.
1.5
0.5
−0.5
−1
−1.5
−2 −1 0 1 2
Figure 61: The maximum area rectangle that can fit in an ellipse
Example 48. This is a problem in economics. The gross output Q can often be approximated using:
Q = AK a L1−a where K is the capital investment and L is the amount of labor. This problem is
subject to the constraint that the total cost of operation is fixed: M = pK + wL. How would you
choose K and L in order to optimize Q and therefore your profit? Use a Lagrange multiplier to
find the solution.
Here, g(K, L) = pK + wL − M . Our unknowns are K, L and λ and we can write our equations as:
∂Q ∂g
=λ
∂K ∂K
∂Q ∂g
=λ
∂L ∂L
pK + wL = M
1 ∂Q 1 ∂Q
K+ L=M
λ ∂K λ ∂L
Using the definition of Q, we get
1 1
aQ + (1 − a)Q = M
λ λ
CME 100 Fall 2009 59/131
Q
which gives us λ = M. Hence, from Equation (8), we get
∂Q Q
= p
∂K M
p
which implies that ∂
∂K ln Q = M. From the definition of Q = AK a L1−a , this implies that:
a p
=
K M
∂Q Q
Similarly, from ∂L = M w, we get:
1−a w
=
L M
As a conclusion, at the maximum, we have
(1 − a)M
aM
K= L= , ,
p w
a
1 − a 1−a
a
and Q = AM .
p w
Reading: Thomas - 15.1, 15.2
Note that the order of integration does not change the value of the integral and we have
Z b Z d Z d Z b
f (x, y)dy dx = f (x, y)dx dy
a c c a
We can also define the integral R f (x, y)dxdy over the rectangle R (see Figure 62(a)). It is defined
RR
as follows. Let’s divide the region R into smaller regions as shown in Figure 62(b). Then, we get
x1 = a
x2 = a + h
xi = a + (i − 1)h
and
y1 = c
y2 = c + h
yi = c + (i − 1)h
60/131 CME 100 Fall 2009
y y
d R d R
c c
a b x a b x
14.1.2 Properties
We have the following properties for the double integral:
ZZ ZZ
c · f (x, y)dxdy = c · f (x, y)dxdy
ZZ R ZZ R ZZ
(f (x, y) + g(x, y)) dxdy = f (x, y)dxdy + g(x, y)dxdy
R ZZ R R
R1 R
R2
z = f (x, y)
y y
y2(x)
d
x1(y) x2(y)
y1(x) c
a b x x
"Z #
ZZ Z d x2 (y)
f (x, y)dxdy = f (x, y)dx dy
R c x1 (y)
Advice: Always plot the region of integration to decide between these cases.
Example 50. Find the area of the triangle formed by (0,0), (1,0) and (1,1) using a double integral
(see Figure 66).
(1,1)
(0,0) (1,0)
We can see that the triangle is both vertically simple and horizontally simple. Let’s compute the
area A using the formula for a vertically simple region as:
1 Z x 1
1
Z Z
A= dy dx = xdx =
0 0 0 2
Example 51. Find the volume of the prism whose base is the triangle in the x-y plane bounded by
the x-axis and the lines y = x and x = 1, and whose top lies in the plane z = 3 − x − y.
CME 100 Fall 2009 63/131
We can plot this triangle as shown in Figure 66. We want to compute the integral
1 Z x x 1
y2
Z Z
(3 − x − y)dy dx = 3y − xy − dx
0 0 0 2 0
Z 1
x2
= 3x − x −
2
dx
0 2
3 1 1
= − −
2 3 6
9−2−1
=
6
=1
You should check that reversing the order of the integral results in the same answer. Note that the
reverse integral would be
Z 1 Z 1
(3 − x − y)dx dy
0 y
sin x
RR
Example 52. Calculate R x dA over the triangle in the xy-plane bounded by the x-axis and the
lines y = x and x = 1.
Note that computing the reverse integral in this case turns out to be impossible:
1 Z 1
sin x
Z
dx dy
0 y x
δ(x, y)
R
xδ(x)dx
x̄ = R
δ(x)dx
RR
yδ(x, y)dxdy
ȳ = RRR
R δ(x, y)dxdy
Example 53. A thin plate covers the triangular region bounded by the x-axis and the lines x = 1
and y = 2x in the first quadrant. The density is given by δ(x, y) = 6x + 6y + 6. Find the mass and
the center of mass of the plate (see Figure 68).
y (1,2)
y = 2x
x=1
δ(x, y)
x
1
ZZ
K= δ(x, y)ω 2 r2 dxdy
R 2
where r is the distance between (x, y) and the center of rotation, i.e., r2 = x2 + y 2 . Since the
angular velocity ω is same for the entire body, we denote the polar moment of inertia I as:
ZZ
I= δ(x, y)r2 dxdy
R
to get
1
K = Iω 2
2
66/131 CME 100 Fall 2009
ω
∆m
Example 54. A thin plate covers the triangular region bounded by the x-axis and the lines x = 1
and y = 2x in the first quadrant. The density is given by δ(x, y) = 6x + 6y + 6. Find the moment
of inertia about the x-axis Ix for the plate (see Figure 70).
y (1,2)
y = 2x
x=1
δ(x, y)
x
The beams used for construction have an I-shaped cross-section and we want to analyze the prop-
erties of such beams. This shape is chosen as it is particularly strong under certain types of stress.
Here, we analyze the I-beam shown in Figure 71.
y
−1 ≤ y ≤ 1
x = −y 4 x = y4
Let us compare the stiffness of the I-beam with a rectangular beam as shown in Figure 71. The
stiffness (resistance to bending) is proportional to the moment of inertia about the horizontal axis
going through the center of mass. For the I-beam, we can compute this as
ZZ
Ix = δ(x, y)y 2 dxdy
R
Z "Z 4
1 y
#
=δ y 2 dx dy
−1 −y 4
Z 1 y4
=δ xy 2
−y 4
dy
−1
Z 1
=δ y 6 + y 6 dy
−1
1
y7
= 2δ
7 −1
4
= δ
7
68/131 CME 100 Fall 2009
2 2
Z 1
=δ y dy
−1 5
2 1
= δ y 3 −1
15
4
= δ
15
This shows that the stiffness of the I-beam is greater than a simple rectangular beam.
We want to design the wheel of a downhill race-car to obtain the fastest speed. The situation is
shown in Figure 72.
First, let us look at the kinetic energy KE of the wheel which has two components: the kinetic
energy of translation KET and the kinetic energy of rotation KER . Thus, we have
KE = KET + KER
1 1
= M v 2 + Iω 2
2 2
1 1 v2
KE = M v 2 + I 2
2 2 a
1
I
= Mv 1 +
2
2 M a2
1
= M v 2 (1 + I ∗ )
2
where I ∗ = MIa2 . Also, we note that the kinetic energy at the bottom of the hill is the same as the
potential energy at the top of the hill and hence we have
1
M gh = M v 2 (1 + I ∗ )
2
2gh
r
v=
1 + I∗
Thus, to go fast, I ∗ = I/(M a2 ) should be as small as possible. Note that the definition of I gives
us ZZ
I= δ(x, y)r2 dxdy.
R
This tells us that we want as much mass to be concentrated near the center as possible so that a
is large and I small. Therefore, a wheel in the shape of a solid disk is better than a hollow disk.
Indeed, for the hollow disk, we get I ∗ = 1 and for the solid disk, we get I ∗ = 21 . For the hollow
sphere design, we get I ∗ = 23 ; finally, the solid sphere gives us the best design with I ∗ = 25 .
70/131 CME 100 Fall 2009
Example 55. Calculate numerically using MATLAB the following single and double integrals:
Z 1 Z 1Z 1
e −2x
dx, x cos(−xy) dydx
0 0 0
1
Z 3Z x Z 2Z 4
y
dydx, dxdy
0 2y (xy) + 1
2
1 1 xy
1. Z 1
e−2x dx
0
The MATLAB code is given by:
General syntax:
int(f(x),xmin,xmax) where f(x) is the function to be integrated and xmin and xmax are
the lower and upped bounds.
quad(@(x) fun(x),xmin,xmax) where fun(x) should accept a vector argument x and return
a vector result of values of the integrand.
2. Z 1Z 1
x cos(−xy) dydx
0 0
The MATLAB code is given by:
3.
1
Z 3Z x
dydx
1 1 xy
The MATLAB code is given by:
Note the use of (y<=x) corresponding to the upper bound for the integral over y.
4. Z 2Z 4
y
dxdy
0 2y (xy)2 + 1
The MATLAB code is given by:
72/131 CME 100 Fall 2009
x = r cos θ
y = r sin θ
(x, y)
θ
x
Now, we want RRto convert a function f (x, y) to a function of the polar coordinates f (r, θ) and obtain
the integral R f (x, y)dxdy in terms of r and θ.
Let us consider a small area of the region of integration, shown as shaded in Figure 74. As shown
in the figure, we can calculate this area as ∆A = r∆r∆θ. Taking the limit as ∆r and ∆θ go to
CME 100 Fall 2009 73/131
zero, we obtain: ZZ ZZ
f (x, y)dxdy = f (r, θ) r drdθ
R R
r∆θ
r
∆θ ∆r
Example
√ 56. Find the center of mass of a semi-circular disk bounded by the x-axis and y =
2 2
R − x using polar coordinates (shown in Figure 75).
πR2
The mass of the semi-circular disk is given by its area, i.e., m = 2 . Hence, we can compute the
center of mass using the equations:
1
ZZ
x̄ = xdxdy
m
1
ZZ
ȳ = ydxdy
m
As the disc is symmetric, we immediately have that x̄ = 0. By inspection we see that ȳ is between
0 and R/2. Let’s calculate its value now:
ZZ Z π hZ R i
ydxdy = (r sin θ)r dr dθ
0 0
Z π Z R
= sin θdθ r2 dr
0 0
2
= R3
3
2
Since m = πR 2 , we have ȳ = 3π .
4R
You can re-do this problem in Cartesian coordinates to check
that you get the same values.
Example 57. Find the area of the region R bounded by the circle of radius 1 and the limaçon
r = 2 + cos θ. This is shown in Figure 76.
74/131 CME 100 Fall 2009
Figure 76: The circle is shown in red (dash) and the limaçon is shown in blue (solid). Region R
lies between the circle and the limacon.
It’s equal to the square of the integral we are trying to calculate! We can write the above integral
in terms of polar coordinates to get:
Z ∞Z ∞ Z π Z ∞
2
−x2 −y 2 −r2
e dxdy = e rdr dθ
0 0 0 0
Z π " −r2 #∞
2 e
= dθ
0 −2
0
Z π
2 1
= dθ
0 2
π
=
4
Hence, we have √
∞
π
Z
−x2
e dx =
0 2
Example 59. Find the volume of the solid region which is given by the intersection of a sphere
described by x2 + y 2 + z 2 = 4 and a cylinder described by (x − 1)2 + y 2 = 1. See Figure 77.
Figure 77: Top view of the intersection region (shaded). Boundary for the sphere is shown in red
(solid) and for the cylinder in blue (dashed).
Also, we can write x and y in terms of the polar coordinates as x = r cos θ and y = r sin θ. The
equation for the boundary of cylinder can be written in polar coordinates as:
(x − 1)2 + y 2 = 1
⇒ (r cos θ − 1)2 + (r sin θ)2 = 1
⇒ r − 2 cos θ = 0
⇒ r = 2 cos θ
The final calculation is difficult. You can use Matlab to find the answer
76/131 CME 100 Fall 2009
π π
8 8 32
Z Z
2 2
V =4 − (1 − cos θ) +
2 3/2
dθ = 1 − sin3 θ dθ
0 3 3 3 0
Z π ! π !
16 π 16 cos3 θ 2
2 π
= − sin θ(1 − cos θ)dθ =
2
− − cos θ +
3 2 0 3 2 3 0
16 π 1 16π 64
= − −1 + = −
3 2 3 3 9
≈ 9.6
16 Triple integrals
We can define a triple integral as follows:
ZZZ X
f (x, y, z)dxdydz = lim h3 f (xi , yi , zi )
D h→0
i
The sum on the right hand side is analogous to the one used to defined 2D integrals, the difference
being that we now have a 3D volume D instead of a 2D region R. Each volume element can be
chosen to be a small cube with volume h3 .
Note that the order of integration does not matter and we can permute the order of the variables
x, y and z.
CME 100 Fall 2009 77/131
z
z1(x, y)
x z2(x, y)
R is the vertical projection of the volume D onto the x-y plane. The integral over R can be obtained
using the methods for 2D integrals.
Similarly, we can define the triple integrals over x-simple and y-simple regions in 3D.
The volume of a domain D is given by
ZZZ
V = dxdydz
D
Example 60. Using triple integrals, find the volume of the region enclosed by the plane x+y+z = 1
and the three coordinate planes. The plane is shown in Figure 79.
z
(0, 0, 1)
(0, 1, 0)
y
(1, 0, 0)
x
We can see that the region is z-simple for 0 ≤ z ≤ 1 − x − y. The projected region in the x-y plane
78/131 CME 100 Fall 2009
is y-simple and hence we can write the volume as the following iterated integral:
Z 1 Z 1−x Z 1−x−y
V = dz dy dx
0 0 0
Z 1 Z 1−x
= (1 − x − y)dy dx
0 0
1 1
Z 1
x2
= −x+ dx =
0 2 2 6
1
ZZZ
x̄ = xδ(x, y, z)dxdydz
M
Z Z ZD
1
ȳ = yδ(x, y, z)dxdydz
M
Z Z ZD
1
z̄ = zδ(x, y, z)dxdydz
M D
Example 61. Find the center of mass of a solid of constant density δ bounded by the disk x2 +y 2 ≤ 4
in the plane z = 0 and above by the paraboloid 0 ≤ z ≤ 4 − x2 − y 2 (see Figure 80).
y
x
Figure 80: The solid volume is shown as shaded. The disk boundary is shown in red (dashed) and
the paraboloid is shown in blue (solid)
This volume is z-simple and hence we can compute the mass as follows:
ZZZ
M= dxdydz
D
" 2 2
#
ZZ Z 4−x −y
= dz dxdy
R 0
ZZ
= (4 − x2 − y 2 )dxdy
R
We can see that x̄ = ȳ = 0. Let’s now calculate the integral for z̄:
ZZZ Z Z "Z 4−x2 −y2 #
z dx dy dz = zdz dxdy
D R 0
1
ZZ
= (4 − x2 − y 2 )2 dxdy
2 R
Example 62. Find the mass and moments of inertia Ix , Iy and Iz for the rectangular solid of
constant density δ and dimensions in the x, y and z directions of a, b and c respectively. The
origin (0,0,0) is at the center of the solid.
We can compute
a
Z "Z b
"Z c
# #
2 2 2
Ix = δ (y 2 + z 2 )dz dy dx
− a2 − 2b − 2c
a
"Z b #
1
Z
2 2
=δ c y 2 + c2 dy dx
− a2 − 2b 12
a
b 2 abcδ 2
Z
2
=δ b + c2 dx = b + c2
− a2 12 12
Note that the mass of the solid is given by M = abcδ and hence we have
M 2
Ix = b + c2
12
We can similarly compute:
M 2 M 2
Iy = a + c2 , Iz = a + b2 .
12 12
Example 63. Find the volume of the oblique segment bounded by the paraboloid z = x2 + y 2 and
the plane z = y + 2. The shape of the volume is depicted in Figure 81(a).
z z = y2
z =y+2
z
(2,4)
(-1,1)
x
y y
(a) The given volume bounded by a paraboloid (b) Projection of the paraboloid on the y-z plane
and a plane
We can see that the region is x-simple and the bounds for x are given by: − z − y 2 ≤ x ≤ z − y 2 .
p p
If we project the surface onto the y-z plane, we obtain a 2D region bounded by the parabola y = z 2
and the line z = y + 2 as shown in Figure 81(b). This region is z-simple and we can integrate z in
the region y 2 ≤ z ≤ y + 2. To obtain the bounds for y, we can solve for the points of intersection
of the parabola and the line using the equation y 2 = y + 2: the bounds are −1 ≤ y ≤ 2.
CME 100 Fall 2009 81/131
Now that we have the bounds for all the integrals, we can compute the volume as:
"Z "Z √ # #
Z 2 y+2 z−y 2
V = √ dx dz dy
−1 y2 − z−y 2
y+2
2 y+2 2
4
Z Z p Z
= 2 z − y 2 dz dy = (z − y 2 )3/2 dy
−1 y2 −1 3 y2
4 4
Z 2 Z 2
= (y + 2 − y 2 )3/2 dy = (y + 2 − y 2 )3/2 dy
−1 3 −1 3
The calculation of this integral is a long process. If we decide to use Matlab the code is:
>> syms x y
>> syms z positive
>> int(1,x,-(z-y^2)^(1/2),(z-y^2)^(1/2))
ans =
2*(z-y^2)^(1/2)
>> int(ans,z,y^2,y+2)
ans =
4/3*(y+2-y^2)^(3/2)
>> int(ans,y,-1,2)
ans =
81/32*pi
1 2 9
y+2−y =− y− + 2
2 4
3 3/2
4 9
Z
2
V = −u 2
du
3 − 32 4
3 3/2 2 !3/2
4 9 2u
Z
2
= 1− du
3 − 32 4 3
4 0 9 3/2 3/2 3
Z
V = 1 − cos2 θ (− sin θ)dθ
3 π 4 2
4 34
Z π
3/2
= sin2 θ (sin θ)dθ
3 2 4
0
27 π 4 27 3π 81π
Z
= sin θ dθ = =
4 0 4 2 3 32
82/131 CME 100 Fall 2009
x = r cos θ, y = r sin θ.
z is unchanged of course.
For transforming an integral from Cartesian coordinates to cylindrical coordinates, we can compute
the volume element in cylindrical coordinates. It is equal to r drdθdz; it is a simple extension of
the case of polar coordinates.
Example 64. Using cylindricalpcoordinates find the volume and the center of mass of a cone of
uniform density formed by z = x2 + y 2 and z = 1.
Thus, we have z̄ = 3 π
π 4 = 34 .
Example 65. Using cylindrical coordinates find the volume above the x-y plane bounded by x2 +
y 2 = 1 and x + y + z = 2.
First, we have to determine the bounds of integration. For this, we need to calculate the intersection
of the cylinder x2 + y 2 = 1 with the plane x + y + z = 2. The points on the intersection satisfy:
x2 + y 2 = 1, x + y + z = 2
with 0 ≤ θ ≤ 2π. In particular, we see that z is always positive. Therefore we have a z-simple
region with the bounds: 0 ≤ z ≤ 2 − x − y, 0 ≤ x2 + y 2 ≤ 1.
CME 100 Fall 2009 83/131
x = r sin φ cos θ,
y = r sin φ sin θ,
z = r cos φ.
To convert integrals from Cartesian coordinates to spherical coordinates, we calculate the volume
element as before. It is shown in Figure 83; we can write the volume element as:
Example 66. Using spherical coordinates find the center of mass of a hemisphere of radius R.
The hemisphere fixes the range of the spherical coordinates as: 0 ≤ r ≤ R, 0 ≤ φ ≤ π2 and
0 ≤ θ ≤ 2π. We can see from symmetry that x̄ = ȳ = 0. Also, we know that the volume of the
hemisphere is given by V = 21 34 πR3 = 2π
3 R . To compute z̄, we need to compute the integral
3
"Z π
#
ZZZ Z 2π 2
Z R
z δ(x, y, z) dx dy dz = zr sin φdr dφ dθ
2
D 0 0 0
π
"Z #
Z 2π 2
Z R
= r3 sin φ cos φdr dφ dθ
0 0 0
π
"Z #
2π
R4
Z
2
= sin φ cos φdφ dθ
0 0 4
"Z π #
R4 2π
Z
2
= sin(2φ)dφ dθ
8 0 0
R4 2π πR4
Z
= dθ =
8 0 4
(r, θ, φ)
r
φ
y
θ
x
r sin φ∆θ
z
∆r r∆φ
Example 67. Find the moment of inertia of a uniform solid sphere of mass M and radius R with
respect to an axis going through the origin.
Note that the direction of the axis is not mentioned, but it is immaterial as the sphere is isotropic.
The equation of the sphere gives us the following relationship between the Cartesian and spherical
coordinates:
x2 + y 2 = r2 sin2 φ
Now, we can compute the moment of inertia about the z-axis (remember that it is same for all
directions) as:
Z 2π Z π Z R
Iz = r sin φdr dφ dθ
4 3
0 0 0
Z 2π Z π 5
R
= sin φ dφ dθ
3
0 0 5
R5 2π
Z Z π
= sin3 φ dφ dθ
5 0 0
R5 2π 4 4 8π 5
5
R
Z
= dθ = 2π = R
5 0 3 5 3 15
Since we know that the mass of the sphere is given by M = 43 πR3 , we can write the moment of
inertia for any direction as:
2
I = M R2
5
The Matlab code is:
ans =
1/5*sin(phi)^3*R^5
>> int(ans,phi,0,pi)
ans =
4/15*R^5
>> int(ans,theta,0,2*pi)
ans =
8/15*R^5*pi
17 Transformation of variables
Recall that we can do a change of variables in a 1D integral where x is a function of u as:
Z b Z d
f (x) dx = f (x(u)) x0 (u) du
a c
The reason that we would want to do a change of variables is that the transformed integral might
be easier to calculate.
Example 68. If we want to integrate around a circle, then the coordinates are given by x = r cos θ
and y = r sin θ. It might be easier to integrate after transforming to polar coordinates (r, θ) as the
region of integration is rectangular as shown in Figure 84.
y θ
α
θ r
x a b
r
(a) Region of integration (shaded) (b) Region of integration in polar
in Cartesian coordinates coordinates
Example 69. Suppose we want to integrate over the two hyperbolas: u = xy and v = x2 − y 2 .
The figure shows that the region of integration is much simpler in the u-v coordinates and hence
we might want to switch to these coordinates. We can convert an integral in the x-y plane to an
integral in the u-v plane by equating an area element in both the planes. The area element is shown
in Figure 85.
We can linearize the region in the x-y plane to get a parallelogram as shown in Figure 86.
CME 100 Fall 2009 87/131
v y
u x
~ru ∆u
Example 70. Find the polar moment of inertia of the plane region bounded by 1 ≤ xy ≤ 3 and
1 ≤ x2 − y 2 ≤ 4. The density δ(x, y) is equal to 1.
88/131 CME 100 Fall 2009
u = xy, v = x2 − y 2
∂(x, y) ∂(u, v)
· =1
∂(u, v) ∂(x, y)
Don’t forget to take the absolute value. Finally, we can compute the moment of inertia as
ZZ
I= (x2 + y 2 )dx dy
1
ZZ
= (x2 + y 2 ) du dv
2(x + y 2 )
2
1 1 4 3
ZZ Z Z
= du dv = du dv = 3
2 2 1 1
Example 71. Using transformation of coordinates find the area enclosed by y = x, y = 2x, y = 1/x
and y = 2/x.
1 1
Z 2Z 2
= du dv = ln 2
1 1 2u 2
Example 72. Find the Jacobian of transformation between Cartesian and polar coordinates.
We have x = r cos θ and y = r sin θ. We can compute the Jacobian of the transformation as
∂(x, y) cos θ sin θ
= = r cos2 θ + r sin2 θ = r
∂(r, θ) −r sin θ r cos θ
Hence we can write the transformed integral as:
∂(x, y)
ZZ ZZ
f (x, y) dx dy = f (r, θ)
dr dθ
∂(r, θ)
ZZ
= f (r, θ) r drdθ
P
1
W =work
4
3
V
Figure 87: The ideal carnot cycle P -V diagram
1. The first process performed on the gas is an isothermal expansion. The heat source is
brought into contact with the cylinder. The temperature remains constant while the volume
increases. During the process from State 1 to State 2 heat is transferred from the source to
the gas to maintain the temperature. We will note the heat transfer to the gas by Q1 . The
process is described by the equation:
P V = nRT = 3
2. The second process performed on the gas is an adiabatic expansion. During an adiabatic
process no heat is transferred to the gas. The temperature decreases and the volume increases
as the gas expands to fill the volume. The process from State 2 to State 3 is described by
the equation:
PV γ = 2
3. The third process performed on the gas is an isothermal compression. A cold source is
brought into contact with the cylinder. The temperature remains constant while the volume
decreases. During the process from State 3 to State 4 heat is transferred from the gas to
the cold source to maintain the temperature. We will note the heat transfer by Q2 away from
the gas. The process is described by the equation:
PV = 1
4. The fourth process performed on the gas is an adiabatic compression. The temperature
increases and the volume decreases as the gas is compressed. During the process from State
4 to State 1 no heat is transferred. The process is described by the equation:
PV γ = 1
W = Q1 − Q2
CME 100 Fall 2009 91/131
Thus, we get
∂(P, V ) 1
=
∂(u, v) (γ − 1)v
Hence, work can be calculated as
1
Z 3Z 2
W = dvdu
1 1 (γ − 1)v
ln 2 2 ln 2
Z 3
= du = = 5 ln 2
1 γ−1 γ−1
A movie depicting the Carnot cycle is also uploaded at coursework. You should check it out!
18 Line integrals
C b
a
y
Suppose f (x, y, z) denotes the linear density of a wire (shown in Figure 88) at the point (x, y, z).
Then the mass of the wire is given by
Z
M= f (x, y, z) ds
C
The integral is called a line integral with respect to the arc length s. We can make a change of
variables to compute this line integral. Recall from the earlier part of class that ds = |~v | dt and
hence we have Z Z b
f (x, y, z) ds = f (x(t), y(t), z(t)) |~v (t)| dt
C a
92/131 CME 100 Fall 2009
R
Example 73. Calculate C xy ds where C is the part of the unit circle that lies in the first quadrant.
We can parameterize the coordinates as x = cos t and y = sin t. Note that here |~v | = 1. Now, we
can compute the integral as
Z Z π
2
xy ds = (cos t) (sin t) (1) dt
C 0
π π
1 1 − cos(2t) 2 1
Z
2
= sin(2t) dt = =
2 0 2 2 0 2
18.1 Applications
18.1.1 Computing the mass
Let’s say we have the density δ(x, y, z) function along a cable. The mass of the cable is given by:
Z
M= δ(x, y, z) ds
C
Example 74. Find the location of the center of mass of the helix C described by ~r(t) = 3 cos t~i +
3 sin t ~j + 4t ~k, whose density is given by δ = kz.
We parameterize the curve as x = 3 cos t, y = 3 sin t and z = 4t. Note that the velocity is given by
~v = (−3 sin t, 3 cos t, 4) and hence |~v | = 5. Thus, the total mass is given as
Z
M= kz ds
ZCπ Z π
= (kz) (5) dt = 20k t dt = 10kπ 2
0 0
CME 100 Fall 2009 93/131
1
Z
x̄ = xδ(x, y, z) ds
M C
1
Z π
= (k4t) 3(cos t) (5) dt
10kπ 2 0
60k
Z π
= t cos t dt
10kπ 2 0
Matlab code:
>> syms t
>> syms k positive
>> M = int(20*k*t,t,0,pi)
M =
10*k*pi^2
>> int(3*cos(t)*k*4*t*5,t,0,pi)
ans =
-120*k
>> x = ans/M
x =
-12/pi^2
>> int(3*sin(t)*k*4*t*5,t,0,pi)
ans =
60*k*pi
>> y = ans/M
y =
6/pi
>> int(4*t*k*4*t*5,t,0,pi)
ans =
80/3*k*pi^3
>> z = ans/M
z =
8/3*pi
60k 6
Z π Z π
π
x̄ = t cos t dt = [t sin t] − sin t dt (Integrating by parts)
10kπ 2 0 π2 0
0
6 π 12
= 2 (0 + [cos t]0 ) = − 2
π π
94/131 CME 100 Fall 2009
As before, if we have the trajectory vector ~r(t) = (x(t), y(t), z(t)) then we have
dx
dx = dt = x0 dt
dt
Hence, we can write
Z Z b
f (x, y, z) dx = f (x(t), y(t), z(t)) x0 (t) dt
C a
Note that there is no absolute value around x0 (t). Hence the integral can have any sign even if
f ≥ 0. In particular, the sign will depend on the direction chosen when tracing the curve. See
section 18.2.1 below.
Similarly, we can compute
Z Z b
f (x, y, z) dy = f (x(t), y(t), z(t)) y 0 (t) dt
C a
Z Z b
f (x, y, z) dz = f (x(t), y(t), z(t)) z 0 (t)dt
C a
C b −C b
a a
Figure 89: A parametrization of a curve determines an orientation.
19 Vector fields
A vector field is a vector function of 3 variables defined as:
For example, the gradient F~ = ∇f is a vector field. A fluid velocity ~v (x, y, z) and electromagnetic
~ and B
fields E ~ are examples of vector fields.
−
→
F −
→
T
∆s
C
The situation is shown in Figure 90. The work done over a small interval ∆s is given by:
∆W = F~ · T~ ∆s
96/131 CME 100 Fall 2009
where T~ gives the unit tangent vector to the curve C. We can sum the work done over all the
intervals and take the limit as ∆s → 0 to get
Z
W = F~ · T~ ds
C
Alternative formulas: We can find a parametrization to simplify this formula by noting that the
→
−
unit tangent vector was defined by T = |~~vv| and that the speed is given by |~v | = ds
dt . Combining
these two, we can see that
T~ ds = ~v dt
Hence, the work done can be written as:
Z
W = F~ · ~v dt
Further, since ~v = dt ,
d~
r
we can also write this as:
Z
W = F~ · d~r
Don’t be fooled by all these formulas! In the end, the same calculations need to be done to calculate
the work.
Example 77. Find the work done by:
k~r
F~ = 3
|~r|
along the straight segment from (0,4,0) to (0,4,3).
We parameterize the segment using x = 0, y = 4, z = z. Hence the work done can be computed as
Z z=3 Z z=3 3
−1
kz z k
W = dz = k dz = k √ =
z=0 r
3
z=0 (16 + z )
2 3/2
16 + z 0 20
2
19.1 Application
Let us look at the magnetic field around a wire as shown in Figure 91. Using a line integral,
Ampere’s law tells us that: Z
B~ · d~r = µI
C
~ and d~r point in the same direction and hence we can write:
B
~ · d~r = B
B ~ · ~v dt = |B|
~ |~v | dt
CME 100 Fall 2009 97/131
−
→
B
r
~
= |B| ds
C
~
= 2πr|B|
So finally:
~ = µI,
2πr|B|
which gives us
µI
~ =
|B|
2πr
We have proved that the magnetic field decays like 1/r away from a wire.
If C is a closed curve (a loop), then the flow integral is called the circulation and is indicated as:
I I
~
F · d~r = P dx + Q dy
C
where ~n is a unit vector normal to the curve pointing towards the outside of R. More generally for
any vector field F~ we define the flux as:
I
Φ= ~
F · ~n ds
98/131 CME 100 Fall 2009
~k
y
−
→
R T
∆s
x C
~n
An intuitive explanation of this definition can be derived by considering a small element of the
region R as shown in Figure 92. To compute the flux, we look at this small element of length ∆s
at the boundary, as shown closely in Figure 93.
~n
−
→
F ∆t
∆s
The area of the parallelogram in Figure 93 gives the amount of fluid leaving/entering the small
region of the boundary ∆s in time ∆t. The area of the parallelogram is given by:
Area = Base × Height = ∆s (F~ ∆t) · ~n
Hence, the net flow per unit time over the small region of the boundary is given by F~ · ~n ∆s.
Summing up the flow over the entire boundary, we have:
I
Net flow per unit time = Φ = F~ · ~n ds
C
1 0 0 0 1 0
~n = (x , y , z ) × (0, 0, 1) = (y , −x0 , 0)
|~v | |~v |
Comparing these equations, we can see that the flux of (P, Q) is the same as the circulation of
(−Q, P ). Note that, in fact, (P, Q) maps onto (−Q, P ) by a rotation of π/2 while ~n maps onto
T~ . This shows that these two definitions are actually closely related by a simple rotation. We will
come back to this point when discussing the Green’s theorem.
This remark, however, does not extend to the 3D case.
Example 78. Find the flux of F~ = (x − y)~i + x ~j across the unit circle.
We can parameterize the unit circle using: x = cos t and y = sin t. This gives us dx = − sin t dt
and dy = cos t dt. Now, we can compute the flux as
Z
Φ = −Q dx + P dy
Z 2π
= ((cos t − sin t) cos t − cos t(− sin t)) dt
0
Z 2π
= cos2 t dt = π
0
A similar theorem can be derived for vector fields, which says that if we have a vector field F~
defined on a region D such that F~ is of the form F~ = ∇f for some function f , then we have:
Z
F~ · d~r = f (b) − f (a)
C
where a denotes the starting point of the path C and b denotes the ending point of C, as shown
in Figure 94. Such a vector field F~ is called conservative and the function f is said to be the
potential function of F~ .
100/131 CME 100 Fall 2009
C b
a
y
x
Figure 94: A given path C starting at a and ending at b
We can derive the above relation by first noting that for a function f (x, y, z), we have:
df ∂f dx ∂f dy ∂f dz
= + +
dt ∂x dt ∂y dt ∂z dt
Now, we can use the definition of the line integral to write
Z Z 1
~
F · d~r = (∇f · ~v ) dt
C 0
Z 1
∂f dx ∂f dy ∂f dz
= + + dt
0 ∂x dt ∂y dt ∂z dt
Z 1
df
= dt
0 dt
= f (b) − f (a)
Also, if F~ is conservative, then the value of the integral along any closed path C is 0:
I
F~ · d~r = f (a) − f (a) = 0
C
y
w
~
B A x
We will divide the path in two parts: C1 and C2 , C1 going from A to B over the circular path and
C2 coming back from B to A over the straight path. Note that the work done is given by:
Z Z Z Z
~ · d~r = (−y) dx + x dy =
w (−y) dx + x dy + (−y) dx + x dy
C C C1 C2
For the path C1 , parameterize the curve by x = cos θ and y = sin θ for θ : 0 → π. Thus, we have
−y dx = sin2 θ dθ and x dy = cos2 θ dθ. This gives us the work done for C1 as:
Z Z π
(−y) dx + x dy = sin2 θ + cos2 θ dθ = π
C1 0
For the path C2 , note that y = 0 and also that dy = 0 as the y coordinate is constant. Hence, the
work done over C2 is given by: Z
(−y) dx + x dy = 0
C2
Thus, the total work done by the field over the closed path is:
Z
~ · d~r = π
w
C
But this is nonzero even though we went over a closed path and hence we can conclude that the
vector field w
~ is not conservative.
102/131 CME 100 Fall 2009
Now, for the given curve, we compute dx = dx, dy = dx and dz = 0. Thus, we can write the
work done as: Z 1
1
W = (x)(1) dx + x(1) dx + 0 = x2 0 = 1
0
3. We now use the scalar potential. First, we must find it: we want a function f such that
F~ = ∇f . This means that:
∂f ∂f ∂f
= yz, = xz, = xy
∂x ∂y ∂z
f = xyz + g(y, z)
∂f ∂g
= xz + = xz
∂y ∂y
∂g
which gives us ∂y = 0 and hence g(y, z) is only a function of z. We denote it by h(z). Finally,
using the third equation, we find:
∂f
= xy + h0 (z) = xz
∂z
which gives us h0 = 0. h is therefore a constant which can set to 0. Then, our scalar potential
is f = xyz. Thus, we can compute the work done as
W = f (1, 1, 1) − f (0, 0, 1) = 1 − 0 = 1
1 2 3
∂M ∂N ∂M ∂P ∂N ∂P
= , = , =
∂y ∂x ∂z ∂x ∂z ∂y
To get a sense of why these equations must hold if F~ is conservative, consider a potential function
f such that F~ = ∇f . Thus, we have M = ∂f ∂f
∂x and N = ∂y . Now, differentiating M w.r.t. y and
∂ f2 ∂ f 2
N w.r.t. x, we get ∂M
∂y = ∂y ∂x and ∂x = ∂x ∂y respectively. But we know that the order of the
∂N
We will use the theorem to test if F~ is conservative. Note that here: M = ex cos y + yz, N =
xz − ex sin y and P = xy + z. We can calculate:
∂P ∂N ∂M ∂P ∂N ∂M
=x= , =y= , = −ex sin y =
∂y ∂z ∂z ∂x ∂x ∂y
Hence, F~ is conservative.
To find the scalar potential for F~ , we can integrate the following equations:
∂f
= ex cos y + yz (11)
∂x
∂f
= xz − ex sin y (12)
∂y
∂f
= xy + z (13)
∂z
104/131 CME 100 Fall 2009
where g is a (yet) unknown function of y and z. To find g, we use the other two equations above
in the following manner. First, we compute ∂f
∂y using this equation as:
∂f ∂g
= −ex sin y + xz +
∂y ∂y
∂f
= xy + h0 (z)
∂z
Equating this with equation 13, we get
h0 (z) = z
which can now be integrated to get
z2
h(z) = +C
2
where C is an unknown constant. We can set it to 0. Thus, we found our scalar potential as:
z2
f = ex cos y + xyz +
2
W = U (a) − U (b)
From the definition of work, we can also write the work done as
Z Z
W = ~
F · d~r = F~ · ~v dt
C C
Z
d~v m d m
Z
W =m · ~v dt = |~v |2 dt = |~v (b)|2 − |~v (a)|2
C dt 2 C dt 2
where the last equality is obtained using the fundamental theorem of calculus.
CME 100 Fall 2009 105/131
Now, we can equate the two expressions for work and rearrange terms to get:
m m
|~v (b)|2 + U (b) = |~v (a)|2 + U (a)
2 2
Note that this equation is valid for any two points a and b in the domain. Hence, this can be
rephrased as
m 2
|~v | + U = constant
2
which is the law of conservation of energy! This explains the use of the adjective conservative for
the force field.
21 Green’s theorem
Assume that we are given a simple, closed, plane curve C which encloses a region R as shown in
Figure 97. Here simple means that the curve has no self-intersections. We will also assume that the
curve has positive orientation, i.e. the region R lies to the left of the tangent vector T~ at every
point, as shown in Figure 97.
C
−
→
R T
Green’s theorem gives us a way to convert a line integral along the curve C to a double integral
over the region R.
∂M ∂N
I ZZ I ZZ
M dx = − dx dy and N dy = dx dy
C R ∂y C R ∂x
We will only prove the first equation as the proof for the other one is very similar. For proving
this, we divide the curve C into 2 parts: C1 and C2 , where C1 goes from x = a to x = b and C2
goes from x = b to x = a as shown in Figure 98.
106/131 CME 100 Fall 2009
C2 : y = f2 (x)
R
C1 : y = f1 (x)
a b x
Figure 98: Dividing a simple, closed, plane curve C into two parts C1 and C2
Using the fundamental theorem of calculus, we can compute the integral over the region R as
follows:
Z bZ f2 (x)
∂M ∂M
ZZ
− dxdy = − dydx
R ∂y a f1 (x) ∂y
Z b
=− (M (x, f2 (x)) − M (x, f1 (x))) dx
a
Z b Z a
= M (x, f1 (x)) dx + M (x, f2 (x)) dx
Z a Z b
= M dx + M dx
C1 C2
I
= M dx
C
Proof. We can prove this form using the circulation-curl form. Choose two functions P = −N and
Q = M . The circulation-curl form holds and we have:
ZZ
∂Q ∂P
I
P dx + Q dy = − dx dy
C R ∂x ∂y
In terms of M and N , this gives us:
ZZ
∂M ∂N
I
M dy − N dx = + dx dy
C R ∂x ∂y
This is what we set out to prove!
~ = −y ~i + x ~j over the
Example 83. Recall example 80. Find the work done by the vector field w
closed semi-circular path C shown in Figure 95.
CME 100 Fall 2009 107/131
We will use Green’s theorem to compute the line integral for work:
I
W = F~ · d~r
C
If we write M = −y and N = x, then we have
I
W = M dx + N dy
C
Using the circulation-curl form of Green’s theorem, we have
ZZ
∂N ∂M
ZZ
W = − dx dy = 2 dx dy = 2 · Area
R ∂x ∂y R
But the area of the given semi-circular region R is π/2 and hence:
W =π
which is the same as what we obtained using explicit integration in example 80.
Example 84. Compute the integral
I p
I= 2y + 9 + x3 dx + 5x + earctan y dy
C
where C is a circle of radius 2.
√
We set M = 2y + 9 + x3 and N = 5x + earctan y . We use the circulation-curl form of Green’s
theorem to write
ZZ
∂N ∂M
I
I= M dx + N dy = − dxdy = 3 · Area
C R ∂x ∂y
The area bounded by the curve C is π(2)2 = 4π and hence I = 12π.
Using the Green’s theorem can lead to simple integrals and easy answers.
∆W = P A ∆z
Now, note that the change in volume is given by ∆V = A∆z, and hence we have ∆W = P ∆V .
Summing the work done over a change in height, we get:
Z
W = P dV
For the complete piston engine cycle, we have the P -V diagram shown in figure 99(b) and the work
done is given by the area under the curve. Recall that we derived the area enclosed by a curve as
ZZ I
dx dy = x dy
R C
CME 100 Fall 2009 109/131
W =work
P
(a) A piston (in black) compress- (b) The P -V diagram of a piston engine
ing air in a chamber (in gray)
and here, the coordinates x and y are P and V respectively, giving us the work done as the area
enclosed by the curve: I ZZ
W = P dV = dP dV
C
which is the same expression as what we had previously used to study the Carnot cycle!
For a fluid flow with velocity field given by ~v , the flux is equal to:
I
Net flow = (~v · ~n) ds (15)
We say that a flow is incompressible if the density of the fluid does not change over time. Another
way to say this is that the fluid particles do not accumulate inside the region and consequently
the amount of fluid entering the region must be equal to the amount of fluid that is going out.
Referring to figure 100, the incompressibility condition says that
Inflow = Outflow
Inflow Outflow
Figure 101: Extending Green’s theorem for a region (shaded) with holes
Example 87. Verify the circulation form of Green’s theorem on the annular ring: h2 ≤ x2 +y 2 ≤ 1,
0 < h < 1, if:
→
− y ~ x ~
F =− 2 i+ 2 j
x +y 2 x + y2
CME 100 Fall 2009 111/131
C1
Ch
To evaluate the line integral on the left hand side of Green’s theorem, we parameterize the two
curves keeping in mind that the outer curve should have positive orientation and the inner curve
should have negative orientation: For C1 , we put x = cos t and y = sin t where 0 ≤ t ≤ 2π. For C2 ,
we put x = h cos θ and y = −h sin θ where 0 ≤ θ ≤ 2π. Thus, the line integral becomes:
x dy − y dx x dy − y dx
I I I
M dx + N dy = +
C C1 x +y
2 2
Ch x2 + y 2
h cos2 θ + sin2 θ
Z 2π Z 2π 2
= cos t + sin t dt −
2 2
dθ
0 0 h2
= 2π − 2π
=0
We have verified the circulation-curl form of Green’s theorem for this case. Note that the functions
M and N are not defined at (0,0) and hence we need the hole to be present in the region in order
to apply Green’s theorem!
Remark: Let’s see what would happen if the outer boundary C1 is an arbitrary curve instead of
being a circle, as shown in figure 103. Since we have the same M and N , using the results above,
112/131 CME 100 Fall 2009
But we evaluated I
M dx + N dy = −2π
Ch
for all the curves C1 that surround Ch ! This can also be derived directly if we parameterize
C1 as x = r cos θ and y = r sin θ, where both r and θ vary along the curve. Then, we get
dx = −r sin θ dθ + cos θ dr and dy = r cos θ dθ + sin θ dr. Now we can compute our integral as
x dy − y dx r2 (cos2 θ + sin2 θ)
I I I
M dx + N dy = = dθ = 2π
C1 C1 x2 + y 2 C1 r2
Ch
Example 88. Find the area bounded by the folium of Descartes in the first quadrant (shown in
figure). The equation of the curve is: x3 + y 3 = 3xy.
We will first try to parameterize the curve. Suppose we have y = tx. This gives us:
3t 3t2
x= , y=
1 + t3 1 + t3
CME 100 Fall 2009 113/131
22 Surface integrals
We have seen the line integrals earlier which integrate a function along a line. Surface integrals are
an extension of line integrals that allow us to integrate a function over a surface. Mathematically,
if we have a surface S as shown in figure 105 then the integral is given by:
ZZ
f (x, y, z) dS
S
z S
v
u
x
Figure 105: A generic surface S
To compute the area of the small region, we consider one such small region and approximate it by
a parallelogram as shown in figure 106. The area of the parallelogram in figure 106 is given by:
∂~r ∂~r ∂~r ∂~r
∆A = ∆u × ∆v = ∆u∆v
×
∂u ∂v ∂u ∂v
∂~r
∂v ∆v
∂~r
∂u ∆u
Figure 106: Approximating a small region (dashed) with a parallelogram. The difference shown is
exaggerated for illustration.
Plugging this value of the area in the expression for the surface integral, we get:
∂~r ∂~r
ZZ ZZ
f (x, y, z) dS = f (x, y, z)
× du dv
S R ∂u ∂v
Example 92. Find the surface area and the moment of inertia of a hemisphere of radius R about
the z-axis.
CME 100 Fall 2009 115/131
We can parameterize the surface of a hemisphere as: x = R sin φ cos θ, y = R sin φ sin θ and
z = R cos φ, where 0 ≤ φ ≤ π/2 and 0 ≤ θ ≤ 2π. Since we have u = φ and v = θ here, we can
compute
∂~r ∂~r
∂u × ∂v = R sin φ
2
We can also find the moment of inertia as follows (assuming that density δ = 1):
ZZ
Iz = (x2 + y 2 )δ dS
Z φ=π/2Z θ=2π
= (R2 sin2 φ)(R2 sin φ) dθ dφ
φ=0 θ=0
π/2
4π 4
Z
= 2πR4 sin3 φ dφ = R
0 3
We can also see that the mass of the hemisphere of unit density is M = 2πR2 and hence we can
write the moment of inertia as Iz = 2M
3 R . Thus, the radius of gyration is given as:
2
2
r r
Iz
rz = =R
M 3
22.3.2 Case 2
If we are given an implicit surface F (x, y, z) = 0, and we assume that z can be written in terms of
x and y as z = f (x, y), then we can write
∂f ∂z Fx
= =−
∂x ∂x Fz
and similarly
∂f Fy
=−
∂y Fz
Hence, we have
s 2 2 s 2 2
|∇F |
∂f ∂f Fx Fy
1+ + = 1+ + =
∂x ∂y Fz Fz |∇F · ~k|
|∇F |
ZZ ZZ
f (x, y, z) dS = g(x, y, z) dx dy
S R |∇F · ~k|
From symmetry it is clear that x̄ = ȳ = 0 and 0 < z̄ < R. We know that the mass of the hemisphere
is given by M = 2πR2 . Now, we can compute:
1
ZZ
z̄ = z dS
M
∂z −x
=p
∂x R 2 − x2 − y 2
∂z −y
=p
∂y R 2 − x2 − y 2
Now, we can compute
2 2 2
x2 y 2 x2 + y 2 + z 2
∂f ∂f R
1+ + =1+ 2 + 2 = =
∂x ∂y z z z2 z
Thus, we have:
1 R R
ZZ ZZ
z̄ = z dx dy = dx dy
M z 2πR2
where the integral is over a disc of radius R and hence the value of the integral is πR2 , resulting in
R R
z̄ = πR2 =
2πR 2 2
CME 100 Fall 2009 117/131
Figure 107: The möbius strip shown on top with a cylinder shown on the bottom.
We will restrict our attention only to two sided or orientable surfaces as we will need to work with
→
−
the surface normal. Let’s say we want to define a flux integral of a vector field F over a two sided
surface S with the surface normal ~n as:
→
−
ZZ
Φ= F · ~n dS
S
As before, we can look at a small region of the surface, approximate it with a parallelogram and
observe that we can compute the normal vector as:
∂~
r ∂~
r
×
~n = ∂u ∂v
∂~
r ∂~
r
∂u × ∂v
23.1.1 Case 1
If the surface is expressible in the form z = f (x, y) then we can write the flux as:
ZZ
∂f ∂f
Φ= −M −N + P dx dy
S ∂x ∂y
23.1.2 Case 2
If the surface is given as G(x, y, z) = 0 then we can write the flux as:
Z Z M ∂G + N ∂G + P ∂G
∂x
Φ= ∂G∂y ∂z
dx dy
S
∂z
Remark: Make sure that the normal vector that you use points in the right direction. If ∂~
r
∂u × ∂~
r
∂v
is pointing in the direction opposite to ~n, then change its sign.
RR →− →
−
Example 94. Find the flux n dS of F = z~k across the surface of a hemisphere of radius
S F ·~
R.
Choose the parametrization x = R sin φ cos θ, y = R sin φ sin θ and z = R cos φ. We have
∂~r ∂~r
× = R2 sin φ ~n = R sin φ ~r
∂φ ∂θ
where ~n = R.
~
r
Thus, we get
→
− →
−
ZZ ZZ ZZ
F · ~n dS = F · (R sin φ~r) dθ dφ = (z~k) · (R sin φ~r) dθ dφ
S ZZ ZZ
= z R sin φ dθ dφ =
2
R3 cos2 φ sin φ dθ dφ
π/2
π/2
1 2πR3
Z
= 2πR 3
cos φ sin φ dφ = 2πR
2 3
− cos3 φ =
0 3 0 3
z
S2
S1
x
Figure 108: The given surface is divided in two parts: the paraboloid S1 and the cap S2 (shaded).
We can divide the surface S in two parts: the paraboloid surface S1 and the cap S2 as shown in
figure 108. Thus, we can write the flux for the cap as:
→
−
ZZ
F · ~n dS = 3 Area = 12π
S2
We will use the equation for special case 1 and write z = x2 + y 2 . Thus
∂f ∂f
− , − , 1 = (−2x, −2y, 1)
∂x ∂y
We assume that the normal ~n points outward to the surface and hence we have the normal as
~n = (2x, 2y, −1). Note the sign change! Thus we have:
→
− →
−
ZZ ZZ ZZ
F · ~n dS = F · (2x, 2y, −1) dx dy = 2x2 + 2y 2 − 3 dx dy
S1
Z 2π Z 2
= 2r2 − 3 r dr dθ = 4π
θ=0 r=0
Summing the flux over surfaces S1 and S2 , we obtain the total flux as Φ = 4π + 12π = 16π.
23.2 Applications
23.2.1 Heat flow
Heat flow refers to the amount of energy that is transferred in the form of heat. We can compute
the heat flow ~q in terms of the temperature T as:
~q = −K∇T
where K is a constant. Thus the rate of heat flow out of some region R is defined as:
ZZ ZZ
~q · ~n dS = −K ∇T · ~n dS
S
→
− Q
ZZ
E · ~n dS =
S 0
where Q is the total charge in the region and 0 is the dielectric constant.
→
−
Similarly, if we have the gravitational field F , then the flux through a region S is given by
→
−
ZZ
F · ~n dS = −4πGM
S
Let’s say we have 4 candidates for the nose shape, as shown in figure 110.
1 2 3 4
We will assume that the height of the nose is 1 and the width is 2. The air resistance is given by
2πδRv 2 , where δ is the air density, R is the drag coefficient and v is the velocity of the rocket. For
a surface of revolution (such as all our candidates), R can be approximated as:
1
ZZ
R= cos3 φ dS
π S
where φ is the angle of the curve which is revolved to get the surface as shown in figure 111.
z
φ r
~n
Figure 111: Defining the angle φ for a surface of revolution
We can parameterize the surface as x = r cos θ, y = r sin θ and z = z(r). Then we can write the
normal as:
∂~r ∂~r
~n = = r cos θ z 0 , r sin θ z 0 , −r
×
∂θ ∂r
This gives us |~n| = r 1 + (z ) , and consequently:
p
0 2
−~n · ~k r 1
cos φ = = p =p
|~n| r 1 + (z )
0 2 1 + (z 0 )2
Thus,
1 1 1
ZZ ZZ
R= cos φ dS =
3
r 1 + (z 0 )2 dr dθ
p
π π 3/2
S S (1 + (z 0 )2 )
1
Z 1
r r
ZZ
= dr dθ = 2 dr
π 1 + (z 0 )2 0 1 + (z 0 )2
Now, we can compute the value of the drag coefficient R for each of the shapes to get:
1. Pointy nose:z = r and we can compute R = 1/2.
2. Flat tipped nose: for this shapes, we can compute R ≈ 0.38 (if we optimize the angle of the
oblique segment).
√
3. Round nose: z = 1 − 1 − r2 and we can compute R = 1/2.
4. Parabolic nose: z = r2 and can compute R = ln 5
4 ≈ 0.4.
Thus, the flat nose offers the least resistance which is not at all obvious in the first glance!
122/131 CME 100 Fall 2009
24 Stokes’ Theorem
Recall the circulation-curl form of the Green’s theorem:
ZZ
∂N ∂M
I
M dx + N dy = − dx dy
C R ∂x ∂y
Stokes’ theorem is an extension of the circulation-curl form of Green’s theorem to three dimensions.
24.1 Curl
→
−
Let’s say we have a vector field F (x, y, z) = (M, N, P ). Then, we can define the curl (denoted by
→
−
∇×) of the vector field F as:
→
− →
−
∂P ∂N ~ ∂M ∂P ~ ∂N ∂M ~
curl F = ∇ × F = − i+ − j+ − i
∂y ∂z ∂z ∂x ∂x ∂y
A useful way to remember the formula for curl is to think of it in terms of the following determinant:
~i ~j ~k
→
−
∇ × F = ∂x
∂ ∂ ∂
∂y ∂z
M N P
Note that this is a special determinant as it has operators in the second row instead of numerical
quantities.
Stokes’ theorem can be written as this more general form which holds for three dimensions as well:
→
− → − →
−
I ZZ
F · T ds = ∇ × F · ~n dx dy
C S
→
−
where S is the surface over which the vector field F is defined. Note that the orientation of the
→
−
normal must be such that ~n × T points towards the surface as shown in figure 112.
which is the part of Stokes’ theorem in which we take all the terms with M occurring on the left
and the right hand sides. You should be able to prove on your own the remaining two parts for
components N and P , as the proof is along similar lines.
CME 100 Fall 2009 123/131
−
→
T ~n
S →
−
~n × T
The surface S and its projection R on the xy-plane are shown in figure 113. First, we see that M
is a function of (x, y, z(x, y)). Hence we can apply Green’s theorem to write:
ZZ
∂ ∂M ∂M ∂z
I ZZ
M dx = − [M (x, y, z(x, y))] dx dy = − + dx dy
C R ∂y R ∂y ∂z ∂y
1. Using a parametrization of the circle: we can parameterize the circle as: x = 2 cos θ and
y = 2 sin θ. This gives us dx = −2 sin θ dθ and dy = 2 cos θ dθ. Note that we can express the
line integral as:
→
− → − →
−
Z Z
F · T ds = F · d~r
We can compute
→
−
F · d~r = (2 sin θ, −2 cos θ) · (−2 sin θ, 2 cos θ)dθ = −4 dθ
→
− → − ∂N ∂M ∂(−x) ∂y
Z ZZ ZZ
F · T ds = − dx dy = − dx dy = −2 π(2)2 = −8π
∂x ∂y ∂x ∂y
→
− ∂f ∂f
ZZ ZZ
∇ × F · ~n dx dy = + P dx dy
−M −N
S ∂x ∂y
H→
− →
−
Example 97. Using Stokes’ theorem, evaluate the line integral F · d~r if F = xz ~i + xy ~j + 3xz ~k
over the curve defined by the portion of the plane 2x + y + z = 2 in the first octant, traversed
counterclockwise.
CME 100 Fall 2009 125/131
Note that our surface is given by the plane 2x + y + z = 2 and hence we can write z = 2 − 2x − y.
The normal vector is given by
∂f ∂f
− , − , 1 = (2, 1, 1)
∂x ∂y
We need to plot this as shown in figure 114 to determine the correct orientation of the normal
vector.
z
~n
C
R y
x
Figure 114: Checking the orientation of the normal vector
24.3 Applications
24.3.1 Ampere’s circuital law
→
−
Let’s say we have a magnetic field B generated by a wire which has a current I flowing through
it, as shown in figure 115. This field is given by
→
− → −
Z
B · T ds = µ0 I
126/131 CME 100 Fall 2009
B
I
→
−
We define the quantity J which is the current density field whose magnitude gives the current per
unit area and whose direction gives the direction of current. Hence, we have
→
−
ZZ
I= J · ~n ds
R
25 Divergence Theorem
The divergence theorem is the 3D extension of the flux-divergence form of Green’s theorem, similar
to Stokes’ theorem. Recall that the flux-divergence form of Green’s theorem is given by:
ZZ
∂M ∂N
I
M dy − N dx = + dx dy
C R ∂x ∂y
→
−
where S is a closed surface which forms a simple solid region D. Also, we assume that F is
differentiable in D and ~n points out of the region.
RR →− →
−
Example 98. Calculate the flux C F · ~n ds of F = xy ~i + yz ~j + xz ~k through the surface of the
cube cut from the first octant by the planes x = 1, y = 1, and z = 1. Then verify your result using
the divergence theorem.
We need to compute the flux through each of the 6 faces of the cube, as follows:
→
− →
−
1. x = 0: we have ~n = −~j and F = xz ~k, which implies that F · ~n = 0 and hence flux is 0.
→
− →
−
2. y = 0: we have ~n = −~i and F = yz ~j, which implies that F · ~n = 0 and hence flux is 0.
→
− →
−
3. z = 0: we have ~n = −~k and F = xy ~i, which implies that F · ~n = 0 and hence flux is 0.
→
−
4. y = 1: we have ~n = ~j and F = x~i + z ~j + xz ~k. Hence the flux is given by:
1
Z 1Z 1
→
− →
−
ZZ ZZ
F · ~n ds = F · ~n dx dz = z dx dz =
S S 0 0 2
→
−
5. x = 1: we have ~n = ~i and F = y ~i + yz ~j + z ~k. Hence the flux is given by:
1
Z 1Z 1
→
− →
−
ZZ ZZ
F · ~n ds = F · ~n dx dz = y dy dz =
S S 0 0 2
→
−
6. z = 1: we have ~n = ~k and F = xy ~i + y ~j + x ~k. Hence the flux is given by:
1
Z 1Z 1
→
− →
−
ZZ ZZ
F · ~n ds = F · ~n dx dz = x dx dy =
S S 0 0 2
128/131 CME 100 Fall 2009
The flux over the entire surface is the sum of fluxes through all the individual faces and so Φ = 32 .
Now, the divergence is given by:
→
− ∂M ∂N ∂P ∂ ∂ ∂
∇· F = + + = (xy) + (yz) + (xz) = y + z + x
∂x ∂y ∂z ∂x ∂y ∂z
Hence, we can compute:
1 1 1 3
Z 1Z 1Z 1
→
−
ZZZ
∇ · F dV = (x + y + z)dx dy dz = + + =
D 0 0 0 2 2 2 2
This agrees with the divergence theorem.
Example 99. S is the boundary surface of the region T defined by z = 0, y = 0, y = 2 and the
→
−
parabolic cylinder z = 1 − x2 , as shown in figure 116. Compute the flux of F through S where
→
−
F = (x + cos y)~i + (y + sin z) ~j + (z + ex ) ~k.
z = 1 − x2
2 y
x
Figure 116: A parabolic cylinder bounded by planes
~n2
S2
~n1
S1
→
− 0 Q
Example 100. Show that for any surface S surrounding a charge Q, the electric field E = r |3
|~
~r
satisfies
→
−
ZZ
E · ~n dS = 4π0 Q
S
→
−
Let’s say we have a charge Q sitting at the origin in a electric field E . Let’s compute the flux
through a sphere of radius a about the origin:
→
− 0 Q ~r ~r 0 Q 0 Q
ZZ ZZ ZZ
E · ~n dS =
3 · dS =
2
dS = 2 4πa2 = 4π0 Q
r a a
S a a
~
S S
a
which is independent of a!
Now, let’s say we have an arbitrary surface instead of the sphere which includes the origin. We can
exclude the origin by creating a small sphere around it, as suggested in the note above. Hence, we
can apply the divergence theorem to get:
→
− →
− →
−
ZZ ZZ ZZZ
E · ~n dS + E · ~n dS = ∇ · E dV
S1 S2 D
→
−
But, ∇ · E = 0, and thus, we have:
→
− →
−
ZZ ZZ
E · ~n dS = − E · ~n dS = 4π0 Q
S1 S2
for an arbitrary surface S1 ! This is analogous to a calculation we did with Green’s theorem previ-
ously.
→
− 0 Q →
−
Example 101. Show that the electric field E = r |3
|~
~r satisfies ∇ · E = 4π0 ρ, where ρ is the charge
density per unit volume.
→
− →
−
ZZ ZZZ ZZZ ZZZ
E · ~n dS = 4π0 Q = 4π0 ρ dV = (4π0 ρ)dV = ∇ · E dV
S D D D
→
−
But this is true for an arbitrary volume D and hence we must have ∇ · E = 4π0 ρ.
130/131 CME 100 Fall 2009
C2
B
R
A
C1
Figure 118: The closed path from a point A back to itself through B
Let the closed curve C be the union of these two curves: C = C1 ∪ C2 . We have the work done as:
→
− → − →
−
I Z
W = F · T ds = ∇ × F · ~k ds = 0
C R
→
−
as ∇ × F = 0. But the integral on the left hand side can be written as
→
− → − →
− → − →
− → −
I Z Z
W = F · T ds = F · T ds + F · T ds
C C1 C2
The right hand side corresponds also to an integral along a path going from A to B following the
curve C2 . This is the reverse of the path C2 which goes from B to A and hence the negative sign
in front of the integral. This equation says that the work done in moving from A to B is the same
along C1 and C2 ; this shows that in fact it is independent of the path. We have proved that the
→
−
vector field F is conservative.