Multivariable Calculus Math 21a: Harvard University Spring 2004 Oliver Knill
Multivariable Calculus Math 21a: Harvard University Spring 2004 Oliver Knill
Multivariable Calculus Math 21a: Harvard University Spring 2004 Oliver Knill
These are some class notes distributed in a multivariable calculus course tought in Spring 2004. This was a physics avored section. Some of the pages were developed as complements to the text and lectures in the years 2000-2004. While some of the pages are proofread pretty well over the years, others were written just the night before class. The last lecture was calculus beyond calculus. Glued with it after that are some notes from last hours from previous semesters.
O. Knill, Math21a
VECTORS. Two points P1 = (x1 , y1 ), Q = P2 = (x2 , y2 ) in the plane determine a vector v = x2 x1 , y2 y1 . It points from P1 to P2 and we can write P1 + v = P2 . COORDINATES. Points P in space are in one to one correspondence to vectors pointing from 0 to P . The numbers vi in a vector v = (v1 , v2 ) are also called components or of the vector. REMARKS: vectors can be drawn everywhere in the plane. If a vector starts at 0, then the vector v = v 1 , v2 points to the point v1 , v2 . Thats is why one can identify points P = (a, b) with vectors v = a, b . Two vectors which can be translated into each other are considered equal. In three dimensions, vectors have three components. In some Encyclopedias like Encylopedia Britannica dene vectors as objects which have both magnitude and direction. This is unprecise and strictly speaking incorrect because the zero vector is also a vector but has no direction. ADDITION SUBTRACTION, SCALAR MULTIPLICATION.
u+v =v+u VECTOR OPERATIONS: The addition and scalar multiplication of u + (v + w) = (u + v) + w vectors satisfy obvious properties. u+0=0+u=0 There is no need to memorize them. r (s v) = (r s) v We write here for multiplication (r + s)v = v(r + s) with a scalar but usually, the multir(v + w) = rv + rw plication sign is left out. 1v =v
commutativity additive associativity null vector scalar associativity distributivity in scalar distributivity in vector the one element
LENGTH. The length |v| of v is the distance from the beginning to the end of the vector. EXAMPLES. 1) If v = (3, 4) , then |v| = 25 = 5. 2) |i| = |j| = k| = 1, |0| = 0.
UNIT VECTOR. A vector of length 1 is called a unit vector. If v = 0, then v/|v| is a unit vector. EXAMPLE: If v = (3, 4), then v = (2/5, 3/5) is a unit vector, i, j, k are unit vectors. PARALLEL VECTORS. Two vectors v and w are called parallel, if v = rw with some constant r.
y 3 u u u+v u u-v u x v v x x
DOT PRODUCT. The dot product of two vectors v = (v1 , v2 , v3 ) and w = (w1 , w2 , w3 ) is dened as v w = v 1 w1 + v 2 w2 + v 3 w3
Remark: in science, other notations are used: v w = (v, w) (mathematics) < v|w > (quantum mechanics) v i wi (Einstein notation) gij v i wj (general relativity). The dot product is also called scalar product, or inner product.
u + v = u 1 , u2 + v 1 , v 2 = u 1 + v 1 , u2 + v 2
u v = u 1 , u2 v 1 , v 2 = u 1 v 1 , u2 v 2
u = u1 , u2 = u1 , u2
LENGTH. Using the dot product one can express the length of v as |v| = CHALLENGE. Express the dot product in terms of the length alone.
v v.
BASIS VECTORS. The vectors i = 1, 0 , j = 0, 1 are called standard basis vectors in the plane. In space, one has the basis vectors i = 1, 0, 0 , j = 0, 1, 0 , k = 0, 0, 1 . Every vector v = (v1 , v2 ) in the plane can be written as a sum of standard basis vectors: v = v1 i + v2 j. Every vector v = (v1 , v2 , v3 ) in space can be written as v = v1 i + v2 j + v3 k. WHERE DO VECTORS OCCUR? Here are some examples: Velocity: if (f (t), g(t)) is a point in the plane which depends on time t, then v = f (t), g (t) is the velocity vector at the point (f (t), g(t)). Forces: Some problems in statics involve the determination of a forces acting on objects. Forces are represented as vectors Qbits: in quantum computation, one does not work with bits, but with qbits, which are vectors.
ANGLE. Because |v w|2 = (v w, v w) = |v|2 + |w|2 2(v, w) is by the cos-theorem equal to |v|2 + |w|2 2|v| |w| cos(), where is the angle between the vectors v and w, we get the important formula v w = |v| |w| cos()
CAUCHY-SCHWARZ INEQUALITY: |v w| |v||w| follows from that formula because | cos()| 1. TRIANGLE INEQUALITY: |u + v| |u| + |v| follows from |u + v|2 = (u + v) (u + v) = u2 + v 2 + 2u v u2 + v 2 + 2|u v| u2 + v 2 + 2|u| |v| = (|u| + |v|)2 . FINDING ANGLES BETWEEN VECTORS. Find the angle between the vectors (1, 4, 3) and (1, 2, 3). ANSWER: cos() = 16/( 26 14) 0.839. So that = arccos(0.839..) 33 . ORTHOGONAL VECTORS. Two vectors are called orthogonal if v w = 0. The zero vector 0 is orthogonal to any vector. EXAMPLE: v = (2, 3) is orthogonal to w = (3, 2).
Fields: elds like electromagnetic or gravitational elds or velocity elds in uids are described with vectors.
Color can be written as a vector v = (r, g, b), where r is red, g is green and b is blue. An other coordinate system is v = (c, m, y) = (1 r, 1 g, 1 b), where c is cyan, m is magenta and y is yellow.
blue (r,g,b)
green red
SVG. Scalable Vector Graphics is an emerging standard for the web for describing twodimensional graphics in XML.
solute value is the length of the projection of v onto w.) The vector b = v a is called the component of v orthogonal to the w-direction.
PROJECTION. The vector a = projw (v) = w(v w/|w|2 ) is called the projection of v onto w. The scalar projection is dened as compw(v) = (v w)/|w| . (Its ab-
v a
EXAMPLE. v = (0, 1, 1), w = (1, 1, 0), projw (v) = (1/2, 1/2, 0), compw (v) = 1/ 2.
Math21a, O. Knill
DISTANCE POINT-LINE (3D). If P is a point in space and L is the line which contains the vector u, then d(P, L) = |P Q u|/|u| is the distance between P and the line L.
PLANE THROUGH 3 POINTS P, Q, R: The vector n = P Q P R is orthogonal to the plane. We will see next week that n = (a, b, c) denes the plane ax + by + cz = d, with d = ax0 + by0 + cz0 which passes through the points P = (x0 , y0 , z0 ), Q, R. The cross product appears in many dierent applications: ANGULAR MOMENTUM. If a mass point of mass m moves along a curve r(t), then the vector L(t) = mr(t) r (t) is called the angular momentum of the point. It is coordinate system dependent. ANGULAR MOMENTUM CONSERVATION. d L(t) = mr (t) r (t) + mr(t) r (t) = r(t) F (t) dt In a central eld, where F (t) is parallel to r(t), we get d/dtL(t) = 0 which means L(t) is constant. TORQUE. The quantity r(t) F (t) is also called the torque. The time derivative of the momentum p = mr is the force F . the time derivative of the angular momentum L = r(t) p(t) = mr(t) r (t) is the torque.
r(t)
DIRECTION OF v w: v w is orthogonal to v and orthogonal to w. Proof. Check that v (v w) = 0. LENGTH: |v w| = |v||w| sin()
Proof. The identity |v w|2 = |v|2 |w|2 (v w)2 can be proven by direct computation. Now, |v w| = |v||w| cos(). AREA. The length |v w| is the area of the parallelogram spanned by v and w. Proof. Because |w| sin() is the height of the parallelogram with base length |v|, the area is |v||w| sin() which is by the above formula equal to |v w|. EXAMPLE. If v = (a, 0, 0) and w = (b cos(), b sin(), 0), then v w = (0, 0, ab sin()) which has length |ab sin()|. ZERO CROSS PRODUCT. We see that v w is zero if v and w are parallel. ORIENTATION. The vectors v, w and v w form a right handed coordinate system. The right hand rule is: put the rst vector v on the thumb, the second vector w on the pointing nger and the third vector v w on the third middle nger. EXAMPLE. i, j, i j = k forms a right handed coordinate system. DOT PRODUCT (is a scalar) vw =wv |v w| = |v||w| cos() (av) w = a(v w) (u + v) w = u w + v w {1, 2, 3}.{3, 4, 5} d dt (v w) = v w + v w commutative angle linearity distributivity in Mathematica product rule CROSS PRODUCT (is a vector) v w = w v |v w| = |v||w| sin() (av) w = a(v w) (u + v) w = u w + v w Cross[{1, 2, 3}, {3, 4, 5}] d (v w) = v w + v w
dt
KEPLERS AREA LAW. (Proof by Newton) The fact that L(t) is constant means rst of all that r(t) stays in a plane spanned by r(0) and r (0). The experimental fact that the vector r(t) sweeps over equal areas in equal times expresses angular momentum conservation: |r(t) r (t)dt/2| = |Ldt/m/2| is the area of a small triangle. The vector r(t) sweeps over an area T |L|dt/(2m) = |L|T /(2m) in time [0, T ]. 0 anti-commutative angle linearity distributivity in Mathematica product rule
r(t) dr x r/2
Earth
Sun
MORE PLACES IN PHYSICS WHERE THE CROSS PRODUCT OCCURS: The top, the motion of a rigid body is describe by the angular momentum L and the angular velocity vector in the body. Then L = L + M , where M is an external torque obtained by external forces. Electromagnetism: (informal) a particle moving along r(t) in a magnetic eld B for example experiences the force F (t) = qr (t) B, where q is the charge of the particle. In a constant magnetic eld, the particles move on circles: if m is the mass of the particle, then mr (t) = qr (t) B implies mr (t) = qr (t) B. Now d/dt|r|2 = 2r r = r qr (t) B = 0 so that |r| is constant. Hurricanes are powerful storms with wind velocities of 74 miles per hour or more. On the northern hemisphere, hurricanes turn counterclockwise, on the southern hemisphere clockwise. This is a feature of all low pressure systems and can be explained by the Coriolis force. In a rotating coordinate system a particle of mass m moving along r(t) experience the following forces: m r (inertia of rotation), 2m r (Coriolis force) and m ( r)) (Centrifugal force). The Coriolis force is also responsible for the circulation in Jupiters Red Spot.
TRIPLE SCALAR PRODUCT. The scalar [u, v, w] = u (v w) is called the triple scalar product of u, v, w. PARALLELEPIPED. [u, v, w] is the volume of the parallelepiped spanned by u, v, w because h = u n/|n| is the height of the parallelepiped if n = (v w) is a normal vector to the ground parallelogram which has area A = |n| = |v w|. The volume of the parallelepiped is hA = u n|n|/|n| = |u (v w)|.
EXAMPLE. Find the volume of the parallel epiped which has the one corner O = (1, 1, 0) and three corners P = (2, 3, 1), Q = (4, 3, 1), R = (1, 4, 1) connected to it. ANSWER: The parallelepiped is spanned by u = (1, 2, 1), v = (3, 2, 1), and w = (0, 3, 2). We get v w = (1, 6, 9) and u (v w) = 2. The volume is 2.
Lecture 3. DISTANCES
Math21a, O. Knill
EXAMPLES
DISTANCE POINT-POINT (3D). If P and Q are two points, then d(P, Q) = |P Q| is the distance between P and Q.
DISTANCE POINT-POINT (3D). P = (5, 2, 4) and Q = (2, 2, 0) are two points, then d(P, Q) = |P Q| = (5 + 2)2 + (2 2)2 + (0 4)2 = 5
DISTANCE POINT-PLANE (3D). If P is a point in space and : n x = d is a plane containing a point Q, then d(P, ) = |(P Q) n|/|n| is the distance between P and the plane.
DISTANCE POINT-PLANE (3D). P = (7, 1, 4) is a point and : 2x+4y+5z = 9 is a plane which contains the point Q = (0, 1, 1). Then d(P, ) = |(7, 0, 3) (2, 4, 5)|/| 45| = 29/ 45 is the distance between P and .
DISTANCE POINT-LINE (3D). If P is a point in space and L is the line r(t) = Q + tu, then d(P, L) = |(P Q) u|/|u| is the distance between P and the line L.
DISTANCE POINT-LINE (3D). P = (2, 3, 1) is a point in space and L is the line r(t) = (1, 1, 2) + t(5, 0, 1). Then d(P, L) = |(1, 2, 1) (5, 0, 1)|/ 26 = |(2, 6, 10)|/ 26 = 140/ 26 is the distance between P and L.
DISTANCE LINE-LINE (3D). L is the line r(t) = Q + tu and M is the line s(t) = P + tv, then d(L, M ) = |(P Q) (u v)|/|u v| is the distance between the two lines L and M .
DISTANCE LINE-LINE (3D). L is the line r(t) = (2, 1, 4) + t(1, 1, 0) and M is the line s(t) = (1, 0, 2) + t(5, 1, 2). The cross product of (1, 1, 0) and (5, 1, 2) is (2, 2, 6). The distance between these two lines is d(L, M ) = |(3, 1, 2) (2, 2, 6)|/ 44 = 4/ 44 .
DISTANCE PLANE-PLANE (3D). If n x = d and n x = e are two parallel planes, then their distance is (e d)/|n|. Nonparallel planes have distance 0.
DISTANCE PLANE-PLANE (3D). 5x + 4y + 3z = 8 and 5x + 4y + 3z = 1 are two parallel planes. Their distance is 7/ 50.
EQUATIONS OF LINE. We can write (x, y, z) = (1, 1, 2) + t(2, 4, 6) so that x = 1 + 2t, y = 1 + 4t, z = 2 + 6t. If we solve the rst equation for t and plug it into the other equations, we get y = 1 + (2x 2), z = 2 + 3(2x 2). We can therefore describe the line also as L = {(x, y, z) | y = 2x 1, z = 6x 4 } SYMMETRIC EQUATION. The line r = P + tv with P = (x0 , y0 , z0 ) and v = (a, b, c) satises the symmetric equations
xx0 a
DISTANCE POINT-LINE (3D). If P is a point in space and L is the line r(t) = Q + tu, then d(P, L) = |(P Q) u|/|u| is the distance between P and the line L. This formula is veried by writing (P Q) u = |P Q||u| sin().
yy0 b
zz0 c
(every expression is equal to t). DISTANCE LINE-LINE (3D). L is the line r(t) = Q + tu and M is the line s(t) = P + tv, then d(L, M ) = |(P Q) (u v)|/|u v| is the distance between the two lines L and M .
PROBLEM. Find the equations for the line through the points P = (0, 1, 1) and Q = (2, 3, 4). SOLUTION. The parametric equations are (x, y, z) = (0, 1, 1) + t(2, 2, 3) or x = 2t, y = 1 + 2t, z = 1 + 3t. Solving each equation for t gives the symmetric equations x/2 = (y 1)/2 = (z 1)/3.
PLANES. A point P and two vectors v, w dene a plane . It is the set of points = {P + tv + sw, where t, s are real numbers } The line contains the point P . EXAMPLE. = {(x, y, z) | (1, 1, 2) + t(2, 4, 6) + s(1, 0, 1) }. This is called the parametric description of a plane. EQUATION OF PLANE. Given a plane as a parametric equation P = Q + tv + sw. The vector n = v w is orthogonal to both n and w. Because also the vector P Q = Q P is perpendicular to n we have (Q P ) n = 0. With Q = (x0 , y0 , z0 ), P = (x, y, z), and n = (a, b, c), this means ax + by + cz = ax0 by0 + cz0 = d. The plane is therefore described by a single equation ax + by + cz = d . PROBLEM. Find the equation of a plane which contains the three points P = (1, 1, 1), Q = (0, 1, 1), R = (1, 1, 3). SOLUTION. The plane contains the two vectors v = (1, 2, 0) and w = (2, 2, 2). We have n = (4, 2, 2) and the equation is 4x 2y 2z = d. The constant d is obtained by plugging in one point: 4x 2y 2z = 4 . LINES AND PLANES IN MATHEMATICA. Plotting a line: ParametricPlot3D[{1, 1, 1} + t{3, 4, 5}, {t, 2, 2}] Plotting a plane: ParametricPlot3D[{1, 1, 1} + t{3, 4, 5} + s{1, 2, 3}, {t, 2, 2}, {s, 2, 2}] Finding the equation of a plane P = {1, 1, 1}; Q = {0, 1, 1}; R = {1, 1, 3}; n = Cross[Q P, R P]; n.{x, y, z} n.P
This formula is just the scalar projection of QP = P Q onto the vector n = u v normal to both u and v.
PLANE THROUGH 3 POINTS P, Q, R: The vector (a, b, c) = n = (Q P ) (R P ) is normal to the plane. Therefore, the equation is ax+by +cz = d. The constant is d = ax0 +by0 +cz0 because the point P = (x0 , y0 , z0 ) is on the plane. PLANE THROUGH POINT P AND LINE r(t) = Q + tu. The vector (a, b, c) = n = u (Q P ) is normal to the plane. Therefore the plane is given by ax + by + cz = d, where d = ax0 + by0 + cz0 and P = (x0 , y0 , z0 ). LINE ORTHOGONAL TO PLANE ax+by+cz=d THROUGH POINT P. The vector n = (a, b, c) is normal to the plane. The line is r(t) = P + nt. ANGLE BETWEEN PLANES. The angle between the two planes a1 x + b1 y + c1 z = d1 and a2 x + b2 y + c2z = d2 is arccos(n1 n2 /(|n1 ||n2 |), where ni = (ai , bi , ci ). Alternatively, it is arcsin(|n1 n2 |/(|n1 ||n2 |)). INTERSECTION BETWEEN TWO PLANES. Find the line which is the intersection of two non-parallel planes a1 x + b1 y + c1 z = d1 and a2 x + b2 y + c2 z = d2 . Find rst a point P which is in the intersection. Then r(t) = P + t(n1 n2 ) is the line, we were looking for. LINES IN THE PLANE. LINE P = Q + tv. Eliminating t gives a single equation. For example, (x, y) = (1, 2) + t(3, 4) is equivalent to x = 1 + 3t, y = 2 + 4t and 4x 3y = 2. The general equation for a line in the plane is ax + by = d .
Math21a
WHERE DO CURVES APPEAR? Objects like particles, celestial bodies, or quantities change in time. Their motion is described by curves. Examples are the motion of a star moving in a galaxy, or data changing in time like (DJIA(t),NASDAQ(t),SP500(t))
PARAMETRIC PLANE CURVES. If x(t), y(t) are functions of one variable, dened on the parameter interval I = [a, b], then r(t) = f (t), g(t) is a parametric curve in the plane. The functions x(t), y(t) are called coordinate functions. PARAMETRIC SPACE CURVES. If x(t), y(t), z(t) are functions, then r(t) = x(t), y(t), z(t) is a space curve. Always think of the parameter t as time. For every xed t, we have a point (x(t), y(t), z(t)) in space. As t varies, we move along the curve. EXAMPLE 1. If x(t) = t, y(t) = t2 + 1, we can write y(x) = x2 + 1 and the curve is a graph. EXAMPLE 2. If x(t) = cos(t), y(t) = sin(t), then r(t) follows a circle. EXAMPLE 3. If x(t) = cos(t), y(t) = sin(t), z(t) = t, then r(t) describes a spiral. EXAMPLE 4. If x(t) = cos(2t), y(t) = sin(2t), z(t) = 2t, then we have the same curve as in example 3 but we traverse it faster. The parameterization changed. EXAMPLE 5. If x(t) = cos(t), y(t) = sin(t), z(t) = t, then we have the same curve as in example 3 but we traverse it in the opposite direction. EXAMPLE 6. If P = (a, b, c) and Q = (u, v, w) are points in space, then r(t) = a+t(ua), b+t(vb), c+t(wc) dened on t [0, 1] is a line segment connecting P with Q. ELIMINATION: Sometimes it is possible to eliminate the parameter t and write the curve using equations (one equation in the plane or two equations in space). EXAMPLE: (circle) If x(t) = cos(t), y(t) = sin(t), then x(t)2 + y(t)2 = 1. EXAMPLE: (spiral) If x(t) = cos(t), y(t) = sin(t), z(t) = t, then x = cos(z), y = sin(z). The spiral is the intersection of two graphs x = cos(z) and y = sin(z).
Strings or knots are closed curves in space. Molecules like RNA or proteins can be modeled as curves. Computer graphics: surfaces are represented by mesh of curves. Typography: fonts represented by Bezier curves. Space time A curve in space-time describes the motion of particles. Topology Examples: space lling curves, boundaries of surfaces or knots. DERIVATIVES. If r(t) = x(t), y(t), z(t) is a curve, then r (t) = x (t), y (t), z (t) = x, y, z is called the velocity. Its length |r (t)| is called speed and v/|v| is called direction of motion. The vector r (t) is called the acceleration. The third derivative r is called the jerk. The velocity vector r(t) is tangent to the curve at r(t). EXAMPLE. If r(t) = cos(3t), sin(2t), 2 sin(t) , then r (t) = 3 sin(3t), 2 cos(2t), 2 cos(t) , r (t) = 9 cos(3t), 4 sin(2t), 2 sin(t) and r (t) = 27 sin(3t), 8 cos(2t), 2 cos(t) . WHAT IS MOTION? The paradoxon of Zeno of Elea: When looking at a body at a specic time, the body is xed. Being xed at each instant, there is no motion. While one might wonder today a bit about Zenos thoughts, there were philosophers like Kant, Hume or Hegel, who thought seriously about Zenos challenges. Physicists continue to ponder about the question: what is time and space? Today, the derivative or rate of change is dened as a limit (r(t + dt) r(t))/dt, where dt approaches zero. If the limit exists, the velocity is dened. EXAMPLES OF VELOCITIES. EXAMPLES OF ACCELERATIONS. Train: Car: Space shuttle: Combat plane (F16) (blackout): Ejection from F16: Free fall: Electron in vacuum tube: 0.1-0.3 m/s2 3-8 m/s2 3G = 30m/s2 9G=90 m/s2 14G=140 m/s2 . 1G = 9.81 m/s2 1015 m/s2
CIRCLE
HEART
LISSAJOUS
SPIRAL
Person walking: Signals in nerves: Plane: Sound in air: Speed of bullet: Earth around the sun: Sun around galaxy center: Light in vacuum:
1.5 m/s 40 m/s 70-900 m/s Mach1=340 m/s 1200-1500 m/s 30000 m/s 200000 m/s 300000000 m/s
(cos(t), 3 sin(t))
(1 + cos(t))(cos(t), sin(t))
(cos(3t), sin(5t))
TRIFOLIUM
EPICYCLE
SPRING (3D)
DIFFERENTIATION RULES. The rules in one dimensions (f + g) = f + g (cf ) = cf , (f g) = f g + f g (Leibniz), (f (g)) = f (g)g (chain rule) generalize for vector-valued functions: (v + w) = v + w , (cv) = cv , (v w) = v w + v w (v w) = v w + v w (Leibniz), (v(f (t))) = v (f (t))f (t) (chain rule). The Leibniz rule for the triple dot product [u, v, w] = u (v w) is d/dt[u, v, w] = [u , v, w] + [u, v , w] + [u, v, w ] (see homework). INTEGRATION. If r (t) and r(0) is known, we can gure out r(t) t by integration r(t) = r(0) + 0 r (s) ds. Assume we know the acceleration a(t) = r (t) as well as initial velocity and position r (0) and r(0). Then r(t) = r(0) + tr (0) + R(t), t t where R(t) = 0 v(s) ds and v(t) = 0 a(s) ds.
10 8 6 4 2
cos(3t)(cos(t), sin(t))
(cos(t), sin(t), t)
EXAMPLE. Shooting a ball. If r (t) = 0, 0, 10 , r (0) = 0, 1000, 2 , r(0) = 0, 0, h , then r(t) = 0, 1000t, h + 2t 10t2 /2 .
50
100
150
200
250
300
r(t) = ((2 + cos(3t/2)) cos(t), (2 + cos(3t/2)) sin(t), sin(3t/2)) 1) Find an interval [a, b] on which r(t) parameterizes a closed curve in space. A closed curve in space is called a knot. These objects are not only interesting in mathematics or physics. For example, DNA of bacteria and some proteins form knots (see the back of the page). 2) Verify that the projection r(t) = x(t), y(t) of this curve onto the xy-plane is in polar coordinates by r(t) = 2 + cos(3t/2), (t) = t. 3) Sketch this curve.
Indicate at the crossings, which part of the curve is above the other. 4) Calculate the velocity vector r (t) of r(t) at t = 0. If this vector is v = a, b, c , then (a, b) is its projection on the xy plane. Draw this vector a, b in the above xy-projection of the knot.
For more information on DNA knots, see the MSRI talk by DeWitt Sumners: http://www.msri.org/publications/ln/msri/2000/molbio/sumners/1/
KEPLERS LAWS
FROM THE 2 BODY TO THE KEPLER PROBLEM. Two bodies with position vectors r1 , r2 and mass m1 , m2 attract each other with the force F = x Gm1 m2 r3 , where x = r1 r2 is the dierence vector between the bodies. The length |F | of the force is proportional to 1/r 2 . The vector x = r1 r2 of length r satises x = r1 r2 = m2 G(r2 r1 )/|r2 r1 |3 m1 G(r1 r2 )/|r2 r1 |3 = (m1 + m2 )Gx/r3 . The new problem describes a mass-point with position x and mass m = m1 + m2 which is attracted to a xed force centered at the origin. This problem x = mGx/r3 is called the Kepler problem. The angular momentum L = mx x and the energy E = m|x |2 /2 + mG/|x| do not change in time.
x(t+s)
Oliver Knill
m
THE 3. KEPLER LAW. Let T be the period of the orbit. It is the time the body needs to go around the ellipse once. (If S is the sun and r(t) the orbit of the earth, then T is one year.) The third Kepler law states that T 2 /a3 = 4 2 /(Gm) is a constant . Proof. If f (t) is the area swept by radial vector from time 0 to time t, then f (t) = L/(2m) implies the that the area of the ellipse A = a2 1 2 is equal to LT /(2m). From T = 2ma2 1 2 /L, we obtain T 2 /a3 = 4m2 2 a(1 2 )/L2 = 4 2 /(Gm). MEASURING THE GRAVITATIONAL CONSTANT. Note that the 3. Kepler law allows us to compute the gravitational constant G from the period, the total mass (essentially the mass of the sun) and the geometry of the ellipse. The case > 1 corresponds to a negative G, where particles repell each other. The third Kepler law does then no more apply and ellipses become a hyperbola. The second law is unchanged. REMARKS. If the force is changed to x = mGx/r , (note that = 3 is the Kepler case), then the second Kepler law still applies, the other two laws not. The formula = L/(mr2 ) still applies. Also the derivation of the formula for x n = r L2 /(m2 r3 ) is valid. The left hand side is mG/r 1 , which leads to the ordinary dierential equation r = mG/r1 + L2 /(m2 r3 ) for r(t). Knowing r(t) gives then (t) from = L/(mr2 ). The global behavior depends on the constants G, L. If = 4, which corresponds to the two body problem in 4 dimensions, then r = C/r3 , where C = mG+L2/m2 is a constant. If C > 0, the bodies seperate to innity. If C < 0, then r(t) 0. Only if the angular momentum is such that C = 0, there is a bounded motion. Stable planetary systems would not exist in four dimensions. A theorem of Bertant states that only for = 3 (the Kepler case) and = 1 (the harmonic oscillator), all bounded orbits are periodic. COLLISIONS. If the two podies collide, we get a collision singularity. Collisions can occur in the 2-body problem, if the total angular momentum of the two bodies is zero. Analysing collision singularities involving more than two bodies helps to understand what happens when particles are close to such collision congurations. It is known that initial conditions leading to collisions are rare in the n-body problem. Noncollision singularities in which particles escape to innity in nite time exist already for the 5-body problem. Our galaxy and M31, the Andromeda galaxy, form a relatively isolated system known as the local group. The center of mass of M31 approaches the center of mass our galaxy with a velocity of 119 km/s. In about 10 10 years, these galaxies are likely to collide. Such a collision will have dramatic consequences for both systems. Nevertheless, even a direct encounter would probably not lead to any collision of any two stars. SOME HISTORY. Nicolas Kopernicus (1473-1543) had a heliocentric system. Galileo Galilei (1564-1642) discovers Jupiter moons. Johannes Kepler (1571-1630) builds on the observations of Tycho Brahe. Finds the rst and second Kepler Law in 1609, the third in 1619. Before Newton, the dynamics of celestial objects was described empirically, rst by circular, later by epicycle approximations which eectively where Fourier approximations of the actual elliptic motion. Issac Newton (1643-1727) led the foundations of mathematical description and developed calculus simultaneously with Leibnitz. Newton had already solved the Kepler problem geometrically. Johan Bernoulli proved in 1710 that solutions to the 2 body problem move on conic sections. Laplace, Lagrange, Hamilton and Poisson belong to the ancestors of celestial mechanics, the study of the n-body problem. With Poincar (1854-1912) at the end of the 19th century, and e Birkho (at Harvard!), the subject of the three body problem was studied with new geometric and topological methods.
x
m2 r2
r1
THE 2. KEPLER LAW. The area law or Keplers second law is: The radius vector x passes the equal area in equal time. Proof. Because x is parallel to x, and L = mx x, we get L = 0 (use the product law). If follows that the vector x stays in the plane spanned by x and x . We can now use coordinates x = (r cos(), r sin(), 0) to describe the point. With x = (r cos(), r sin(), 0) + (r sin(), r cos(), 0) . The conserved quantity |L| = m|x x| = mr2 can be interpreted as 2mf , where f (t) is the area swept over by the vector x in the interval [0, t]. We will use the formula |L| = r 2 later. ELLIPSES. An ellipse with focal points S = (a , 0), S = (a , 0) with eccentricity is dened as the set of points in the plane whose distances r and r to S and S satisfy r + r = 2a. From (2a r)2 = r2 = r2 sin2 () + (2a + r cos())2 , we obtain r=
a(1 2 ) 1+ cos()
x(t)
(-a,0)= S
S =(a,0)
(x,y)
r sin()
~ r
r
r0
polar form becomes then r = ellipse have length a and b = a 1 + we will see later in the course.
~ S
2a+a cos()
(0,0)
S =(a,0)
The area is A = ab as
THE 1. KEPLER LAW. The radius vector x(t) describes an ellipse. Proof. (We show that a particle on an ellipse satisfying the 2. law has the correct acceleration of the Kepler law). From the 2. law, we know = L/(mr2 ). The polar form allows us to nd the time derivatives r = a(1 2 ) sin() L L sin() = (1 + cos())2 mr2 ma(1 2 )
of r(t). (In the last step, we replaced r 2 in the denominator with the polar formula.) The second derivative is r =
L2 cos() (m2 a(1 2 )r 2 )
(1).
With the unit vector n = x/r, one has x = (x n)n. From x = nr, we get x = n r+nr , x = n r+2n r +nr . Therefore x n = n nr + 2n nr + r (2). From n = (cos(), sin(), 0), we have n = n where n = ( sin(), cos(), 0). This gives n n = ( )2 . Using n n = 1, we have n n = 0 (3). From n n + n n = 0 and n n = ( )2 = L2 /(mr2 )2 we obtain
L r L n nr = (mr2 )2 = m2 (1+ cos()) (4). Plugging (1),(3),(4) into (2) gives r 2 a(1 2 )
2 2
x n = r + n nr = Therefore,
x = (x n)n = (x n)
2)
x x = mG 3 . r3 r
Math21a
CURVATURE OF A GRAPH. The curve r(t) = (t, f (t)), which is the graph of a function f has the velocity r (t) = (1, f (t)) and the unit tangent vector 2 T (t) = (1, f (t))/ 1 + f (t)2 and after some simplication (t) = |T (t)|/|r (t)| = |f (t)|/ 1 + f (t)2
3 3
0.5
2 -0.5
(t) =
r(t) = (x(t), y(t), z(t)) position r (t) = (x (t), y (t), z (t)) velocity |r (t)| = (x (t), y (t)) speed r (t) = (x (t), y (t), z (t)) acceleration r (x (t), y (t), z (t)) jerk
b a
(t) =
1 + cos2 (t) .
-1
ARC LENGTH. If t [a, b] r(t) with velocity v(t) = r (t) and speed |v(t)|, then length of the curve. For space curves this is L=
b a
(t)2
+y
(t)2
+z
(t)2
dt
B(t) = T (t) N (t) binormal vector PARAMETER INDEPENDENCE. The arc length is independent of the parameterization of the curve. REASON. Changing the parameter is a change of variables (substitution) in the integration. EXAMPLE. The circle parameterized by r(t) = (cos(t2 ), sin(t2 )) on t = [0, 2] has the velocity r (t) =
2 0
Because T (t) T (t) = 1, we get after dierentiation T (t) T (t) = 0 and N (t) is perpendicular to T (t).
2t dt = t2 |0 2 = 2.
The three vectors (T (t), N (t), B(t)) are unit vectors orthogonal to each other. Note. In order that (T (t), N (t), B(t)) exist, we need that r (t) is not zero.
REMARK. Often, there is no closed formula for the arc length of a curve. For example, the Lissajoux 9 sin2 (3t) + 25 cos2 (5t) dt. This integral must be evaluated gure r(t) = (cos(3t), sin(5t)) has the length 0 numerically. If you do the Mathematica Lab, you will see how to do that with the computer. THE MATERIAL BELOW IS NOT PART OF THIS COURSE. CURVATURE. T (t) = r (t)|/|r (t)| unit tangent vector (t) = |T (t)|/|r (t)| curvature EXAMPLE. CIRCLE r(t) = (r cos(t), r sin(t)). r (t) = (r sin(t), r cos(t)). |r (t)| = r. T (t) = ( sin(t), cos(t)). r (t) = (r cos(t), r sin(t)). T (t) = ( cos(t), sin(t)). (t) = |T (t)|/|r (t)| = 1/r. INTERPRETATION. s (t) = ds/dt = |r (t)|. Because If s(t) = |r (t)| dt, then T (t) = dT /dt = dT /ds ds/dt, we have |dT /ds| = |T (t)|/|r (t)| = (t). The curvature is the length of the acceleration vector if r(t) traces the curve with constant speed 1. A large curvature at a point means that the curve is strongly bent. Unlike the acceleration or the velocity, the curvature does not depend on the parameterization of the curve. You see the curvature, while you feel the acceleration. Small curvature = 1/r = 1/2 Large curvature = 1/r = 2
t 0 2
WHERE IS CURVATURE NEEDED? OPTICS. If a curve r(t) represents a wavefront and n(t) is a unit vector normal to the curve at r(t), then s(t) = r(t) + n(t)/(t) denes a new curve called the caustic of the curve. Geometers call that curve the evolute of the original curve. HISTORY. Aristotle: (350 BC) distinguishes between straight lines, circles and mixed behavior Oresme: (14th century): measure of twist called curvitas Kepler: (15th century): circle of curvature. Huygens: (16th century): evolutes and involutes in connection with optics. Newton: (17th century): circle has constant curvature inversely proportional to radius. (using innitesimals) Simpson: (17th century): string construction of evolutes, description using uxions. Euler: (17th century): rst formulas of curvature using second derivatives. Gauss: (18th century): modern description, higher dimensional versions. COMPUTING CURVATURE WITH MATHEMATICA
10
EXAMPLE. HELIX r(t) = (cos(t), sin(t), t). r (t) = ( sin(t), cos(t), 1). |r (t)| = ( sin(t), cos(t), 1) = 2. T (t) = ( sin(t), cos(t), 1)/ 2. r (t) = ( cos(t), sin(t), 0). T (t) = ( cos(t), sin(t), 0)/ 2. (t) = |T (t)|/|r (t)| = 1/2.
SPECIAL LINES. Level curves are encountered every day: Isobars: Isoclines: pressure direction Isothermes: Isoheight: temperature height
EXAMPLE. Let f (x, y) = x2 y 2 . The set x2 y 2 = 0 is the union of the sets x = y and x = y. The set x2 y 2 = 1 consists of two hyperbola with with their tips at (1, 0) and (1, 0). The set x2 y 2 = 1 consists of two hyperbola with their tips at (0, 1).
For example, the isobars to the right show the lines of constant temperature in the north east of the US.
EXAMPLE. Let f (x, y, z) = x2 + y 2 z 2 . f (x, y, z) = 0, f (x, y, z) = 1, f (x, y, z) = 1. The set x2 +y 2 z 2 = 0 is a cone 2 rotational symmetric around the z-axis. The set x + y 2 z 2 = 1 is a one-sheeted hyperboloid, the set x2 + y 2 z 2 = 1 is a two-sheeted hyperboloid. (To see that it is two-sheeted note that the intersection with z = c is empty for 1 z 1.)
A SADDLE. f (x, y) = (x2 2 2 y 2 )ex y . We can here no more nd explicit formulas for the con2 2 tour curves (x2 y 2 )ex y = c. Lets try our best:
f (x, y) = 0 means x2 y 2 = 0 so that x = y, x = y are contour curves. On y = ax the function is g(x) = (1 a2 )x2 e(1+a
2
)x2
contour =
= a
c} or contour
sevmap.
Because f (x, y) = f (x, y) = f (x, y), the function is symmetric with respect to reections at the x and y axis.
A SOMBRERO. The surface z = f (x, y) = sin( x2 + y 2 ) has circles as contour lines. The example shows the graph of the function f (x, y) = sin(xy). We draw the contour map of f : The curve sin(xy) = c is xy = C, where C = arcsin(c) is a constant. The curves y = C/x are hyperbolas except for C = 0, where y = 0 is a line. Also the line x = 0 is a contour curve. The contour map is a family of hyperbolas and the coordinate axis. TOPOGRAPHY. Topographical maps often show the curves of equal height. With the contour curves as information, it is usually already possible to get a good picture of the situation. ABOUT CONTINUITY. In reality, one sometimes has to deal with functions which are not smooth or not continuous: For example, when plotting the temperature of water in relation to pressure and volume, one experiences phase transitions, an other example are water waves breaking in the ocean. Mathematicians have also tried to explain catastrophic events mathematically with a theory called catastrophe theory. Discontinuous things are useful (for example in switches), or not so useful (for example, if something breaks). DEFINITION. A function f (x, y) is continuous at (a, b) if f (a, b) is nite and lim(x,y)(a,b) f (x, y) = f (a, b). The later means that that along any curve r(t) with r(0) = (a, b), we have lim t0 f (r(t)) = f (a, b). Continuity for functions of more variables is dened in the same way. EXAMPLE. f (x, y) = (xy)/(x2 + y 2 ). Because lim(x,x)(0,0) f (x, x) = limx0 x2 /(2x2 ) = 1/2 and lim(x,0)(0,0) f (0, x) = lim(x,0)(0,0) 0 = 0. The function is not continuous. EXAMPLE. f (x, y) = (x2 y)/(x2 + y 2 ). In polar coordinates this is f (r, ) = r 3 cos2 () sin()/r2 = r cos2 () sin(). We see that f (r, ) 0 uniformly if r 0. The function is continuous.
Math21a, O. Knill
WHY ARE PARTIAL DERIVATIVES IMPORTANT? Geometry. For example, the gradient Tangent spaces. Approximations, linarizations. Partial dierential equations: laws describing nature. f (x, y, z) is a vector normal to a surface at the point (x, y, z).
PARTIAL DERIVATIVE. If f (x, y) is a function of two variables, then x f (x, y, z) is dened as the derivative of the function g(x) = f (x, y, z), where y is xed. The partial derivative with respect to y is dened similarly.
x f (x, y)
Optimization problems, as we will see later. Solution to some integration problems using generalizations of fundamental theorem of calculus. In general helpful to understand and analyze functions of several variables.
REMARK. The partial derivatives x f, y f measure the rate of change of the function in the x or y directions. For functions of more variables, the partial derivatives are dened in a similar way.
EXAMPLE. f (x, y) = x4 6x2 y 2 + y 4 . We have fx (x, y) = 4x3 12xy 2 , fxx = 12x2 12y 2 , fy (x, y) = 12x2 y +4y 3 , fyy = 12x2 +12y 2 . We see that fxx + fyy = 0. A function which satises this equation is called harmonic. The equation fxx + fyy = 0 is an example of a partial dierential equation.
PARTIAL DIFFERENTIAL EQUATIONS. An equation which involves partial derivatives of an unknown function is called a partial dierential equation. If only the derivative with respect to one variable appears, it is called an ordinary dierential equation. 1) fxx (x, y) = fyy (x, y) is an example of a partial dierential equation 1) fx (x, y) = fxx (x, y) is an example of an ordinary dierential equation. The variable y can be considered as a parameter.
CLAIROT THEOREM. If fxy and fyx are both continuous, then fxy = fyx . Proof. Compare the two sides: LAPLACE EQUATION dxfx (x, y) f (x + dx, y) f (x, y) dyfy (x, y) f (x, y + dy) f (x, y). dydxfxy (x, y) f (x + dx, y + dy) f (x + dx, y + dy) dxdyfyx (x, y) f (x + dx, y + dy) f (x + dx, y) (f (x + dx, y) f (x, y)) (f (x, y + dy) f (x, y)) CONTINUITY IS NECESSARY. Example: f (x, y) = (x3 y xy 3 )/(x2 + y 2 ) contradicts Clairot: fx (x, y) = (3x2 y y 3 )/(x2 + y 2 ) 2x(x3 y xy 3 )/(x2 + y 2 )2 , fx (0, y) = y, fxy (0, 0) = 1, fy (x, y) = (x3 3xy 2 )/(x2 + y 2 ) 2y(x3 y xy 3 )/(x2 + y 2 )2 , fy (x, 0) = x, fy,x (0, 0) = 1. fxx + fyy = 0 . f (x, t) = x2 y 2 .
EQUA-
f (x, y)
fx (x, y)
fy (x, y)
fxy (x, y)
GRADIENT. If f (x, y, z) is a function of three variables, then f (x, y, z) = f (x, y, z), f (x, y, z), f (x, y, z) x y z
is called the gradient of f . The symbol is called Nabla. It is named after an Egyptian harp, the Hebrew word nevel=harp seems to have the same aramaic origin). We will talk about the gradient in detail next week.
A great deal of my work is just playing with equations and seeing what they give. I dont suppose that applies so much to other physicists; I think its a peculiarity of myself that I like to play about with equations, just looking for beautiful mathematical relations which maybe dont have any physical meaning at all. Sometimes they do. - Paul A. M. Dirac.
NORMAL. As we will see later, the gradient f (x, y) is orthogonal to the level curve f (x, y) = c and the gradient f (x, y, z) is normal to the level surface f (x, y, z). For example, the gradient of f (x, y, z) = x2 + y 2 z 2 at a point (x, y, z) is (2x, 2y, 2z).
Dirac discovered a PDE describing the electron which is consistent both with quantum theory and special relativity. This won him the Nobel Prize in 1933. Diracs equation could have two solutions, one for an electron with positive energy, and one for an electron with negative energy. Dirac interpretated the later as an antiparticle: the existence of antiparticles was later conrmed.
Math21a, O. Knill
REMEMBER? If f and g are functions of one variable t, then d/dtf (g(t)) = f (g(t))g (t). For example, d/dt sin(log(t)) = cos(log(t))/t. GRADIENT. Dene f (x, y) = (fx (x, y), fy (x, y)). It is called the gradient of f .
DIETERICI EQUATION. In thermodynamics the temperature T , the pressure p and the volume V of a gase are related. One renement of the ideal gas law pV = RT is the Dieterici equation f (p, V, T ) = p(V b)ea/RV T RT = 0. The constant b depends on the volume of the molecules and a depends on the interaction of the molecules. (A dierent variation of the ideal gas law is van der Waals law). Problem: compute VT . If V = V (T, p), the chain rule says fV VT + fT = 0, so that VT = fT /fV = (ap(V b)ea/RV T /(RV T 2 ) R)/(pV ea/RV T p(V b)ea/RV T /(RV 2 T )). (This could be simplied to (R + a/T V )/(RT /(V b) a/V 2 )). DERIVATIVE. If f : Rn Rm is a map, its derivative f is the m n matrix [f ]ij = MORE DERIVATIVES. (The last three derivatives will only appear later) f : R R3 curve f velocity vector. f : R3 R scalar function f gradient vector. f : R2 R3 surface f tangent matrix f : R2 R2 coordinate change f Jacobean matrix. f : R3 R3 gradient eld f Hessian matrix.
xj fi .
THE CHAIN RULE. If r(t) is curve in space and f is a function of three variables, we get a function of one variables t f (r(t)). The chain rule looks like the 1D chain rule, but where the derivative f is replaced with the gradient f = (fx , fy , fz ). d/dtf (r(t)) = f (r(t)) r (t) WRITING IT OUT. Writing the dot product out gives d f (x(t), y(t)) = fx (x(t), y(t))x (t) + fy (x(t), y(t))y (t) . dt EXAMPLE. Let z = sin(x + 2y), where x and y are functions of t: x = et , y = cos(t). What is Here, z = f (x, y) = sin(x + 2y), zx = cos(x + 2y), and zy = 2 cos(x + 2y) and dz x dt = cos(x + 2y)e 2 cos(x + 2y) sin(t).
dx dt dz dt ?
= et ,
dy dt
= sin(t) and
THE GENERAL CHAIN RULE. (for people who have seen some linear algebra). First of all, the d/dtf (r(t)) = f (r(t)) r (t) is true in any dimension. If f is vector valued, the same equation holds for each component d/dtfi (r(t)) = fi (r(t)) r (t). One can further assume that r depends on dierent variables. Then this formula holds for each variable xi . Here is the general chain rule for the curious: If f : Rn Rm and g : Rk Rn , we can compose f g, which is a map from Rk to Rm . The chain rule expresses the derivative of f g(x) = f (g(x)) in terms of the derivatives of f and g.
xj f (g(x))i
EXAMPLE. If f is the temperature distribution in a room and r(t) is the path of the spider Shelob, then f (r(t)) is the temperature, Shelob experiences at time t. The rate of change depends on the velocity r (t) of the spider as well as the temperature gradient f and the angle between gradient and velocity. For example, if the spider moves perpendicular to the gradient, its velocity is tangent to a level curve and the rate of change is zero.
k xk fi (g(x)) xj gk (x)
or short
Both f (g(x)) and g (x) are matrices and is the matrix multiplication. The chain rule in higher dimensions looks like the chain rule in one dimension, only that the objects are matrices and the multiplication is matrix multiplication. EXAMPLE. GRADIENT IN POLAR COORDINATES. In polar coordinates, the gradient is dened as f = (fr , f /r). Using the chain rule, we can relate this to the usual gradient: d/drf (x(r, ), y(r, )) = f x (x, y) cos()+ fy (x, y) sin() and d/(rd)f (x(r, ), y(r, )) = fx (x, y) sin() + fy (x, y) cos() means that the length of f is the same in both coordinate systems. PROOFS OF THE CHAIN RULE. 1. Proof. Near any point, we can approximate f by a linear function L. It is enough to check the chain rule for linear functions f (x, y) = ax + by c and if r(t) = (x0 + tu, y0 + tv) is a line. Then d d f = (a, b) with r (t) = (u, v). dt f (r(t)) = dt (a(x0 + tu) + b(y0 + tv)) = au + bv and this is the dot product of 2. Proof. Plugging in the denitions of the derivatives and use limits.
EXAMPLE. A nicer spider called Nabla moves along a circle r(t) = (cos(t), sin(t)) on a table with temperature distribution T (x, y) = x2 y 3 . Find the rate of change of the temperature, Nabla experiences. SOLUTION. T (x, y) = (2x, 3y ), r (t) = ( sin(t), cos(t)) d/dtT (r(t)) (2 cos(t), 3 sin(t)2 ) ( sin(t), cos(t)) = 2 cos(t) sin(t) 3 sin2 (t) cos(t).
2
T (r(t)) r (t)
APPLICATION ENERGY CONSERVATION. If H(x, y) is the energy of a system, the system moves satises the equations x (t) = Hy , y (t) = Hx . For example, if H(x, y) = y 2 /2+V (x) is a sum of kinetic and potential energy, then x (t) = y, y (t) = V (x) is equivalent to x (t) = V (x). In the case of the Kepler problem, we had V (x) = Gm/|x|. The energy H is conserved . Proof. The chain rule shows that d/dtH(x(t), y(t)) = Hx (x, y)x (t) + Hy (x, y)y (t) = Hx (x, y)Hy (x, y) Hy (x, y)Hx (x, y) = 0. APPLICATION: IMPLICIT DIFFERENTIATION. From f (x, y) = 0 one can express y as a function of x. From d/df (x, y(x)) = obtain y = fx /fy . f (1, y (x)) = fx + fy y = 0 we
WHERE IS THE CHAIN RULE NEEDED? (informal). While the chain rule is useful in calculations using the composition of functions, the iteration of maps or in doing change of variables, it is also useful for understanding some theoretical aspects. Examples: In the proof of the fact that gradients are orthogonal to level surfaces. (see Wednesday). It appears in change of variable formulas. It will be used in the fundamental theorem for line integrals coming up later in the course. The chain rule illustrates also the Lagrange multiplier method which we will see later. In uid dynamics, PDEs often involve terms ut + u u which give the change of the velocity in the frame of a uid particle. In chaos theory, where one wants to understand what happens after iterating a map f .
EXAMPLE. f (x, y) = x4 + x sin(xy) = 0 denes y = g(x). If f (x, g(x)) = 0, then gx (x) = fx /fy = (4x3 + sin(xy) + xy cos(xy))/(x2 cos(xy)). APPLICATION: DIFFERENTIATION RULES (OSCAR NIGHT). One ring of the chain rules them all! f (x, y) = x + y, x = u(t), y = v(t), d/dt(x + y) = fx u + fy v = u + v . f (x, y) = xy, x = u(t), y = v(t), d/dt(xy) = fx u + fy v = vu + uv . f (x, y) = x/y, x = u(t), y = v(t), d/dt(x/y) = fx u + fy v = u /y v u/v 2 .
Math21a
EXAMPLE. You are on a trip in a air-shop at (1, 2) and want to avoid a thunderstorm, a region of low pressure. The pressure is given by a function p(x, y) = x2 + 2y 2 . In which direction do you have to y so that the pressure change is largest? Parameterize the direction by v = (cos(), sin()). The pressure gradient is p(x, y) = (2x, 4y). The directional derivative in the -direction is p(x, y) v = 2 cos() + 4 sin(). This is maximal for 2 sin() + 4 cos() = 0 which means tan() = 1/2. ZERO DIRECTIONAL DERIVATIVE. The rate of change in all directions is zero if and only if if f = 0, we can choose v = f and get D f f = | f |2 . f (x, y) = 0:
DIRECTIONAL DERIVATIVE. If f is a function of several variables and v is a vector, then in the direction v. One writes v f or Dv f .
We will see later that points with f = 0 are candidates for local maxima or minima of f . Points (x, y), where f (x, y) = (0, 0) are called stationary points or critical points. Knowing the critical points is important to understand the function f . PROPERTIES DIRECTIONAL DERIVATIVE. Dv (f ) = Dv (f ) PROPERTIES GRADIENT (f ) = (f ) (f ) + (g) (f )g + f (g)
Dv f (x, y, z) =
f (x, y, z) v
It is usually assumed that v is a unit vector but we do not insist on that. Using the chain rule, one can write d d dt Dv f = dt f (x + tv). EXAMPLE. PARTIAL DERIVATIVES ARE SPECIAL DIRECTIONAL DERIVATIVES. If v = (1, 0, 0), then Dv f = If v = (0, 1, 0), then Dv f = If v = (0, 0, 1), then Dv f = f v = fx . f v = fy . f v = fz . The directional derivative is a generalization of the partial derivatives. Like the partial derivatives, it is a scalar.
Dv (f + g) = Dv (f ) + Dv (g) Dv (f g) = Dv (f )g + f Dv (g)
(f + g) = (f g) =
EXAMPLE. DIRECTIONAL DERIVATIVE ALONG A CURVE. If f is the temperature in a room and r(t) is a curve with velocity r (t), then f (r(t)) r (t) is the temperature change, one measures on the point moving on a curve r(t) experiences: the chain rule told us that this is d/dtf (r(t)). GRADIENTS AND LEVEL CURVES/SURFACES.
THE MATTERHORN is a popular climbing mountain in the Swiss alps. Its height is 4478 meters (14,869 feet). It is quite easy to climb with a guide. There are ropes and ladders at dicult places. Even so, about 3 people die each year from climbing accidents at the Matterhorn, this does not stop you from trying an ascent. In suitable units on the ground, the height f (x, y) of the Matterhorn is approximated by f (x, y) = 4000 x2 y 2 . At height f (10, 10) = 3800, at the point (10, 10, 3800), you rest. The climbing route continues into the north-east direction v = (1, 1). Calculate the rate of change in that direction. We have f (x, y) = (2x, 2y), so that (20, 20)(1, 1) = 40. This is a place, with a ladder, where you climb 40 meters up when advancing 1m forward. THE VAN DER WAALS (1837-1923) equation for real gases is (p + a/V 2 )(V b) = RT (p, V ) ,
Gradients are orthogonal to level curves and level surfaces. Every vector x x0 in the tangent line satises f (x x0 ) = 0 and is so orthogonal to f . The same argument holds for surfaces (see Friday).
where R = 8.314J/Kmol is a constant called the Avogadro number. This law relates the pressure p, the volume V and the temperature T of a gas. The constant a is related to the molecular interactions, the constant b to the nite rest volume of the molecules. The ideal gas law pV = nRT is obtained when a, b are set to 0. The level curves or isotherms T (p, V ) = const tell much about the properties of the gas. The so called reduced van der Waals law T (p, V ) = (p + 3/V 2 )(3V 1)/8 is obtained by scaling p, T, V depending on the gas. Calculate the directional derivative of T (p, V ) at the point (p, V ) = (1, 1) into the direction v = (1, 2). We have Tp (p, V ) = (3V 1)/8 and TV (p, V ) = 3p/8 (9/8)1/V 2 3/(4V 3 ). Therefore, T (1, 1) = (1/4, 0) and Dv T (1, 1) = 1/5.
STEEPEST DECENT. The directional derivative satises |Dv f | | f ||v| because f v = | f ||v|| cos()| | f ||v|. The direction v = f is the direction, where f increases most, the direction f is the direction where f decreases most. It is the direction of steepest decent. IN WHICH DIRECTION DOES f INCREASE? If v = f , then the directional derivative is This means that f increases, if we move into the direction of the gradient! f f = | f |2 . TANGENT LINE. Because n = f (x0 , y0 ) = a, b is perpendicular to the level curve f (x, y) = c through (x0 , y0 ), the equation for the tangent line is ax + by = d, a = fx (x0 , y0 ), b = fy (x0 , y0 ), d = ax0 + by0 EXAMPLE. The isotherme in the previous example through (1, 1) has there the tangent (1/4)x + 0 y = (1/4)1 + 0 1 = 1/4 which is the horizontal line x = 1.
, Math21a
Surfaces are usually represented in a triangulated form. where a few points on the surface are given and triples of points form triangles. This illustrates the concept of linear approximation. Every triangle is close to the actual surface.
Here is the output of the above routine. Fortunately, the points of each triangle were given in such a way that we also know the direction of the normal vector. We have chosen the direction pointing outwards. Through every triangle, one gradient vector is displayed.
HOW TO PRODUCE THE SKULL SURFACE. We found on the web a le skull.dat, which contains data 0 -0.02 0.02 0.29 0.65 0.08 0.4 0.53 0.06 0 -0.02 0.02 0.4 0.53 0.06 0.53 0.41 0.02 0 -0.02 0.02 ... ... PLOTTING THE SURFACE. To the right is a small Mathematica program which produces a surface from these data. The data are rst read, then packed into groups of 3 to get the points, then packed into groups of three to get the triangles, then each triple of points is made into a polygon. All these polygons are nally displayed. PLOTTING THE GRADIENTS. We can get the gradient vector on each triangle {P1 , P2 , P3 } by taking the cross product n = (P1 P2 )(P3 P2 ) and adding lines connecting Q = (P1 + P2 + P3 ) with the point Q + n. We used that Gradients are orthogonal to the level surfaces. A=ReadList[skull.dat,Number]; B=Partition[A,3]; P=Partition[B,3]; U=Map[Polygon,P]; NormedCross[a ,b ]:=Module[{},u=Cross[a,b]; u/Sqrt[u.u]]; NormalVector[{ a ,b ,c }]:=Module[{},P1=(a+b+c)/3; P2=P1-NormedCross[b-a,c-a]/3;Line[{P1,P2}]]; V=Map[NormalVector,P]; Show[Graphics3D[{U,V}],Boxed-> False,ViewPoint-> {0, 3, 0}] These data encode points in space: every line is a point, three points in a row represent a triangle in space. So, the rst 3 lines from the datale represent the triangle {P, Q, R} = {(0, 0.02, 0.02), (0.29, 0.65, 0.02), (0.4, 0.65, 0.08) }. In total, the le contains 3729 points which means that there are 1243 triangles encoded. Once we have the data in Mathematica, we can also export a le, which a raytracer can read. We could also export to a VRML (Virtual Reality Markup Language) and y around or through it. The ultimate Haloween experience!
A=ReadList[skull.dat,Number]; B=Partition[A,3]; P=Partition[B,3]; U=Map[Polygon,P]; Show[Graphics3D[U],Boxed -> False, ViewPoint -> {0, 3, 0}]
Math21a
REMINDER: TANGENT LINE. Because n = f (x0 , y0 ) = a, b is perpendicular to the level curve f (x, y) = c through (x0 , y0 ), the equation for the tangent line is ax + by = d, a = fx (x0 , y0 ), b = fy (x0 , y0 ), d = ax0 + by0 Example: Find the tangent to the graph of the function g(x) = x2 at the point (2, 4). Solution: the level curve f (x, y) = y x2 = 0 is the graph of a function g(x) = x2 and the tangent at a point (2, g(2)) = (2, 4) is obtained by computing the gradient a, b = f (2, 4) = g (2), 1 = 4, 1 and forming 4x + y = d, where d = 4 2 + 1 4 = 4. The answer is 4x + y = 4 which is the line y = 4x 4 of slope 4. Graphs of 1D functions are curves in the plane, you have computed tangents in single variable calculus. GRADIENT IN 3D. If f (x, y, z) is a function of (fx (x, y, z), fy (x, y, z), fz (x, y, z)) is called the gradient of f .
EXAMPLE. The gradient of f (x, y, z) = x2 + 2y 2 + z 2 at a point (x, y, z) is (2x, 4y, 2z). It illustrates well that going into the direction of the gradient increases the value of the function.
8 6 4 2 -3 -2 -1 -2 -4 -6 1 2 3
three
variables,
then
f (x, y, z)
= TANGENT PLANE. Because n = f (x0 , y0 , z0 ) = a, b, c is perpendicular to the level surface f (x, y, z) = C through (x0 , y0 , z0 ), the equation for the tangent plane is ax + by + cz = d, (a, b, c) = f (x0 , y0 , z0 ), d = ax0 + by0 + cz0 .
POTENTIAL AND FORCE. Force elds F in nature often are gradients of a function U (x, y, z). The function U is called a potential of F or the potential energy. EXAMPLE. If U (x, y, z) = 1/|x|, then U (x, y, z) = x/|x|3 . The function U (x, y, z) is the Coulomb potential and U is the Coulomb force. The gravitational force has the same structure but a dierent constant. While much weaker, it is more eective because it only appears as an attractive force, while electric forces can be both attractive and repelling.
LEVEL SURFACES. If f (x, y, z) is a function of three variables, then f (x, y, z) = C is a surface called a level surface of f . The picture to the right shows the Barth surface (3 + 5t)(1 + x2 + y 2 + z 2 )2 (2 + t + x2 + y 2 + z 2 )2 8(x2 t4 y 2 )(t4 x2 + z 2 ) (y 2 t4 z 2 ) + (x4 2x2 y 2 y 4 2x2 z 2 2y 2 z 2 + z 4 ) = 0, where t = ( 5 1)/2 is the golden ratio.
EXAMPLE. Find the general formula for the tangent plane at a point (x, y, z) of the Barth surface. Just kidding ... Note however that computing this would be no big deal with the help of a computer algebra system like Mathematica. Lets look instead at the quartic surface f (x, y, z) = x4 x3 + y 2 + z 2 = 0 which is also called the piriform or pair shaped surface. What is the equation for the tangent plane at the point P = (2, 2, 2)? We get a, b, c = 20, 4, 4 and so the equation of the plane 20x + 4y + 4z = 56.
ORTHOGONALITY OF GRADIENT. We have seen that the gradient f (x, y) is normal to the level curve f (x, y) = c. This is also true in 3 dimensions: The gradient f (x, y, z) is normal to the level surface f (x, y, z).
EXAMPLE. An important example of a level surface is g(x, y, z) = z f (x, y) which is the graph of a function of two variables. The gradient of g is f = (fx , fy , 1). This allows us to nd the equation of the tangent plane at a point. Quizz: What is the relation between the gradient of f in the plane and the gradient of g in space?
The argument is the same as in 2 dimensions: take a curve d r(t) on the level surface. Then dt f (r(t)) = 0. The chain rule tells from this that f (x, y, z) is perpendicular to the velocity vector r (t). Having f tangent to all tangent velocity vectors on the surfaces forces it to be orthogonal.
EXAMPLE (3D). Use the best linear approximation to f (x, y, z) = ex yz to estimate the value of f at the point (0.01, 24.8, 1.02). Solution. Take (x0 , y0 , z0 ) = (0, 25, 1), where f (x0 , y0 , z0 ) = 5. The gradient is f (x, y, z) = (ex yz, exz/(2 y), ex y). At the point (x0 , y0 , z0 ) = (0, 25, 1) the gradient is the vector (5, 1/10, 5). The linear approximation is L(x, y, z) = f (x0 , y0 , z0 ) + f (x0 , y0 , z0 )(x x0 , y y0 , z z0 ) = 5 + (5, 1/10, 5)(x 0, y 25, z 1) = 5x + y/10 + 5z 2.5. We can approximate f (0.01, 24.8, 1.02) by 5 + (5, 1/10, 5) (0.01, 0.2, 0.02) = 5 + 0.05 0.02 + 0.10 = 5.13. The actual value is f (0.01, 24.8, 1.02) = 5.1306, very close to the estimate. SECOND DERIVATIVE. If f (x, y) is a function of two variables, then the matrix f (x, y) = derivative or the Hessian of f . fxx For functions of three variables, the Hessian is the 3x3 matrix f (x, y, z) = fyx fzx smooth functions, fxy = fyx , fyz = fzy , the matrix f is symmetric (a reection invariant). QUADRATIC APPROXIMATION. (informal) If F is a function of several variables x and x0 is a point, then Q(x) = f (x0 ) + f (x0 )(x x0 ) + [f (x0 )(x x0 )] (x x0 )/2 fxy fxz fyy fyz Because for fzy fzz at the diagonal leaves it fxx fyx fxy fyy is called the second
is called the quadratic approximation of x. It generalizes the quadratic approximation L(x) = f (x0 ) + f (x0 )(x x0 ) + f (x0 )(x x0 )2 /2 of a function of one variables. EXAMPLE. If the height of a hilly region is given by f (x, y) = 4000 sin(x2 + y 2 ), nd the quadratic approximation of F at (0, 0). f (x, y) = (2x, 2y) cos(x2 + y 2 ) so that f (0, 0) = (0, 0). The linear approximation of F at (0, 0) is G(x, y) = f (0, 0) = 4000. The graph of G is a plane tangent to the graph of F . f (x, y) = cos(x2 + y 2 ) so that f (0, 0) = 1 0 0 1 1 0 0 1 .
JUSTIFYING THE LINEAR APPROXIMATION. 3 ways to see it: 1) We know the tangent plane to g(x, y, z) = z f (x, y) at (x0 , y0 , z + 0 = f (x0 , z0 ) is fx x fy y + z = fx x0 fy y0 + z0 . This can be read as z = z0 + +fx (x x0 ) + fy (y y0 ). Calling the right hand side L(x, y) shows that the graph of L is tangent to the graph of f at (x0 , y0 ). 2) The higher dimensional case can be reduced to the one dimensional case: if y = y0 is xed and x, then f (x, y0 ) = f (x0 , y0 ) + fx (x0 , y0 )(x x0 ) is the linear approximation of the function. Similarly, if x = x0 is xed y is the single variable, then f (x0 , y) = f (x0 , y0 ) + fy (x0 , y0 )(y y0 ). So along two directions, the linear approximations are the best. Together we get the approximation for f (x, y). 3) An other justication is that f (x0 ) is orthogonal to the level curve at x0 . Because n = f (x0 ) is orthogonal to the plane n(xx0 ) = d also, the graphs of L(x, y) and f (x, y) have the same normal vector at (x 0 , y0 , f (x0 , y0 ). EXAMPLE (2D) Find the linear approximation of the function f (x, y) = sin(xy 2 ) at the point (1, 1). The gradient is f (x, y) = (y 2 cos(xy 2 ), 2y cos(xy 2 )). At the point (1, 1), we have f (1, 1) = ( cos(), 2 cos()) = (, 2). The linear function approximating f is L(x, y) = f (1, 1) + f (1, 1) (x 1, y 1) = 0 (x 1) 2(y 1) = x 2y + 3. The level curves of G are the lines x + 2y = const. The line which passes through (1, 1) satises x + 2y = 3. Application: 0.00943407 = f (1+0.01, 1+0.01) g(1+0.01, 1+ 0.01) = 0.01 20.01 + 3 = 0.00942478. EXAMPLE (3D) Find the linear approximation to f (x, y, z) = xy + yz + zx at the point (1, 1, 1). We have f (1, 1, 1) = 3, f (x, y, z) = (y + z, x + z, y + x), f (1, 1, 1) = (2, 2, 2). Therefore L(x, y, z) = f (1, 1, 1) + (2, 2, 2) (x 1, y 1, z 1) = 3 + 2(x 1) + 2(y 1) + 2(z 1) = 2x + 2y + 2z 3.
The quadratic approximation at (0, 0) is Q(x, y) = 4000 x2 y 2 . The graph of F is an inverted paraboloid. EXAMPLE: REDUCED VAN DER WAALS LAW T (p, V ) = (p + 3/V 2 )(3V 1)/8 Find the quadratic approximation of T at (p, V ) = (1, 1). We had Tp (p, V ) = (3V 1)/8 and TV (p, V ) = 3p/8 (9/16)1/V 2 3/(4V 3 ) and T (1, 1) = (1/4, 0). Now, Tpp (p, V ) = 0, TpV = 3/8, TV p = 3/8 and TV V = (9/8)1/V 3 + (9/4)1/V 4 so 0 3/8 . The quadratic approximation at T = (1, 1) is Q(p, T ) = T (1, 1) + T (1, 1) (p that T (1, 1) = 3/8 27/8 1, T 1) + [T (1, 1)(p 1, T 1)] (p 1, T 1)/2. ERROR OF APPROXIMATION. It follows from Taylors theorem that the error f (x, y) L(x, y) in a region R near (x0 , y0 ) is smaller or equal to M (|x x0 | + |y y0 |)2 /2, where M is the maximal value of all the matrix entries f (x, y) in that region R. TOTAL DIFFERENTIAL. Aiming to estimate the change f = f (x, y) f (x0 , y0 ) of f for points (x, y) = (x0 , y0 ) + (x, y) near (x0 , y0 ), we can estimate it with the linear approximation which is L(x, y) = fx (x0 , y0 )x + fy y. In an old-fashioned notation, one writes also df = fx dx + fy dy and calls df the total dierential. One can totally avoid the notation of the total dierential. RELATIVE AND ABSOLUTE CHANGE. The relative change f depends on the magnitude of f . One also denes f (x0 , y0 )/f (x0 , y0 ), the relative change of f . A good estimate is L(x0 , y0 )/L(x0 , y0 ).
PHYSICAL LAWS. Many physical laws are in fact linear approximations to more complicated laws. One could say that a large fraction of physics consists of understand nature with linear laws. LINEAR STABILITY ANALYSIS.
MECHANICS For small amplitudes, the pendulum motion x = g sin(x) can be approximated by x = gx, the harmonic oscillator. Nonlinear (partial) dierential equations like uxx + uyy + uzz = F (x, y, z) are often approximated by linear dierential equations. CARTOGRAPHY.
In physics, complicated situations can occur. Usually, many unknown parameters are present and the only way to analyze the situation theoretically is to assume that things depend linearly on these parameters. The analysis of the linear situation allows then to predict for example the stability of the system with respect to perturbations. Sometimes, the stability of the linearized system will imply the stability of the perturbation. ERROR ANALYSIS. Error analysis is based on linear approximation. Assume, you make a measurement of a function f (a, b, c), where a, b, c are parameters. Assume, you know the numbers a, b, c up to accuracy . How precise do you know the values f (a, b, c)? Because f (a0 + a , b0 + b , c0 + c ) is about f (a0 , b0 , c0 ) + f (a0 , b0 , c0 ) ( a , b , c ), the answer is that we know F up to accuracy | f (a0 , b0 , c0 )| . POWER LAWS. Some laws in physics are given by functions of the form g(x, y) = x y . An example is the Cobb-Douglas formula in economics. Such dependence on x or y is called power law behavior. If we consider f = log(g), and introduce a = log(x), b = log(y), then this becomes f (a, b) = log(g(x, y)) = a + b. Power laws become linear laws in a logarithmic scale. But they usually are linear approximations to more complicated nonlinear relations. ELECTRONICS. If we apply a voltage dierence U at the ends of a resistor R, then a current I ows. The relation U = RI is called Ohms law. In logarithmic coordinates log(U ) = log(R) + log(I), this is a linear law. In reality, the relation between current, voltage and resistance is more complicated. For example, if the resistor heats up, then its characteristics begin to change. Nonlinear resistors are used for example in synthesizers or in radars. While Ohms law works extremely well, the nonlinear behavior can have important consequences for example to stabilize systems or to protect equipment against over-voltages. THERMODYNAMICS. If l(T ) is the length of an object with temperature T , then l(T ) = l(T0 ) + c(T T0 ), where the expansion coecient c depends on the material. (Trick question: What happens if you heat a ring, does the inner ring become smaller or bigger?). The volume of a hot air balloon and therefore its lift capacity grows like c(T T 0 )3 . The law of expansion is only an approximation. OCEANOGRAPHY. For oceanographers, it is important to know the water density (T, S) in dependence on the temperature T (Kelvin) and the salinity S (psu). If we would include the pressure P (Bar), then we had a function (T, S, P ) of three variables. Near a specic point (T, S, P ) the density can be approximated by a linear function giving a law which is precise enough. ENGENEERING. Hooks law tells that the force of a spring is proportional to the length with which it is pulled: F (l) = c(l l 0 ), where l0 is the length when the spring is relaxed. This allows to measure weights or to cushion shocks. However, this law is only good in a certain range. If the spring is pulled too strongly, then more force is needed. Such a nonlinear behavior is needed for example in shock absorbers.
It was well known already to the Greeks that we live on a sphere. On a sphere a triangle however the sum of its angles adds up to more than 180 degrees and every straight line (great circles) crosses every other line at least twice. Despite this, a city map can perfectly assume that the coordinate system is Cartesian. When drawing a plan of a house, an architect can assume that the house stands on a plane (the level curve of the linearization G(x, y) of F (x, y) dening the surface of the earth.) RELATIVITY Newtons law tells that r (t), the acceleration of a particle is proportional to the force F which acts on the mass point: r (t) = F/m. For a constant force and zero initial velocity this implies r (t) = tF/m. This law can not apply for all times, because we can not reach the speed of light with a massive body. In special relativity, the Newton axiom is replaced with d/dt(r (t)m(t)) = F , where the mass m(t) depends on the velocity. This 1 gives v(t) = (tF/m0 ) . Linearization at t = 0 produces the classical law v(t) = tF/m0 . 2 2 2 2
1+F t /(c m0 )
ECONOMICS. The mathematician Charles W. Cobb and the economist Paul H. Douglas found in 1928 empirically a formula F (L, K) = bL K giving the total production F of an economic system as a function of the amount of labor L and the capital investment K. This is a linear law in logarithmic coordinates. The formula actually had been found by linear t of empirical data. In general, the production depends in a more complicated way on labor and capital investment. For example, with increase of labor and investment, logistic constraints will become relevant. CHEMISTRY. The ideal gas law P V = RT relates the pressure, the volume and the temperature of an ideal gas using a constant R called the Avogadro number. This law T = f (P, V ) is linear in logarithmic scales. This law is only an approximation and has to be replaced by the van der Waals law, which takes into account the molecular interactions as well as the volume of the molecules.
Math 21a
Ask questions: Review the online quizzes. Ask a question and youre a fool for Make list of facts on a sheet of paper. three minutes; do not ask a question Fresh up short-term memory before test. and youre a fool for the rest of your Review homework. Find error patterns. life. - Chinese Proverb During the exam: read the questions carefully. Wrong understanding could lead you to solve an other problem: There was a college student trying to earn some pocket money by going from house to house oering to do odd jobs. He explained this to a man who answered one door. How much will you charge to paint my porch? asked the man. Forty dollars. Fine said the man, and gave the student the paint and brushes. Three hours later the paint-splattered lad knocked on the door again. All done!, he says, and collects his money. By the way, the student says, Thats not a Porsche, its a Ferrari. MIDTERM TOPICS. Properties of dot, cross and triple product Orthogonality, parallel, vector projection Parametrized Lines and Planes Given line and plane, nd intersection Given plane and plane, nd intersection Given line and point, nd plane Given two points, nd line Given three points, nd plane Distances: point-line, line-line,point-plane Distinguish and analyse curves Determine curves from acceleration Know Keplers laws, polar form of ellipse Recognize functions f (x, y) of two variables. Tangent lines, tangent curves Distance between two lines Distance between two planes Angle between two vectors Angle between two planes Area of parallelogram, triangle in space Volume of parallelepiped Distinguish contour maps, graphs Compute velocity, acceleration, speed Integrate from velocity to get position Find length of curves Level curves, level surfaces Directional derivative Chain rule Implicit dierentiation Tangent planes A nonzero vector v and a point P = (x0 , y0 , z0 ) dene a line r(t) = P + tv. Two nonzero, non-parallel vectors v, w and a point P dene a plane P + tv + ss. The vector n = v w = (a, b, c) is orthogonal to the plane. Points on the line satisfy the symmetric equation xx0 = yy0 = zz0 . Points on the a b c plane satisfy an equation ax + by + cz = d, where d = ax0 + by0 + cz0 . Using the dot product for projection and the vector product to get orthogonal vectors, one can solve many geometric problems in 3D. CROSS PRODUCT (is vector) v w = w v |v w| = |v||w| sin() (av) w = a(v w) (u + v) w = u w + v w Cross[{1, 2, 3}, {3, 4, 5}] d d d dt (v w) = ( dt v) w + v ( dt w)
Is a vector parallel to w.
Applications: Distance P +tv, Q+sw is scalar projection of P Q onto v w. Distance P, Q+tv+sw is scalar projection of P Q onto n = v w.
SURFACES {f (x, y, z) = c}. Examples are graphs, where f (x, y, z) = z g(x, y) = 0 or planes, where f (x, y, z) = ax + by + cz = c. Surfaces can be analyzed by looking at intersections with planes parallel to the coordinate planes. For graphs, the traces f (x, y) = c are contour lines. Most important fact: The gradient f (x0 , y0 , z0 ) is normal to the surface f (x, y, z) = c containing (x0 , y0 , z0 ).
one sheeted hyperboloid x2 + y 2 z 2 = 1 two sheeted hyperboloid x2 + y 2 z 2 = 1 paraboloid x2 + y 2 z = 0 hyperbolic paraboloid x2 y 2 z = 0 graph of function g(x, y) z = 0
can be identied using traces, the intersections with planes. CURVES. r(t) = (x(t), y(t), z(t)), t [a, b] denes a curve. By dierentiation, we obtain the velocity r (t) and acceleration r (t). If we integrate the speed |r (t)| over the interval [a, b], we obtain the length of the curve.
b a
Example: r(t) = (1, 3t2 , t3 ), r (t) = (0, 6t, 3t2), so that |r (t)| = 3t(4 + t2 ). The length of the curve between 0 4 1 and 1 is 0 3t(4 + t2 ) dt = 6t2 + 3 t4 |1 = 6 3 . 0 4 DIRECTIONAL DERIVATIVE. For any vector v and a function f (x, y), dene Dv f (x, y) = f (x, y) v. Unlike in many textbooks:
VECTORS. Two points P = (1, 2, 3), Q = (3, 4, 6) dene a vector v = P Q = 2, 2, 3 . If v = w, then the vectors are parallel if v w = 0, then the vectors are called orthogonal. For example, (1, 2, 3) is parallel to (2, 4, 6) and orthogonal to (3, 2, 1). The addition, subtraction and scalar multiplication of vectors is done componentwise. For example: (3, 2, 1) 2((1, 1, 1) + (1, 1, 0)) = (3, 2, 1). DOT PRODUCT (is scalar) vw =wv |v w| = |v||w| cos() (av) w = a(v w) (u + v) w == u w + v w {1, 2, 3}.{3, 4, 5} d d d dt (v w) = ( dt v) w + (v dt w)
CHAIN RULE. We have seen that d/dtf (r(t)) = f (r(t)) r (t). This works also, if r(t, s) is a function of two variables: ft (x(t, s), y(t, s)) = f (r(t, s)) rt (t, s). fs (x(t, s), y(t, s)) = f (r(t, s)) rs (t, s). Other variables: w(u, v) function of u, v, where u, v are functions of x and eventually of y:
w x w u u x w v v x w x w u u x w v v x
The gradient
f (x, y).
The velocity vector r (t) and the acceleration vector r (t) of a curve are always perpendicular.
|vw| |v|2 v.
The length of a curve does not depend on the parameterization chosen for the curve.
The directional derivative of f (x, y, z) = x2 + y 2 z 2 into the direction (1, 1, 1) at the point (0, 0, 1) is 2/ 3.
For any two vectors v, w one has ||v + w||2 = ||v||2 + ||w||2 .
For any two vectors v and w one has v w = w v. If |v w| = 0 for all vectors w, then v = 0. ijk =0 Every vector contained in the line r(t) = 1 + 2t, 1 + 3t, 1 + 4t is parallel to the vector (1, 1, 1). If your thumb u, your pointing nger v and middle nger w are perpendicular to each other, and u v points in the direction opposite to w, then the three ngers belong to the left hand.
If the velocity vector r (t) of the planar curve r(t) is orthogonal to the vector r(t) for all times t, then the curve is a circle.
If r(t) = Q + tv is a line and P is a point such that P Q is perpendicular to v, then the distance from P to the line is equal to the distance from P to the line. The vectors i + j and k are orthogonal. The distance of the two planes x + y + z = 3 and x + y + z = 5 is 2/ 3. If the velocity vector of the curve r(t) is never zero and always parallel to a constant vector v for all times t, then the curve is a straight line. A level curve of a function f (x, y) is a curve which has no self intersections. If u + v and u v are orthogonal, then the vectors u and v have the same length.
The angle between two planes is equal to the angle between its normal vectors.
The identity |v w|2 + |v w|2 = |v|2 |w|2 holds for all vectors v, w.
The set of points which have distance 1 from a line form a cylinder.
If the acceleration vector of a curve r(t) is parallel to r(t) for all times, then the curve must lie in a plane.
b (x a
Math21a, O. Knill
f (x, y) = (x2 1, y 2 + 1). It is the zero vector 2x 0 . at the 4 critical points (1, 1),(1, 1),(1, 1) and (1, 1). The Hessian matrix is H = f (x, y) = 0 2y H(1, 1) = 2 0 0 2 H(1, 1) = 2 0 0 2 H(1, 1) = 2 0 0 2 H(1, 1) = D = 4 Saddle point 2 0 0 2
CRITICAL POINTS. A point (x0 , y0 ) in a region G is called a critical point of f (x, y) if f (x0 , y0 ) = (0, 0). Remarks. Critical points are also called stationary points. Critical points are candidates for extrema because at critical points, the directional derivative is zero. It is usually assumed that f is dierentiable. EXAMPLE 1. f (x, y) = x4 + y 4 4xy + 2. The gradient is f (x, y) = (4(x3 y), 4(y 3 x)) with critical points (0, 0), (1, 1), (1, 1). EXAMPLE 2. f (x, y) = sin(x2 + y) + y. The gradient is f (x, y) = (2x cos(x2 + y), cos(x2 + y) + 1). For a critical points, we must have x = 0 and cos(y) + 1 = 0 which means + k2. The critical points are at (0, ), (0, 3), .... 2 2 EXAMPLE 3. (volcano) f (x, y) = (x2 + y 2 )ex y . The gradient F = (2x 2x(x2 + y 2 ), 2y 2y(x2 + 2 x2 y 2 2 2 vanishes at (0, 0) and on the circle x + y = 1. There are many critical points. y ))e EXAMPLE 4 (pendulum) f (x, y) = g cos(x) + y 2 /2 is the energy of the pendulum. The gradient F = (y, g sin(x)) is (0, 0) for x = 0, , 2, ..., y = 0. These points are equilibrium points, where the pendulum is at rest. EXAMPLE 5 (Volterra Lodka) f (x, y) = a log(y) by + c log(x) dx. (This function is left invariant by the ow of the Volterra Lodka dierential equation x = ax bxy, y = cy + dxy which you might have seen in Math1b.) The point (c/d, a/b) is a critical point. TYPICAL EXAMPLES.
D = 4 Saddle point
GLOBAL MAXIMA AND MINIMA. To determine the maximum or minimum of f (x, y) on a domain, determine all critical points in the interior the domain, and compare their values with maxima or minima at the boundary.
(A point is in the interior of G, if there is a small disc around (x0 , y0 ) contained in G. A point is at the boundary of G, if any disc aound (x0 , y0 ) contains both points in G and in the complement).
EXAMPLE 5. Find the critical points of f (x, y) = 2x2 x3 y 2 . With f (x, y) = 4x 3x2 , 2y), the critical 4 6x 0 . At (0, 0), the discriminant is 8 so 0 2 that this is a saddle point. At (4/3, 0), the discriminant is 8 and H11 = 4/3, so that (4/3, 0) is a local maximum. WHY DO WE CARE ABOUT CRITICAL POINTS? Critical points are candidates for extrema like maxima or minima. Knowing all the critical points and their nature tells alot about the function. Critical points are physically relevant. Examples are congurations with lowest energy).
f (x, y) = x2 + y 2
f (x, y) = x2 y 2
f (x, y) = x2 y 2
EXAMPLES WITH DISCRIMINANT D = det(H) = 0. A CURIOUS OBSERVATION: (The island theorem) Let f (x, y) be the height on an island. Assume there are only nitely many critical points on the island and all of them have nonzero determinant. Label each critical point with a +1 charge if it is a maximum or minium, and with 1 charge if it is a saddle point. Sum up all the charges and you will get 1, independent of the function. This property is an example of an index theorem, a prototype for important theorems in physics and mathematics.
f (x, y) = x2
f (x, y) = x2
f (x, y) = x4 + y 4
CLASSIFICATION OF CRITICAL POINTS IN 1 DIMENSION. f (x) = 0, f (x) > 0, local minimum, f (x) < 0 local maximum, f = 0 undetermined.
1 0.8 0.6 0.4 0.2 -1 -0.5 -0.2 -0.4 -0.6 -0.8 -1 -1 -0.5 -0.25 -0.5 -0.75 -1 -0.5 0.5 1 -1 0.5 1 1 0.75 0.5 0.25 0.5 1 -1 -0.5 -0.25 -0.5 -0.75 -1 1 0.75 0.5 0.25 0.5 1 -1 -0.5 -0.25 -0.5 -0.75 -1 1 0.75 0.5 0.25 0.5 1
CLASSIFICATION OF CRITICAL POINTS: SECOND DERIVATIVE TEST. Let f (x, y) be a function of 2 two variables with a critical point (x0 , y0 ). Dene D = fxx fyy fxy , called the discriminant or Hessian. fxx fxy we can write D = det(H) as a determinant. (Remark: With the Hessian matrix H = fyx fyy If D > 0 and H11 > 0 local minimum (bottom of valley) If D > 0 and H11 < 0 local maximum (top of mountain). If D < 0 saddle point (mountain pass). In the case D = 0, we would need higher derivatives to determine the nature of the the critical point.
CRITICAL POINTS IN PHYSICS. (informal) Most physical laws are based on the principle that the equations are critical points of a functional (in general in innite dimensions). Newton equations. (Classical mechanics) A particle of mass m moving in a eld V along a path : t r(t) b extremizes the integral S() = a mr (t)2 /2 V (r(t)) dt. Critical points satisfy the Newton equations mr (t)/2 V (r(t)) = 0. Maxwell equations. (Electromagnetism) The electromagnetic eld (E, B) extremizes the Integral S(E, B) = 1 2 2 8 (E B ) dV over space time. Critical points are described by the the Maxwell equations in vacuum. Einstein equations (General relativity) If g is a dot product which depends on space and time, and R is the curvature of the corresponding curved space time, then S(g) = R dV (g) is a function of g for which critical points g satisfy the Einstein equations in general relativity. OTHER WAYS TO FIND CRITICAL POINTS. Some ideas: walk in the direction of the gradient until you reach a local maximum or walk backwards to reach a local minima. To nd saddle points, consider the shortest path connecting two local minima and take the maximum along this path.
3/15/2004 ICE: COBB-DOUGLAS FORMULA The Mathematician Charles W. Cobb and the economist Paul H. Douglas (picture) found in 1928 empirically a formula F (L, K) = bL K which gives the total production F of an economic system as a function of the amount of labor L and the capital investment K. By tting data, they got b = 1.01, = 0.75, = 0.25. By rescaling the production unit we can get b = 1 and work with the formula: F (L, K) = L3/4 K 1/4 Assume that the labor and capital investment are bound by the constraint G(L, K) = L3/4 + K 1/4 = 1. Where is the production P maximal under this constraint? F (L, K) =
Math 21a
0.5
G(L, K) =
0.4
0.3
0.2
Solve:
0.1
Math21a, O. Knill
THE PRINCIPLE OF MINIMAL FREE ENERGY. Assume that the probability that a system is in a state i is pi and that the energy of the state i is Ei . By a fundamental principle, nature tries to minimize the free energy f (p1 , ..., pn ) = i (pi log(pi ) Ei pi when the energies Ei are xed. The free energy is the dierence of the entropy S(p) = i pi log(pi ) and the energy E(p) = i Ei pi . The probability distribution pi satisfying i pi = 1 minimizing the free energy is called the Gibbs distribution. SOLUTION: f = (1 log(p1 ) E1 , . . . , 1 log(pn ) En ), g = (1, . . . , 1). The Lagrange equation are log(pi ) = 1 Ei , or pi = exp(Ei )C, where C = exp(1 ). The additional equation p1 + + pn = 1 gives C( i exp(Ei )) = 1 so that C = 1/( i eEi ). The Gibbs solution is pi = exp(Ei )/ i exp(Ei ). For example, if Ei = E, then the Gibbs distribution is the uniform distribution pi = 1/n. MOST ECONOMIC ALUMINUM CAN. You manufacture cylindrical soda cans of height h and radius r. You want for a xed volume V (r, h) = hr 2 = 1 a minimal surface area A(r, h) = 2rh + 2r 2 . With x = h, y = r, you need to optimize f (x, y) = 2xy + 2y 2 under the constrained g(x, y) = xy 2 = 1. Calculate f (x, y) = (2y, 2x + 4y), g(x, y) = (y 2 , 2xy). The task is to solve 2y = y 2 , 2x + 4y = 2xy, xy 2 = 1. The rst equation gives y = 2. Putting that in the second one gives 2x + 4y = 4x or 2y = x. The third equation nally reveals 2y 3 = 1 or y = 1/(2)1/3 , x = 2(2)1/3 . This means h = 0.54.., r = 2h = 1.08 REMARK. Other factors can inuence the shape also. For example, the can has to withstand pressure forces up to 100 psi. WHERE DO CONSTRAINED EXTREMAL PROBLEMS OCCUR. (informal)
EXAMPLE. To nd the shortest distance from the origin to the curve x6 + 3y 2 = 1, we extremize f (x, y) = x2 + y 2 under the constraint g(x, y) = x6 + 3y 2 1 = 0. SOLUTION. f = (2x, 2y), g = (6x5 , 6y). f = g gives the system 2x = 6x5 , 2y = 6y, x6 + 3y 2 1 = 0. 5 = 1/3, x = x , so that either x = 0 or 1 or 1. From the constraint equation, we obtain y = (1 x6 )/3. So, we have the solutions (0, 1/3) and (1, 0), (1, 0). To see which is the minimum, just evaluate f on each of the points. We see that (0, 1/3) are the minima.
Constraints occur at boundaries. If we want to maximize a function over a region, we have also to look at the extrema at the boundary, where the gradient not necessarily vanishes. In physics, we often have conserved quantities (like for example energy, or momentum, or angular momentum), constraints occur naturally. In economical contexts, one often wants to optimize things under constraints. In mechanics constraints occur naturally (i.e. for robot arms). Constrained optimization is important in statistical mechanics, where equilibria have to be obtained under constraints (i.e. constant energy). Probability distributions are solutions of constrained problems. For example, the Gaussian distribution (normal distribution) is the distribution on the line with maximal entropy. Eigenvalue problems in linear algebra can be interpreted as constrained problems. Maximizing u Lu under the condition |u|2 = 1 gives the equation Lu = u and u has to be an eigenvector. The Lagrange multiplier is an eigenvalue.
HIGHER DIMENSIONS. The above constrained extrema problem works also in more dimensions. For example, if f (x, y, z) is a function of three variables and g(x, y, z) = c is a surface, we solve the system of 4 equations f (x, y, z) = g(x, y, z), g(x, y) = c to the 4 unknowns (x, y, z, ). In n dimensions, we have n + 1 equations and n + 1 unknowns (x 1 , . . . , xn , ). EXAMPLE. Extrema of f (x, y, z) = z on the sphere g(x, y, z) = x2 + y 2 + z 2 = 1 are obtained by calculating the gradients f (x, y, z) = (0, 0, 1), g(x, y, z) = (2x, 2y, 2z) and solving (0, 0, 1) = f = g = (2x, 2y, 2z), x2 + y 2 + z 2 = 1. = 0 is excluded by the third equation 1 = 2z so that the rst two equations 2x = 0, 2y = 0 give x = 0, y = 0. The 4th equation gives z = 1 or z = 1. The extrema are the north pole (0, 0, 1) (maximum) and the south pole (0, 0, 1) (minimum). THE PRINCIPLE OF MAXIMAL ENTROPY. Consider a dice showing i with probability p i , where i = 1, ..., 6. The entropy of the probability distribution is dened as S(p) = 6 pi log(pi ). Find the distribution p i=1 6 which maximizes entropy under the constrained g(p) = i=1 pi = 1. SOLUTION: f = (1 log(p1 ), . . . , 1 log(pn )), g = (1, . . . , 1). The Lagrange equations are 1 log(pi ) = , p1 + ... + p6 = 1, from which we get pi = e(+1) . The last equation 1 = i exp(( + 1)) = 6 exp(( + 1)) xes = log(1/6) 1 so that pi = 1/6. The distribution, where each event has the same probability is the distribution of maximal entropy. REMARK. Maximal entropy means least information content. A dice which is xed (asymmetric weight distribution for example) allows a cheating gambler to gain prot. Cheating through asymmetric weight distributions can be avoided by making the dices transparent. DID WE GET ALL EXTREMA? The Lagrange equations f (x, y) = g(x, y), g(x, y) = c do not give all the extrema. We can also have g(x, y) = (0, 0). The parallelity condition also could have been written as f (x, y) = g(x, y), f (x, y) = x2 + (y 1)2 , g(x, y) = x2 y 3 . The function f has a local maximum 1 at (0, 0) under the constraint g(x, y) = 0 but the Lagrange equations do not nd it. The problem is that the gradient of g vanishes. g is technically parallel to f but there is no such that f = g at this point. The reason for this mistake (which is present in virtually all calculus text books), is that parallelity of the two gradient is not equivalent to f = g but can also mean f = g with = 0.
CAN WE AVOID LAGRANGE? We could extremize f (x, y) under the constraint g(x, y) = 0 by nding y = y(x) from the later and extremizing the 1D problem f (x, y(x)). EXAMPLE 1. To extremize f (x, y) = x2 + y 2 with constraint g(x, y) = x4 + 3y 2 1 = 0, solve y 2 = (1 x4 )/3 and minimize h(x) = f (x, y(x)) = x2 + (1 x4 )/3. h (x) = 0 gives x = 0. The nd the maximum (1, 0), we had to maximize h(x) on [1, 1], which occurs at 1. Sometimes, the Lagrange method can be avoided. EXAMPLE 2. Extremize f (x, y) = x2 + y 2 under the constraint g(x, y) = p(x) + p(y) = 1, where p is a complicated function in x which satises p(0) = 0, p (1) = 2 The Lagrange equations 2x = p (x), 2y = p (y), p(x) + p(y) = 1 can be solved: with x = 0, y = 1, = 1, however, we can not solve g(x, y) = 1 for y. Substitution fails: In general, the Lagrange method is more powerful.
Math21a, O. Knill
MAXIMAL AREA OF RECTANGLE. We want to extremize the area of a rectangle for which the length of the boundary is xed 4. If the sides are x and y, then we want to extremize f (x, y) = xy under the constraint g(x, y) = 2x + 2y = 4. The Lagrange equations y = 2, x = 2 show that x = y and so x = y = 1.
EXAMPLE. Extremize f (x, y) = 3x2 4xy 2 on the disc x2 +y 2 1. I) Inside the disc. There is only one critical point (2/3, 0). The discriminant D is 6 so that (2/3, 0) is a saddle point. II) On the boundary solve 6x 4 = 2x, 2y = 2y. There are four solutions: (1/2, 3/2), (1/2, + 3/2), (1, 0), (1, 0). III) A list of all candidates: (x, y) (2/3, 0) (1/2, 3/2) (1/2, 3/2) (1, 0) (1, 0) f(x,y) -4/3 -2 -2 -1 7
The last problem could also been solved by substituting y = 2 x into the area formula A = xy = x(2 x) leading to a one-dimensional extremal problem: maximize f (x) = x(2 x) on the interval [0, 2]. To do so, we have to nd the extrema inside the interval and then consider also the boundary points x = 0, x = 2. Again, we get x = 1.
reveals that (1, 0) is the maximum and (1/2, 3/2) are minima. IN MATHEMATICA. Here is how a machine solves the above problem. After dening the functions f and g, the machine solves rst the equations leading to critical points, and then the Lagrange equations (we put L = ). f [x , y ] := 3x2 4x y 2 g[x , y ] := x2 + y 2 1 Solve[{D[f [x, y], x] == 0, D[f [x, y], y] == 0}, {x, y}] Solve[{D[f [x, y], x] == L D[g[x, y], x], D[f [x, y], y] == L D[g[x, y], y], g[x, y] == 0}, {x, y, L}] TRICKY LAGRANGE PROBLEM. Let p and q be positive constants such that 1 + 1 = 1. Use the method of p q Lagrange Multipliers to prove that for any x > 0, y > 0, the following inequality is true: xy xp yq + . p q
0.5
1.5
VOLUME OF CUBE. Extremize the volume f (x, y, z) = xyz of a box with xed surface area xy + yz + xz = 3. To solve yz = (y + z), xz = (x + z), xy = (x + y), xy + yz + xz = 1, take quotients: z/x = (y + z)/(y + x), z/y = (z + x)/(y + x) which gives z(y + x) = x(y + z), z(y + x) = y(z + x) so that either xz = yz or z = 0. Similarly, we get y = z or y = 0. The solution is x = y = z = 1. AN OTHER SOLUTION. For a solution without Lagrange multipliers, we would plug in z = (1 xy)/(y + x) and try to nd the maximum of f (x, y) = xy(1 xy)/(y + x) on the domain D = {x > 0, y > 0, xy 1 }. We rst would have to nd critical points inside the region D: fx (x, y) = y(1 2xy)/(x + y) xy(1 xy)/(x + y)2 = 0 fy (x, y) = x(1 2xy)/(x + y) xy(1 xy)/(x + y) = 0 The dierence of these two equations gives (x y)(1 2xy) = 0 so that either x = y or xy = 1/2. The second case can not give us fx = fy = 0. The rst condition x = y gives x = y = 1 which is not inside the region. However, on the boundary g(x, y) = xy = 1, the Lagrange equations f = g have a solution with (x, y) = (1, 1). The example illustrates the power of Lagrange multipliers. The substitution method is more complicated.
2
SOLUTION. q p We have to nd the maximum of f (x, y) = xy (x > 0, y > 0) under the constraint x + yq = c.) p p1 q1 p1 q1 q p , y = y gives y/x = x /y so that y = x . The Lagrange equations x = x Plugging this into xp /q + y q = c gives xp (1/p + 1/q) = c or x = c1/p and so y = c1/q . The maximal value of 1/p 1/q 1 = c = c. Therefore, everywhere f (x, y) = xy is c c xy = f (x, y) c = xp /p + y q /q . SNELLS LAW of refraction is the problem to determine the fastest path between two points, if the path crosses a border of two media and the media have dierent indices of refraction. The law can be derived from Lagrange: PROBLEM. A light ray travels from A = (1, 1) to the point B = (1, 1) crossing a boundary between two media (air and water). In the air (y > 0) the speed of the ray is v1 = 1 (in units of speed of light). In the second medium (y < 0) the speed of light is v2 = 0.9. The light ray travels on a straight line from A to a point P = (x, 0) on the boundary and on a straight line from P to B. Verify Snells law of refraction sin(1 )/ sin(2 ) = v1 /v2 , where 1 is the angle the ray makes in air with the y axis and where 2 is the angle, the ray makes in water with the y axis. SOLUTION. Minimize f (x, y) = (1 x)2 + y 2 /v1 + (1 x)2 + y 2 /v2 = l1 /v1 + l2 /v2 under the constraint G(x, y) = y = 0. The Lagrange equations show that fx (x, y) = 0. This is already Snells law because fx = v1 2(x+1)/(2l1)+v2 2(1x)/(2l2 ) = 0 means v1 /v2 = sin(1 )/ sin(2 ). If v1 is larger, then 1 is larger.
(-1,1)
TWO CONSTRAINTS. (informal) The calculation with Lagrange multipliers can be generalized: if the goal is to optimize a function f (x, y, z) under the constraints g(x, y, z) = c, h(x, y, z) = d, take the Lagrange equations f = g + h, g = c, h = d which are 5 equations for the 5 unknowns (x, y, z, , ). Geometrically the gradient of f is in the plane spanned by the gradients of g and h. (This is the plane orthogonal to the curve {g = c, h = d}.) GENERAL PROBLEM. Given a region G whose boundary is given by g(x, y) = c. The task to maximize or minimize f (x, y) on G has the following steps: I) Find extrema inside the region: compute critical points f = (0, 0) and classify them using the second derivative test. II) Find extrema on the boundary using Lagrange: f = g, g = c. III) Compare the values of the functions obtained in I) and II) to nd the maximum or minimum.
v1
1 (x,y)
v2
(1,-1)
Math21a, O. Knill
b d a c
f (x, y) dxdy =
d b c a
f (y, x) dydx.
1D INTEGRATION IN 100 WORDS. If f (x) is a continuous function then f (x) dx can be dened as a 1 limit of the Riemann sum fn (x) = n xk [a,b] f (xk ) for n with xk = k/n. This integral divided by |b a| is the average of f on [a, b]. The integral can be interpreted as an signed area under the graph x of f . If f (x) = 1, the integral is the length of the interval. The function F (x) = a f (y) dy is called an anti-derivative of f . The fundamental theorem of calculus states F (x) = f (x). Unlike the derivative, 2 x anti-derivatives can not always be expressed in terms of known functions. An example is: F (x) = 0 et dt. Often, the anti-derivative can be found: Example: f (x) = cos2 (x) = (cos(2x) + 1)/2, F (x) = x/2 sin(2x)/4.
b a
EXAMPLE. Let R be the triangle 1 x 0, 1 y 0, y x. Calculate 2 ex dxdy. R 2 2 1 1 ATTEMPT. 0 [ y ex dx]dy. We can not solve the inner integral because ex has no anti-derivative in terms of elementary functions. IDEA. Switch order: 0 [ 0 ex dy] dx = 0 xex dx = e 2 |1 = (1e 0 2 0.316.... A special case of switching the order of integration is Fubinis theorem.
2 2
x2
If you cant solve a double integral, try to change the order of integration!
F(x) F(x+dx)-F(x)
QUANTUM MECHANICS. In quantum mechanics, the motion of a particle (like an electron) in the plane is determined by a function u(x, y), the wave function. Unlike in classical mechanics, the position of a particle is given in a probabilistic way only. If R is a region and u is normalized so that |u|2 dxdy = 1, then 2 R |u(x, y)| dxdy is the probability, that the particle is in R. EXAMPLE. Unlike a classical particle, a quantum particle in a box [0, ] [0, ] can have a discrete set of energies only. This is the reason for the name quantum. If (uxx + uyy ) = u, then a particle of mass m has the energy E = 2 /2m. A function u(x, y) = sin(kx) sin(ny) represents a particle of energy (k 2 + n2 ) 2 /(2m). h h Let us assume k = 2 and n = 3 from now on. Our aim is to nd the probability that the particle with energy 2 13 /(2m) is in the middle 9th R = [/3, 2/3] [/3, 2/3] of the box. h SOLUTION: We rst have to normalize u2 (x, y) = sin2 (2x) sin2 (3y), so that the average over the whole square is 1:
0
AVERAGES=MEAN. www.worldclimate.com gives the following data for the average monthly rainfall (in mm) for Cambridge, MA, USA (42.38 North 71.11 West,18m Height).
Jan 93.9 Feb 88.6 Mar 83.3 Apr 67.0 May 42.9 Jun 26.4 Jul 27.9 Aug 83.8 Sep 35.5 Oct 61.4 Nov 166.8 Dec 82.8
A=
0
2D INTEGRATION. If f (x, y) is a continuous function of two variables on a region R, the integral 1 i,j,xi,j R f (xi , yj ) with xi,j = (i/n, j/n) when n goes to R f (x, y) dxdy can be dened as the limit n2 innity. If f (x, y) = 1, then the integral is the area of the region R. The integral divided by the area of R is the average value of f on R. For many regions, the integral can be calculated as a double b d(x) integral a [ c(x) f (x, y) dy]dx. In general, the region must be split into pieces, then integrated seperately.
To calculate this integral, we rst determine the inner integral sin2 (2x) sin2 (3y) dx = sin2 (3y) 0 sin2 (2x) dx = sin2 (3y) (the fac2 0 tor sin2 (3y) is treated as a constant). Now, A = 0 (/2) sin2 (3y) dy = 2 4 , so that the probability amplitude function is f (x, y) = 2 2 4 2 sin (2x) sin (3y). The probability that the particle is in R is slightly smaller than 1/9: 1 A f (x, y) dxdy
R
2/3 2/3 4 sin2 (2x) sin2 (3y) dxdy 2 /3 /3 4 2/3 2/3 (4x sin(4x))/8|/3 (6x sin(6x))/12|/3 = 2 = 1/9 1/(4 3)
One can interpret f (x, y) dydx as the volume of solid below the graph of f and above R in the x y plane. R (As in 1D integration, the volume of the solid below the x-y plane is counted negatively). EXAMPLE. Calculate
1 2 R
f (x, y) dxdy, where f (x, y) = 4x2 y 3 and where R is the rectangle [0, 1] [0, 2].
1 1 0
WHERE DO DOUBLE INTEGRALS OCCUR? - compute areas. - compute averages. Examples: average rain fall or average population in some area. - probabilities. Expectation of random variables. 2 2 - quantum mechanics: probability of particle being in a region. - nd moment of inertia R (x +y )(x, y)dxdy dxdy. - nd center of mass ( R x(x, y) dxdy/M, R y(x, y) dxdy/M ), with M = R - compute some 1D integrals. TRIPLE INTEGRALS are dened similarly and covered later in detail. 1 dxdydz is a volume. R Fubinis theorem generalizes.
[
0 0
4x2 y 3 dy] dx =
[x2 y 4 |2 ] dx = 0
16 . 3
Math21a, O. Knill
A FLOWER. What is x2 + y 2 dxdy, where R is a ower obtained by roR tating the region enclosed by the curves y = x2 and y = 2x x2 by adding multiples of the angles 2/12? SOLUTION. The moment of inertia of all the petals add up: I = 2 1 2xx2 2 1 (x + y 2 ) dydx = 0 [x2 y + y 3 /3]y=2xx dx = 1243/210 = 86/35. 12 0 x2 y=x2
PROBLEM: BERTRANDS PARADOX (Bertrand 1889) We throw randomly lines onto the disc. What the probability that the is intersection with the disc is larger than the length 3 of the equilateral triangle inscribed in the unit circle? Answer Nr 1: take an arbitrary point P in the disc. The set of lines which pass through that point is parametrized by an angle . In order that the chord is longer than 3, the angle has to fall within an angle of 60 of a total of 180. The probability is 1/3 . Answer Nr 2: consider all lines perpendicular to a xed diameter. The chord is longer than 3, when the point of intersection is located on the middle half of the diameter. The probability is 1/2 .
f dA =
dxdy type II region. R f dA = A general region, we try to cut it into pieces, where each piece is a Type I or Type II region.
Answer Nr. 3: if the midpoint of the intersection with the disc is located in the disc of radius 1/2 with area /4, then the chord is longer than 3. The probability is 1/4 . Rectangle Type I Type II To cut The paradox comes from the choice of the probability density function f (x, y). In each case, there is a distribution function f (x, y) which is radially symmetric. The constant distribution f (x, y) = 1/ is obtained when we throw the center of the line into the disc. The disc Ar of radius r has probability r 2 /. The density in the r direction is 2r. The distribution f (x, y) = 1/r is obtained when throwing parallel lines. This will put more weight to center. The disc Ar of radius r has probability of Ar is bigger than the area of Ar . The density in the r direction is constant equal to 1. Lets compute the distribution when we rotate the line around a point at the boundary. We hit a disc A r of radius r with probability F (r) = arcsin(r)2/. The density in the radial direction is f (r) = 2/( (1 r2 )) .
AREA A = R 1 dA MASS M = R (x, y) dA AVERAGE R f (x, y) dA/A. CENTROID ( R x dA/A, R y dA/A). CTR MASS ( R x(x, y)dA, R y(x, y)dA)/M . MOMENT OF INERTIA I = R (x2 + y 2 ) dA RADIUS OF GYRATION I/M
VOLUME V = R 1 dV MASS M = R (x, y, z) dV AVERAGE R f (x, y, z) dV /V . CENTROID ( R x dV /V, R y dV /V, R z dV /V ). C.O.M. ( R xdV, R xdV, R ydV )/M . MOMENT OF INERTIA I = R (x2 + y 2 ) dV RADIUS OF GYRATION I/M
r 2 x2 r 2 x2
dydx .
4 1 0.8 0.6 2 0.4 1 0.2
2 r2 x2 dx .
This can be solved with a substitution: x = r sin(u), dx = r cos(u). With the new bounds a = /2, b = /2 and r2 x2 = r2 r2 sin2 (u) = r cos(u) we end up with
/2
COMPARISON OF THE DENSITY FUNCTIONS. A plot of the radial distribution functions f (r) as well as F (r), the probability of Ar shows why we get dierent results for F (1/2).
0.2
0.4
0.6
0.8
0.2
0.4
0.6
0.8
A=
/2
/2 /2
r2 (1 + cos(2u)) du = r 2 .
MOMENT OF INERTIA. Compute the kinetic energy of a square iron plate R = [1, 1][1, 1] of density = 1 (about 10cm thick) rotating around its center with a 6 000rpm (rounds per minute). The angular velocity speed
2 is = 2 6 000/60 = 100 2. Because E = x2 + y 2 , we have E = 2 I/2 , R (r) /2 dxdy, where r = (x2 + y 2 ) dxdy is the moment of inertia. For the square, I = 8/3. Its energy of the plate is where I = R 2 8/6 = 4 2 1002 8/6Joule 0.86KW h. You can run with this energy a 60 Watt bulb for 14 hours.
What happens if we really do an experiment and throw randomly lines onto a disc? The outcome of the experiment will depend on how the experiment will be performed. If we would do the experiment by hand, we would probably try to throw the center of the stick into the middle of the disc. Since we would aim to the center, the distribution would probably be dierent from any of the three solutions discussed above. STATISTICS. If f (x, y) is a probability distribution on R: f (x, y) 0, R f (x, y) dA = 1, then E[X] = X(x, y)f (x, y) dA is called the expectation of X, Var(X) = E[(X E[X])2 ] is called the variance and (X) = (Var[X]) the standard deviation.
Math21a, O. Knill
ROSES. We can now integrate over type I or type II regions in the (, r) plane. {(, r) |0 r f ()} where f () is a periodic function of .
r=d(P,O)
t O=(0,0) x
POLAR CURVES. A general polar curve is written as (r(t), (t)). It can be translated into x, y coordinates: x(t) = r(t) cos((t), y(t) = r(t) sin((t)). POLAR GRAPHS. Curves which are graphs when written in polar coordinates are called polar graphs. EXAMPLE. r() = cos(3) is the which belongs to the class of roses r(t) = cos(nt). EXAMPLE. If y = 2x + 3 is a line, then the equation gives r sin() = 2r cos() + 3. Solving for r(t) gives r() = 3/(sin( 2 cos()). The line is also a polar graph. EXAMPLE. The polar form r() =
a(1 2 ) 1+ cos()
The region S = T (R) in the x y coordinates is neither a type I nor a type II region.
EXAMPLE. Find the area of the region {(, r()) | r() | cos(3)| }.
2 cos(3) 2
y dxdy =
R 0 0
r dr d =
0
cos(3)2 d = /2 2
POLAR COORDINATES. For many regions, it is better to use polar coordinates for integration: EXAMPLE. Integrate f (x, y) = y
R
f (x, y) dxdy =
For example if f (x, y) = x2 + x2 + xy, then g(r, ) = r 2 + r2 cos() sin(). EXAMPLE. We had computed area of the disc {x2 + y 2 1} using substitution. Was quite a mess. It is easier to do that integral in polar coordinates:
2 0 0 1
r sin()r r ddr =
1
r3
0
sin() ddr =
(24 14 ) 4
sin() d = 15/2
0
r drd = 2r 2 /2|1 = . 0
For integration problems, where the region is part of an annulus, or if you see function with terms x2 + y 2 try to use polar coordinates x = r cos(), y = r sin().
WHERE DOES THE FACTOR r COME FROM? A small rectangle R with dimensions ddr in the (r, ) plane is mapped by T : (r, ) (r cos(), r sin()) to a sector segment S in the (x, y) plane. It has approximately the area rddr. It is small for small r.
THE SUPER-CURVE. The Belgian Biologist Johan Gielis came up in 1997 with the family of curves given in polar coordinates as r() = ( | cos( m )|n2 1/n3 | cos( m )|n1 4 4 + ) a b
It is called the super-curve because it can produce a variety of shapes like circles, square, triangle, stars. It can also be used to produce super-shapes (see later). The super-curve generalizes the superellipe which had been discussed in 1818 by Lam and helps to tackle e one of the more intractable problems in biology: describing form. A twist: Gielis has patented his discovery described in Gielis, J. A generic geometric transformation that unies a wide range of natural and abstract shapes. American Journal of Botany, 90, 333 - 338, (2003). To the right you see the Mathematica code.
AN OTHER EXPLANATION (for people who have seen some linear algebra). The map translating from polar coordinates to Cartesian coordinates (x, y) = T (r, ) = (r cos(), r sin()) has as a linear approximation the matrix cos() sin() DT (x, y) = r sin() r cos() which has determinant r. A small rectangle in the (r, )-plane of area dA will have in the (x, y) plane the area rdA.
4/26/2004, 3D INTEGRATION
Math21a, O. Knill
CENTER OF MASS. Compute the center of mass of the same body. (24/32, 96/32, 256/180) = (3/4, 3, 8/5):
2 0 2 0 2 6 0 0 0 0 6 0 2 6 0 6 0 4x2 4x2 2 6 0 2
i j k (xi , yj , zk ) = ( n , n , n ).
3D INTEGRATION. If f (x, y, z) is a function of three variables and R is a region in space, then 1 f (x, y, z) dxdydz is dened as the limit of Riemann sum n3 (xi ,yj ,zk )R f (xi , yj , zk ) for n , where R
x dz dy dx =
0
x(4 x2 ) dydx = 6
6
2 0 2 0
TRIPLE INTEGRALS. As in two dimensions, triple integrals can be evaluated through iterated 1D integrals. EXAMPLE. Assume R is the box [0, 1] [0, 1] [0, 1] and f (x, y, z) = 24x2 y 3 z.
1 0 1 0 1 0 1 0
y dz dy dx =
0 0 4x2
y(4 x2 ) dydx =
2 0
z dz dy dx =
0 0
(4 x2 )2 /2 dydx = 6
24x2 y 3 z dx
dy
dz .
SOME HISTORY OF COMPUTING VOLUMES. How did people come up calculating the volume R 1 dxdydz of a body? Archimedes ((-287)-(-212): Archimedess method of integration allowed him to nd areas, volumes and surface areas in many cases. His method of exhaustion paths the numerical method of integration by Riemann sum. The Archimedes principle states that any body submerged in a water is acted upon by an upward force which is equal to the weight of the displaced water. This provides a practical way to compute volumes of complicated bodies. Cavalieri (1598-1647): Cavalieri could determine area and volume using tricks like the Cavalieri principle. Example: to get the volume the half sphere of radius R, cut away a cone of height and radius R from a cylinder of height R and radius R. At height z, this body has a cross section with area R2 r2 . If we cut the half sphere at height z, we obtain a disc of area (R2 r2 ). Because these areas are the same, the volume of the half-sphere is the same as the cylinder minus the cone: R3 R3 /3 = 2R3 /3 and the volume of the sphere is 4R3 /3. Newton (1643-1727) and Leibniz( 1646-1716): Newton and Leibniz, developed calculus independently. The new tool made it possible to compute integrals through anti-derivation. Suddenly, it became possible to nd integrals using analytic tools. MONTE CARLO COMPUTATIONS. Here is an other way to compute integrals: Suppose we want to calculate the volume of some body R inside the unit cube [0, 1] [0, 1] [0, 1]. The Monte Carlo method is to shoot randomly n times onto the unit cube and count the fraction of times, we hit the solid. Here is an experiment with Mathematica and where the body is one eights of the unit ball: R := Random[]; k = 0; Do[x = R; y = R; z = R; If[x2 + y2 + z2 < 1, k + +], {10000}]; k/10000 Assume, we hit 5277 of n=10000 times. The volume so measured is 0.5277. The actual volume of 1/8th of the sphere is /6 = 0.524. For n the Monte Carlo computation gives the actual volume. WHERE CAN TRIPLE INTEGRALS OCCUR?
24x2 y 3 z dz
1 0
3x dx =1.
WHAT DID WE DO? When we calculate the most inner integral, we x z and y. The integral is the average of f (x, y, z) along a line intersected with the body. After completing the second integral, we have computed the average on the plane z = const intersected with R. The most outer integral averages all these two dimensional sections. VOLUME UNDER GRAPH. The volume under the graph of a function f (x, y) and above a region R = b d [a, b] [c, d] is the integral a c f (x, y) dxdy. Actually, this is a triple integral:
b d c 0 f (x,y)
V =
a
VOLUME OF THE SPHERE. (We will do this more elegantly later). The volume is 2 2 2
1 1x
V =
R
dxdydz =
1 1
1x2
1x y
dz]dy]dx
1x2 y 2
x2 y 2 )1/2 dy]dx. After computing the inner integral, we have V = 2 1 [ a 2 2 To resolve the next layer, call 1 x = a . The task is to nd a a2 x2 dx. Make the substitution x/a = sin(u), dx = a cos(u) to write this as a We can nish up the last integral
arcsin(a/a) 0 1 1
1x2 (1 1x2
/2 0
V = 2/2
(1 x2 ) dx = 4/3 .
MASS OF A BODY. In general, the mass of a body with density (x, y, z) dV . For bodies with constant density (x, y, z) is R the mass is V , where V is the volume. Compute the mass of a body which is bounded by the parabolic cylinder z = 4 x2 , and the planes x = 0, y = 0, y = 6, z = 0 if the density of the body is 1.
2 0 2 0
6 0
4x2
6 0
dz dy dx =
0
(4 x2 ) dydx
1 dV and masses M =
dV .
= 6
0
(4 x2 ) dx = 6(4x x3 /3|2 = 32 0
r(x, y, z)2 (x, y, z) dV , where r(x, y, z) is the distance to the axis of rotation.
R
x dV /M,
y dV /M,
z dV /M ).
f (r, ) r ddr .
R
2
1/2
rdzdr = 2
1/2
2r
1 r2 dr
r ddr = 2
r2 R | = R2 . 2 0
WHERE DOES THE FACTOR r COME FROM? 1. EXPLANATION. A small rectangle with dimensions ddr in the (r, ) plane is mapped to a sector segment in the (x, y) plane. It has approximately the area rddr. It is small for small r. 2. EXPLANATION. The map (r, ) (r cos(, r sin())(f (r, ), g(r, )) which changes from Cartesian to polar fr f cos() sin() = coordinates has the Jacobean is T = with determinant fr g f gr = r. r sin() r cos() gr g This is a special case of a more general formula which we do not cover in this class.
PROBLEM. Find the volume of the intersection of the three cylinders x2 + y 2 1, x2 + z 2 1 and y 2 + z 2 1. SOLUTION.
/4 1 0
8
/4
1 r2 sin()2 rdrd
which is 16/3 + 8 2.
PROBLEM. Find the volume of the intersection of the two solid cylinders x2 + y 2 1 and x2 + z 2 1. SOLUTION. We compute the volume in one of the 8 octants and multiply by 8 in the end.
1 /2 0
8
0
CYLINDRICAL COORDINATES. Use polar coordinates in the x-y plane and leave the z coordinate. Take T (r, , z) = (r cos(), r sin(), z). The integration factor r is the same as in polar coordinates.
Here is how one would evaluate this integral with Mathematica: 8 Integrate[Sqrt[1 r2 Cos[theta]2 ]r, {r, 0, 1}, {theta, 0, Pi/2}] Note the order in which the integration range in entered the computer algebra system!
f (x, y, z) dxdydz =
T (R) R
g(r, , z) r drddz .
EXAMPLE. Calculate the volume bounded by the parabolic z = 1(x2 +y 2 ) and the xy plane. In cylindrical coordinates, the paraboloid is given by the relation z = 1 r 2 :
1 0 0 2 0 1r 2 1 2 0
r dzddr =
0
USE A GOOD PICTURE! A good conceptual picture not only helps to solve double and triple integral problems. Sometimes, it is even virtually impossible to solve the problem without having a good picture.
volume 2 2 0 (2 2)16/3.
SOLUTION. We split the integral up into a cone part z [ 2, 2], 2 and the cup part |z| > and evaluate each seperatly. The double 2 z cone has the volume 2 2 0 r drdz = 2 2/3. One cup has the
2 4z 2
r drdz =
2 (4 2
Math21a, O. Knill
MOMENT OF INERTIA. The moment of inertia of a body G with respect to an axis L is dened as the triple integral r(x, y, z)2 dzdydx, where r(x, y, z) = R sin() is the G distance from the axes L. For a sphere of radius R we obtain with respect to the z-axis:
R 2 0 0 R 0 5
f (r, ) r ddr .
R
I=
0
Cylindrical coordinates are obtained by taking polar coordinates in the x-y plane and leave the z coordinate. With T (r, , z) = (r cos(), r sin(), z). the integration factor r is the same as in polar coordinates.
1 = ( sin3 () )( 0 3
5
d)
8R VR 4 R 2 = = 3 5 15 5
f (x, y, z) dxdydz =
T (R) R
g(r, , z) r drddz
SPHERICAL COORDINATES. Spherical coordinates use , the distance to the origin as well as two angles: the polar angle and , the angle between the vector and the z axis. The coordinate change is T : (x, y, z) = ( cos() sin(), sin() sin(), cos()) . The integration factor can be seen by measuring the volume of a spherical wedge which is d, sin() d, d = 2 sin()ddd.
If the sphere rotates with angular velocity , then I 2 /2 is the kinetic energy of that sphere. Example: the moment of inertia of the earth is 81037 kgm2 . The angular velocity is = 1/day = 1/(86400s). The rotational energy is 81037 kgm2 /(7464960000s2) 1028 J = 1025 kJ 2.51024kcal. How long would you have to run on a treadmill to accumulate this energy if you could make 2500 kcal/hour? We would have to run 1021 hours = 3.61024 seconds. Note that the universe is about 1017 seconds old. If all the 6 million people in Massachusetts would have run since the big bang on a treadmill, they could have produced the necessary energy to bring the earth to the current rotation. To make classes pass faster, we need to spin the earth more and just to add some more treadmills ... To the right you see a proposal for the science center.
f (x, y, z) dxdydz =
T (R) R
DIAMOND. Find the volume and the center of mass of a diamond, the intersection of the unit sphere with the cone given in cylindrical coordinates as z = 3r.
Solution: V = x=
we
use
spherical
coordinates
to y= z=
nd
the
center
of
mass =0 =
(x, y, z):
2 32V
2 PROBLEM Find R z dV for the solid obtained by intersecting {1 x2 +y 2 +z 2 4} with the double cone {z 2 x2 +y 2 }.
Solution: since the result for the double cone is twice the result for the single cone, we work with the diamond shaped region R in {z > 0} and multiply the result at the end with 2. In spherical coordinates, the solid R is given by 1 2 and 0 /4. With z = cos(), we have
2 1 0 2 0 /4
2 sin() ddd .
The most inner integral 0 2 sin()d = 2 cos()| = 22 . 0 2 The next layer is, because does not appear: 0 22 d = 42 . R The nal integral is 0 42 d = 4R3 /3.
Math21a, O. Knill
6) IN LAS VEGAS. The Monte Carlo Method is to shoot randomly onto the cube [L, L] [L, L] [L, L] and see how many times we hit the sphere. Here an experiment with Mathematica: R := (2Random[] 1); k = 0; Do[x = R; y = R; z = R; If[x2 + y2 + z2 < 1, k + +], {10000}]; k/10000 Assume, we hit 5277 of 10000 the measured fraction of the volume of the sphere with the volume of the cube 8 is 0.5277. The volume of 1/8th of the sphere is /6 = 0.524 7) USING GAUSS THEOREM (see later) The vector eld F (x, y, z) = (x, y, z) has divergence 3 Gauss theorem tells that 3V is the ux of the vector eld through the surface which is L times the surface area 4L 2 . Therefore, V = 4L3 /3
We rst calculate the volume of a sphere of radius R in dierent ways. Then we show how to calculate the volume of the torus in three dierent ways. The page serves more as an illustration for the variety of tools which are available. We did not cover all the material (yet) to understand all of the methods.
SEVEN WAYS TO COMPUTE THE VOLUME OF THE SPHERE FIVE WAYS TO COMPUTE THE VOLUME OF THE TORUS
V =
R
dxdydz =
L
L2 x2 L2 x2
L2 x2 y 2 L2 x2 y 2 2 2
dzdydx
2 1/2
1) WITH TORAL COORDINATES. T (r, , ) = (x, y, z) = ((b + r cos()) cos(), (b + r cos()) sin(), r sin()) parameterizes the torus.
After computing the most inner integral, we have V = and use the integral in the box below:
L
2 L L2 x L L2 x2
2(L x y )
dydx. Dene a = L x
The Jacobean is det(T ) = (x,y,z) = r(b + r cos(). The torus is the image of the cube [0, a] [0, 2] [0, 2] (r,,) under the map T . The change of variables formula gives
a 0 0 2 0 2 a
V =
L
br dr = 2 2 a2 b
cos2 (u)du = a2 /2 .
2) USING CYLINDRICAL COORDINATES. b If we x the z coordinate, we obtain an annulus with inner radius b a2 z 2 and outer radius + a2 z 2 . 2 z 2 )2 (b a2 z 2 )2 . Therefore, the volume is 4b a 2 z 2 dz = This annulus has the area (b + a a a 4b(a/2) = 2 2 a2 b. 3) USING PAPPUS CENTROID THEOREM. The volume of a solid of revolution generated by the revolution of a region S in the x z plane around the z axis is equal to the product of the area of S and the arc length 2b of the circle on which the center of S moves. In the case of the torus, the length of the curve is 2b. The area of the lamina is A = a 2 . Therefore, the volume is 2 2 a2 b. PROOF OF THE CENTROID THEOREM. We use a coordinate change transformation. In Polar coordinates, the lamina S with center of mass (b, c) is parametrized by r and z. Introduce new coordinates T (u, v) = (u+b, v+ c) = (r, z) so that (0, 0) is the center of mass in the new coordinates. The Jacobean of this coordinate change is 1. b dudv = 2bA, The volume of the solid of revolution is V = (2) S r drdz = (2) R (u + b) dudv = 2b u dudv = 0 because (u, v) = (0, 0) = ( R u dudv/A, R v dudv/A) is the center of where we used that R mass of R. 4) MONTE CARLO AGAIN. Lets assume b = 2 and a = 1. If (x, y, z) is a random point in [3, 3] [3, 3] [1, 1] then (r 2)2 + z 2 1 is the condition to be in the torus, where r 2 = x2 + y 2 . Assume, we hit 5484 of 100000 the measured fraction of the volume 72 of the box we estimate 725484/100000 = 3.94848 for the actual volume 4 2 = 39.4784. 5) CAS. Integrate[r, {r, 1, 3}, {theta, 0, 2Pi}, {z, Sqrt[1 (r 2)2 ], Sqrt[1 (r 2)2 ]}]
rddrdz =
0 L
3) IN SPHERICAL COORDINATES.
R 0 0 2 0
2 sin() ddd = 2
0
2 d
0
sin() d = 4L3 /3 .
4) WITH CAVALIERI. Cavalieri cuts the hemisphere at height z to obtain a disc of radius L2 z 2 with area 2 2 (L z ). He looked now at the complement of a cone of height L and radius L which when cut at height z gives a ring of outer radius L and inner radius z. The ring has area (L2 z 2 ). Cavalieri concludes (Cavalieri principle) that the volume of that body is the same as the volume of the hemisphere. Since the dierence of the volume of the cylinder and the cone which is L3 L3 /3 the hemisphere has the volume 2L3 /3 and the sphere has volume 4L3 /3. 5) CAS. Integrate[1, {x, L, L}, {y, Sqrt[L2 x2 ], Sqrt[L2 x2 ]}, {z, Sqrt[L2 x2 y 2 ], Sqrt[L2 x2 y 2 ]}]
Math21a, O. Knill
2
VECTOR FIELDS IN PHYSICS Newtons law mr = F relates the acceleration r of a body with the force F acting at the point. For example, if x(t) is the position of a mass point in [1, 1] attached at two springs and the mass is m = 2, then the point experiences a force (x + (x)) = 2x so that mx = 2x or x (t) = x(t). If we introduce y(t) = x (t) of t, then x (t) = y(t) and y (t) = x(t). Of course y is the velocity of the mass point, so a pair (x, y), thought of as an initial condition, describes the system so that nature knows what the future evolution of the system has to be given that data.
-1 1
-2
-1
-1
-2
1) F (x, y) = (y, x) is a planar vector eld which you see in a picture on the right. 2) F (x, y) = (x 1, y)/((x 1)2 + y 2 )3/2 (x + 1, y)/((x + 1)2 + y 2 )3/2 is the electric eld of positive and negative point charge. It is called dipole eld. It is shown in the picture above.
-2
-1
-1
We dont yet know yet the curve t (x(t), y(t)), but we know the tangents (x (t), y (t)) = (y(t), x(t)). In other words, we know a direction at each point. The equation (x = y, y = x) is called a system of ordinary dierential equations (ODE). More generally, the problem when studying ODEs is to nd solutions x(t), y(t) of equations x (t) = f (x(t), y(t)), y (t) = g(x(t), y(t)). Here we look for curves x(t), y(t) so that at any given point (x, y), the tangent vector (x (t), y (t)) is (y, x). You can check by dierentiation that the circles (x(t), y(t)) = (r sin(t), r cos(t)) are solutions. They form a family of curves. Can you interpret these solutions physically? VECTOR FIELDS IN MECHANICS If x(t) is the angle of a pendulum, then the gravity acting on it produces a force F (x) = gm sin(x), where m is the mass of the pendulum and where g is a constant. For example, if x = 0 (pendulum at bottom) or x = (pendulum at the top), then the force is zero. The Newton equation mass times acceleration = Force gives x(t) = g sin(x(t)) . The equation of motion for the pendulum x(t) = g sin(x(t)) can be written with y = x also as d (x(t), y(t)) = (y(t), g sin(x(t)) . dt Each possible motion of the pendulum x(t) is described by a curve r(t) = (x(t), y(t)). Writing down explicit formulas for (x(t), y(t)) is in this case not possible with known functions like sin, cos, exp, log etc. However, one still can understand the curves: Curves on the top of the picture represent situations where the velocity y is large. They describe the pendulum spinning around fast in the clockwise direction. Curves starting near the point (0, 0), where the pendulum is at a stable rest, describe small oscillations of the pendulum. VECTOR FIELDS IN METEOROLOGY. On maps like http://www.hpc.ncep.noaa.gov/sfc/satsfc.gif one can see Isoterms, curves of constant temperature or pressure p(x, y) = c. These are level curves. The wind maps are vector elds. F (x, y) is the wind velocity at the point (x, y). The wind velocity F is not always normal to the isobares, the lines of equal pressure p. The scalar pressure eld p and the velocity eld F depend on time. The equations which describe the weather dynamics are called the Navier Stokes equations d/dtF + F F = F p + f, divF = 0
-2
GRADIENT FIELD. 2D: If f (x, y) is a function of two variables, then F (x, y) = f (x, y) is called a gradient eld. The same in 3D: gradient elds are of the form F (x, y, z) = f (x, y, z). EXAMPLE. (2x, 2y, 2z) is the vector eld which is orthogonal to hyperboloids x 2 + y 2 z 2 = const. EXAMPLE of a VECTOR FIELD. If H(x, y) is a function of two variables, then (Hy (x, y), Hx (x, y)) is called a Hamiltonian vector eld. An example is the harmonic Oscillator H(x, y) = x2 + y 2 . Its vector eld (Hy (x, y), Hx (x, y)) = (y, x) is the same as in example 1) above. WHEN IS A VECTOR FIELD A GRADIENT FIELD (2D)? F (x, y) = (M (x, y), N (x, y)) = f (x, y) implies Nx (x, y) = My (x, y). If this does not hold at some point, F is no gradient eld. We will see next week that the condition curl(F ) = Nx My = 0 is also necessary for F to be a gradient eld. EXAMPLE. VECTOR FIELDS IN BIOLOGY. Let x(t) denote the population of a prey species like tuna sh and y(t) is the population size of a predator like sharks. We have x (t) = ax(t) + bx(t)y(t) with positive a, b because both more predators and more prey species will lead to prey consumption. The rate of change of y(t) is cy(t) + dxy, where c, d are positive. We have a negative sign in the rst part because predators would die out without food. The second term is explained because both more predators as well as more prey leads to a growth of predators through reproduction. A concrete example is the Volterra-Lodka system x y = 0.4x 0.4xy = 0.1y + 0.2xy
Volterra explained with such systems the oscillation of sh populations in the Mediterranean sea. At any specic point (x, y) = (x(t), y(t)), there is a curve r(t) = (x(t), y(t)) through that point for which the tangent r (t) = (x (t), y (t) is the vector (0.4x 0.4xy, 0.1y + 0.2xy).
(we will see what is , div later.) It is a partial dierential equation like ux uy = 0. Finding solutions is not trivial: 1 Million dollars are given to the person proving that the equations have smooth solutions in space.
Math21a,O. Knill
EXAMPLE. In ion rockets (used for example in deep space space craft), ionized xenon gas is passed by an electrically charged plate and accelerated to high velocities 30km/s. This (kinetic) energy is built up as work in a force eld F which is parallel to an electric eld E. Let : r(t) = (t, 0, 0), 0 t L be the path a particle travels between the positively charged plate and the negatively charged plate. E dr is the voltage dierence between the two plates and F dr is the energy dierence of the particle. Because F = cE, where e is the charge of the ion and the velocity r of the ions is parallel to the eld, we know that ELc is the voltage dierence and F L is the energy dierence which is mv 2 /2, where m is the mass and v the velocity of the ion, we could get the electric eld strength E = mv 2 /(2Lc).
NOTATION. The short-hand notation F ds is also used. In the literature, where curves are sometimes written as r(t) = (x(t), y(t), z(t)) or r(t), the notation F dr or F dr appears. For simplicity, we leave out below the arrows above the r(t) and F (r(t)) even so they are vectors. WRITTEN OUT. If F = (M, N ) and r = (x(t), y(t)), we can write
b a b a
+ + + + + +
E +
ADDING AND SUBTRACTING CURVES. If 1 , 2 are curves, then 1 + 2 denotes the curve obtained by traveling rst along 1 , then along 2 . One writes for the curve traveled backwards and 1 2 = 1 +(2 ). EXAMPLES. If 1 (t) = (t, 0) for t [0, 1], 2 (t) = (1, (t 1)) for t [1, 2], 3 (t) = (1 (t 2), 1) for t [2, 3], 4 (t) = (0, 1(t3)) for t [3, 4], then = 1 +2 +3 +4 for t [0, 4] is the path which goes around a the unit square. The path travels around in the clockwise direction.
y
M (x, y) dx + N (x, y) dy. Warning: this later notation is only MORE NOTATION. One also can write possible for certain type of curves and rather old fashioned. Avoid it. EXAMPLE: Work. If F (x, y, z) is a force eld, then the line integral
b a
EXAMPLE: Electric potential. If E(x, y, z) is an electric eld, then the line integral called electric potential.
E(r(t)) r (t) dt is
EXAMPLE: Gradient eld. If F (x, y, z) = U (x, y, z) is a gradient eld, then as we will see next hour b a F (r(t)) r (t) dt = U (r(b)) U (r(a)). The gradient eld has physical relevance. For example, if U (x, y, z) is the pressure distribution in the atmosphere, then U (x, y, z) is the pressure gradient roughly the wind velocity eld.
EXAMPLE 1. Let : t r(t) = (cos(t), sin(t)) be a circle parametrized by t [0, 2] and let F (x, y) = (y, x). Calculate the line integral I = F (r)dr. F (r(t)) r (t) dt = ANSWER: We have I = 2 ( cos(t), sin(t)) dt = 0 cos2 (t) + sin2 (t) dt = 2
2 0 2 0 ( cos(t), sin(t))
-2 -1
+ G) dr.
1 +2
F dr =
F dr +
F dr
cF dr = c
F dr.
F dr =
F dr.
-1 -2
4
EXAMPLE 2. Let r(t) be a curve given in polar coordinates as r(t) = cos(t), (t) = t dened on [0, ]. Let F be the vector eld F (x, y) = (xy, 0). Calculate the line integral F dr. SOLUTION. In Cartesian coordinates, the curve is r(t) = (cos2 (t), cos(t) sin(t)). The velocity vector is then r (t) = (2 sin(t) cos(t), sin2 (t) + cos2 (t)) = (x(t), y(t)). The line integral is
F (r(t)) r (t) dt =
0 0
= 2
0
A periodic processes like a refrigerator denes a closed cycle : t r(t) = (V (t), p(t)) in the V p plane. The curve is parameterized by the time t. At a given time the gas has a specic volume V (t) and a specic pressure p(t). Consider the vector eld F (V, p) = (p, 0) and a closed curve and the line integral F ds. Writing it out, we get
2 0 (p(t), 0)
(V (t), p (t)) dt =
2 0
p(t)V (t) dt =
2 0
p dV .
WORK. If F is a force eld and r(t) a path of a body, then F (r(t)) is the force acting on the body. The component of that force in the velocity direction is G(t) = F (r(t)) r (t)/|r (t)|. For some small time dt, the body will move a distance |r (t)|dt. In physics, G(t)ds is the amount of work done when traveling this distance. b b Integrating up gives the total work or energy W = a G(t)|r (t)| dt = a = F (r(t)) r (t) dt. W = F ds is the energy gained by a body traveling along the path in a force eld F .
If the volume of the gas changes under pressure p, then the work on the system is pdV . On the other hand, if the volume is kept constant, then for a gas, one does not do work on the system, when changing the pressure. Processes described by this approximation are called adiabatic. For example, if the volume is decreased under high pressure and increased under low pressure then we do the 2 work 0 p dV . Lets compute that if r(t) = (2 + cos(t), 2 + sin(t)) for t [0, 2] and F (V, p) = (p, 0). r (t) = ( sin(t), cos(t)), F (r(t)) = (2 + sin(t), 0). so that F (r(t)) r (t) = sin(t)(2 + sin(t)) and 2 2 F (r(t)) r (t) dt = 0 sin2 (t) dt = . 0
Math21a,O. Knill
EXAMPLE. One of the hits on the web in March 2004 was a photo report of a Russian girl Elena who rode with her Kawasaki motorcycle and a camera through the deserted Chernobyl area and left an impressive document on the web. The URL is http://www.angelre.com/extreme4/kiddofspeed/
r(t)
b a
(x(t), y(t)),
we
can
write
EXAMPLE. Integrate f (x, y, z) = x2 + y 2 + z 2 over the path r(t) = (cos(t), sin(t), t) from t = 0 to t = . The answer is 0 (1 + t2 ) 2 dt = 2 + 3 2/3. EXAMPLE: Let r(t) = {cos(t), sin(t), t2 /2} be the path of a model plane. What is the average height of the plane? This is not a very clearly formulated question. We want to know
2 2
Assume Elena picks up radioactive radiation proportional to the radioactivity level f (x, y) and the amount of path covered with the bike, then the total radiation obtained during the time [0, T ] is
T
z(t)|r (t)| dt =
0 0
t2 2
1 + t2 dt
f (r(t))|r (t)| dt .
0
z(t) dt =
0 0
t2 /2 dt
This is not realistic. If Elena stops, she would get no radiation increase. The correct integral would rather be
T
f (r(t)) dt .
0
REMARK. Scalar line integrals should be thought as a generalization of the length integral. Do not mix it up with the line integral dened by a vector eld which we cover next and which is innitely more important. The examples above show that dealing with scalar line integrals can be confusing. You are measuring quantities with it which are given per distance and not quantities per time. Scalar integrals hardly appear in applications. (They do for example in tomography where the problem is to reconctruct f (x, y, z) from knowing all line integrals along all lines. But also there, it is possible and simpler to avoid them.) the application of computing mass is very articial because mass is a triple integral. All solid bodies, even wires have three dimension. In general, for one dimensional situations, the density is constant so that the scalar line integral is actually a usual length integral. Nobody questions the importance of the length integral. EXAMPLE. A wire r(t) = (cos(t), 0, sin(t)) has thickness f (r(t)) = sin2 (t) and t [0, 2] What is the mass of this wire? The mass is, because r (t) = 1:
2
M=
0
sin2 (t) dt = .
For center of mass or moment of inertia computations, one better uses triple integrals. Arcs or wires have a nonzero radius and the simplication done by computing it with one dimensional integrals produces an error. For mass computations, the error is zero by the Pappus Centroid theorem. Introducing articial scalar line integrals is not only confusing, it is also not precise. The topic has been introduced into calculus text books as a bridge to ease the transition from 1D integrals to line integrals but experience shows that this bridge unnecessarily complicates things because it introduces a new concept. Just treat the topic as a footnote to the length integral.
Math21a,O. Knill
AMPERES LAW. A wire along the z-axes carries a current I. What is the strength |B| of the magnetic eld B(x, y, z) = (By, Bx, 0) in distance r from the z-axes if we know that Am`re e law B dr = 0 I
F dr =
F (r(t)) r (t) dt
is called the line integral of F along the curve C. If F is a force, then the line integral is work. A RIDDLE ABOUT WORK. 1) If you accelerate a car from 0m/s to 10m/s = 2.24miles/hour the kinetic energy needed is mass times 102 /2 = 50. 2) If you accelerate a car from 10m/s to 20m/s = 4.48miles/hour the kinetic energy has increased by 202 /2 102 /2 = 200 50 = 150. 3) Now watch situation 2) from a moving coordinate system which moves with constant 10m/s. In that system, the car accerates from 0 to 10 meter per second. Because all physical laws are the same in dierent coordinate systems (going from one to the other is a Galilei transformation), the energy should be the same when accelerating from 0 to 10 or from 10 to 20. This is in contradiction to the fact that accelerating the car from 0 to 10 needs three times less energy than accelerating the car from 10 to 20. Why?
holds for a closed curve C : r(t) = (r cos(t), r sin(t), 0) winding in distance r once around the x axes and where 0 is a constant. Remark. The Ampere law actually follows from a basic identity which is one of the Maxwell equations and which we will see later in this course. Solution: compute B(r(t)) = (B sin(t), B cos(t), 0) and r (t) = (r sin(t), r cos(t)) The line integral is 2rB and because we know this is I, we have B = I/2r. We see that the magnetic eld decays like 1/r. One can actually derive this result also from special relativity: A striking application of the Lorentz transformation is that if you take two wires and let an electric current ow in the same direction, then the distance between the electrons shrinks: the positively charged ions in the wire see a larger electron density than the ion density. The other wires appears negatively charged for the ions and attract each other. If the currents ow in dierent directions and we go into a coordinate system, where the electrons are at rest in the rst wire, then the ion density of the ions in the same wire appears denser and also the electron density is denser in the other wire. The two wires then repell each other. The force is proportional to 1/r because two charged wires in distance r attract or repel each other with the force 1/r. A PERPETUUM MOTION MACHINE. Before entering high school, one of my passions was to construct perpetuum motion machines. Physics classes in school quickly killed that dream. But still, these machines still fascinate me, especially if they work! Will will see more about these machines next week, but here is a model which allows us to practice line integrals: Problem: by arranging cleverly charged plates (see lecture), we realize a static electric eld E = (0, 0, x). We construct a wire along the elliptical path C : r(t) = (cos(t), 0, 3 sin(t)). What is the Voltage
The picture above shows the Smart car, an extremly energy friendly car seen often in Europe, where gas prizes are much higher than here (even now)
EXAMPLE. Compute the line integral for the vector eld F (x, y) = (x2 , y 2 ) along the boundary of a square in the counter clockwise direction.
We split up the path into four paths: 1 : r(t) = (t, 0) for t [0, 1], 2 : r(t) = (1, t) for t [0, 1], 3 : r(t) = (1 t, 1) for t [0, 1], 4 : r(t) = (0, 1 t) for t [0, 1], then = 1 + 2 + 3 + 4 . The integral is then F dr =
1
V =
C
E(r(t)) r (t) dt
3 cos2 (t) dt = 3.
F dr +
2
F dr +
3
F dr +
4
F dr
x
(t2 , 0) (1, 0) dt +
0 0 1 0
(1, t2 ) (0, 1) dt +
0
30 second background info in electricity: when an electron is moved around in an electric eld along a path C, it gains the potential C E dr. This potential is also called voltage and measured in Volts. When moving a charge through a voltage dierenence, it gains some energy. This energy is proportional to the amount of charge going through the wire as well as the voltage V . If the charge is It which is current times time, then the energy is V It, which can also be seen as the power V I (volt times ampere = Watts) multiplied with time. For example, through a light bulb of 100W , a current of about one ampere ows if the voltage is 110 Volts. If we let the lamp burn for 10 hours, we use the energy 10 100W h which is one Watt hour. In Massachusetts, a Kilowatt hour costs about 10 15 cents. Running a 100 Watt light bulb for 24 hours costs a quarter.
THE COMPONENT TEST. When is a vector eld a gradient eld? F (x, y) = f (x, y) implies Fy (x, y) = Fx (x, y). If this does not hold at some point, F = (M, N ) is no gradient eld. This is called the component test. The condition curl(F ) = Nx My = 0 implies that the eld is conservative if the region satises a certain property. FIND THE POTENTIAL. PROBLEM 1. Let F (x, y) = (2xy 2 + 3x2 , 2yx2 ). Find a potential f of F .
GRADIENT FIELD. A vector eld F is called a gradient eld if there exists a function f such that F = For example, F (x, y) = (xy 2 , yx2 ) is a gradient eld. FUNDAMENTAL THEOREM OF LINE INTEGRALS. If F =
b a
f.
f , then
SOLUTION. The potential function f (x, y) satises fx (x, y) = 2xy 2 + 3x2 and fy (x, y) = 2yx2 . Integrating the second equation gives f (x, y) = x2 y 2 +h(x). Partial dierentiation with respect to x gives fx (x, y) = 2xy 2 +h (x) which should be 2xy 2 + 3x2 so that we can take h(x) = x3 . The potential function is f (x, y) = x2 y 2 + x3 . Find g, h from f (x, y) =
x M (x, y) 0
In other words, the line integral integral is the potential dierence between the end points r(b) and r(a) if F is a gradient eld. EXAMPLE. Let f (x, y, z) be the temperature distribution in a room and let r(t) the path of a y in the room, then f (r(t)) is the temperature, the y experiences at the point r(t) at time t. The change of temperature for d the y is dt f (r(t)). The line-integral of the temperature gradient f along the path of the y coincides with the temperature dierence between the end and initial point. SPECIAL CASES. r(t) parallel to level curve of f means d/dtf (r(t)) = 0 and r (t) orthogonal to curve means |d/dtf (r(t))| = | f ||r (t)| and r (t) parallel to f (r(t)).
PROBLEM 2. Find values for the constants a,b which make the vector eld F = (M, N ) = (ax 3 y + by 2 , x4 + yx) conservative. SOLUTION. The curl Nx My = 4x3 + y ax3 must be zero. This gives a = 4 and b = 1/2. The potential is f (x, y) = (x4 + y 2 x/2). A COUNTER EXAMPLE? Let F (x, y) = (M, N ) = x ( x2y 2 , x2 +y2 ). It is a gradient eld because f (x, y) = arctan(y/x) +y has the property that fx = (y/x2 )/(1 + y 2 /x2 ) = M, fy = (1/x)/(1 + y 2 /x2 ) = N . However, the line integral F ds, where is the unit circle is
2
PROOF OF THE FUNDAMENTAL THEOREM. Use the chain rule in the second equality and the fundamental theorem of calculus in the third equality of the following identities:
b b b
(
0
sin(t) cos(t) ) ( sin(t), cos(t) dt , cos2 (t) + sin2 (t) cos2 (t) + sin2
2 0
F (r(t)) r (t) dt =
a a
f (r(t)) r (t) dt =
a
which is
1 dt = 2. What is wrong?
Solution: note that the potential f as well as the vectoreld F are not smooth everywhere. SIMPLY CONNECTED. A region R is called simply connected, if every curve in R can be contracted to a point in a continuous way and every two points can be connected by a path. A disc is an example of a simply connected region, an annulus is an example which is not. CONSERVATIVE curl(F ) = 0. If R is a simply connected region, then F is a gradient eld if and only if curl(F ) = 0 everywhere in R. We will prove this on Friday.
CONSERVATIVE. A eld F is called conservative if every line integral is independent of paths. F is a gradient eld if and only if it is conservative. Proof. If F = f , the conservative property follows from the fundamental theorem of line integrals. To see the other direction, chose a point y and for every x a path Cx connecting y with x and dene f (x) = Cx F dr. The conservative property assures that the result is independent of the chosen path. Note that f is not unique: changing y will add a constant to f . CLOSED LOOP PROPERTY = ENERGY CONSERVATION. It follows that for a gradient eld the lineintegral along any closed curve is zero. Conversly, if this energy conservation holds, one has a conservative eld. If F is a gradient eld if and only if the line integral along a closed curve is zero if and only if the eld is a gradient eld.
Gradient field
PERPETUUM MOTION MACHINES. A machine which implements a force eld which is not a gradient eld is called a perpetuum mobile. Mathematically, it realizes a force eld for which along some closed loops the energy gain is nonnegative. (By possibly changing the direction, the energy change can be made positive). The rst law of thermodynamics forbids the existence of such a machine. It is informative to stare at some of the ideas people have come up with and to see why they dont work. The drawings of Escher appear also to produce situations, where a force eld can be used to gain energy. Escher uses genius graphical tricks however. SUMMARY. We have three equivalent properties: conservative=gradient eld= closed loop property. They imply the component test curl(F ) = 0. If the region is simply connected, all four properties are equivalent.
Conservative
4/14/2004 REVIEW II
Extrema of functions of two variables. Extrema of functions with constraints. Error of linear approximation Integration in two dimensions Integration in three dimensions Integration in cylindrical coordinates
II) Algorithms: SOLVE LAGRANGE PROBLEMS. 1) Write down equations neatly. 2) See whether some variable can be eliminated easily. 3) If some variable can be eliminated easily, go back to 1) using one variable less and repeat. 4) Try to combine, rearrange, simplify the equations. The system might not have an algebraic solution. x = 0 or x = 1/ 2 + 2 y = 0 or y = 1/ 2 + 2 = 1
2x 4x3 2y 4y 3 x4 + y 4
= 4x3 = 4y 3 = 1
2x (4 + 4)x3 2y (4 + 4)y 3 x4 + y 4
= 0 = 0 = 1
LEVELS OF UNDERSTANDING. I) II) III) IV) KNOW DO UNDERSTAND APPLY Know what the objects, denitions, theorems, names are. Know jargon and history. Know how to work with the objects. Pursue algorithms. See dierent aspects, contexts. Why is it done like this? Extend the theory, apply to new situations, invent new objects. Ask: Why not...?
x4 + y 4
If x=0, then y=1, or y=-1, if y = 0 then x = 1 or x = 1. There are 4 critical points. III) Understanding: Try to answer questions like: What can happen at a critical point if the discriminant What does it mean if the Lagrange multiplier is zero? Is there f with two saddles as critical points and no is zero at this point? other critical points? What is the geometric meaning of fxx ? IV) Apply to new situations. Problem solving and creativity skills are acquired best by doing it, by pondering over new questions, working on specic problems. Nevertheless, there is also theoretical help: for example, Polyass book how to solve it gives some general advise on how to solve problems. Abstract: How to solve a problem?: 1) Understand the problem. 2) Think of a plan by solving subproblems. Connect with older problems. 3) Walk along the plan while controlling each step. 4) Check the result. Is the result obvious? Is the method useful for other problems?
I) Denitions and objects. CONSTRAINED EXTREMUM of f constrained by g = c are obtained where f = g, g = c of (g) = 0. CRITICAL POINT. f (x, y) = (0, 0). Is also called stationary point. b g (x) DOUBLE INTEGRAL. a g12(x) f (x, y) dydx is an example of a double integral. 2D POLAR INTEGRAL. R f (r, ) rdrd in polar coordinates. DISCRIMINANT. D = fxx (x, y)fyy (x, y) f xy 2 (x, y). LINEAR APPROXIMATION. L(x, y) = f (x0 , y0 ) + f (x0 , y0 ) (x x0 , y y0 ). ERROR ESTIMATE. |L(x, y) f (x, y)| M/2|(x x0 )2 + (y y0 )2 | where |fxx | < M, |fyy | < M, |fxy | < M in rectangle having (x0 , y0 ) and (x, y) opposite corners. LOCAL MAXIMUM. A critical point for which det(H(x, y)) > 0, Hxx (x, y) < 0 is a local maximum. LOCAL MINIMUM. A critical point for which det(H(x, y)) > 0, Hxx (x, y) > 0 is a local minimum. SADDLE POINT. A critical point for which det(H(x, y)) < 0. SECOND DERIVATIVE TEST. D < 0 saddle, D > 0, fxx > 0 min, D > 0, fyy < 0 max. ON CLOSED DOMAIN. There is a maximum and a minimum. If it is not inside, it is on the boundary. II) Algorithms: INTEGRATION OVER A DOMAIN R. 1) Eventually chop the region into pieces which can be parametrized. 2) Start with one variable, say x and nd the smallest x-interval [a, b] which contains R. 3) For xed x, intersect the line x = const with R to determine the y-bounds [f (x), g(x)]. 4) Evaluate the integral a f (x) f (x, y) dydx. 5) Solve the double integral by 1D integration starting from inside. 6) In case of problems with the integral, try to switch the order of integration. (Go to 2) and start with y). EXAMPLE. Integrate x2 y 2 over the triangle x + y/2 3, x > 0, y > 1. The triangle is contained in the strip 0 x 3. The x-integration ranges over the interval [0, 3]. For xed x, we have y 1 and y 2(3 x) which 3 62x 2 2 x y dydx. means that the y bounds are [0, 2(3 x)]. The double integral is 0 1 II) Algorithms: FINDING EXTREMA ON A DOMAIN R with boundary. 1) 2) 3) 4) First look for all stationary points f (x, y) in the interior of R. Eventually classify the points in the interior by looking at D, fxx (x, y) at the critical points. Locate the critical points at the boundary by solving F (x, y) = G(x, y), G(x, y) = c. List the values of F evaluated at all the points found in 1) and 3) and compare them.
b g(x)
PRO MEMORIAM. Solve integration problems with the help of good gures! polar coordinates
R
spherical coordinates
2 R g(, , z) sin() ddd x = sin() cos() y = sin() sin() z = cos()
g(r, ) r ddr
x = r cos() y = r sin()
One uses these formulas to express the function f (x, y, z) in the new coordinates as a new function g like in f (x, y) = (x2 + y 2 )2 + xy f (x, y, z) = x2 + y 2 + z 2 x3 g(r, ) = r 4 + r2 cos() sin() g(, , ) = 2 3 cos3 () sin3 ()
Application Area Mass Average Centroid Center of mass Moment of inertia Radius of gyration
2D Integral A = R 1 dA M = R (x, y) dA R f (x, y) dA/A. ( R x dA/A, R y dA/A). ( R x(x, y)dA/M, R y(x, y)dA/M ). I = R (x2 + y 2 ) dA (with respect to origin) I/M
EXAMPLE. Find the maximum of F (x, y) = x2 y 2 x4 y 4 on the domain x4 + y 4 1. F (x, y) = (2x 4x3 , 2y 4y 3 ). The critical points inside the domain are obtained by solving 2x 4x3 = 1/4, y = 0, y = 1/4. We have four points P1 = (0, 0), P2 = 0, 2y 4y 3 = 0 which means x = 0, x = (1/ 2, 0), P3 = (0, 1/ 2), P4 = (1/ 2, 1/ 2). The critical points on the boundary are obtained by solving the Lagrange equations (2x 4x 3 , 2y 4y 3 ) = (4x3 , 4y 3 ), x4 + y 4 = 1. Solutions (see below) are P5 = (0, 1), P6 = (0, 1), P7 = (1, 0), P8 = (1, 0). A list of function values F (P1 ) = 0, F (P2 ) = 1/2 1/4, F (P3 ) = 1/2 1/4, F (P4 ) = 2/4, F (P5 ) = 2, F (P6 ) = 2, F (P7 ) = 0, F (P8 ) = 0 shows that P2 in the interior is the maximum. Indeed, the Hessian at this point is H = diag(1, 2) which has positive determinant and negative H11 .
Application Volume Mass Average Centroid Center of mass Moment of inertia Radius of gyration
3D Integral V = R 1 dV M = R (x, y, z) dV f (x, y, z) dV /V . R ( R x dV /V, R y dV /V, R z dV /V ). ( R x dV /M, R x dV /M, R y dV /M ). I = R (x2 + y 2 ) dV (with respect to z-axes.) I/M
Math21a, O. Knill
WHERE IS THE PROOF? (Quote: General Hein in Final Fantasy). To prove Greens theorem, look rst at a small square R = [x, x+ ][y, y + ]. The line integral of F = (M, N ) along the boundary is 0 M (x + t, y)dt + 0 N (x + , y + t) dt 0 M (x + t, y + ) dt 0 N (x, y + t) dt. (Note also that this line integral measures the circulation at the place (x, y).) Because N (x + , y) N (x, y) Nx (x, y) and M (x, y + ) M (x, y) My (x, y) , the line integral is (Mx Nx ) 2 is about the same as curl(F ) dxdy. All identities hold in the limit 0. 0 0 To prove the statement for a general region R, we chop it into small squares of size . Summing up all the line integrals around the boundaries gives the line integral around the boundary because in the interior, the line integrals cancel. Summing up the vorticities on the rectangles is a Riemann sum approximation of the double integral.
LINE INTEGRALS (RECALL). If F (x, y) = (M (x, y), N (x, y)) is a vector eld and C : r(t) = (x(t), y(t)), t [a, b] is a curve, then
b a
F ds =
is called the line integral of F along . Its helpful to think of the integral as the work of a force eld F along C. It is positive if the force is with you, negative, if you have to ght against the force, while going along the path C. THE CURL OF A 2D VECTOR FIELD. The curl of a 2D vector eld F (x, y) = (M (x, y), N (x, y)) is dened as the scalar eld curl(F )(x, y) = Nx (x, y) My (x, y) . INTERPRETATION. curl(F ) measures the vorticity of the vector eld. One can write the curl of F because the 2D cross product of (x , y ) with F = (M, N ) is Nx My . F = curl(F ) for
APPLICATION: CALCULATING DOUBLE INTEGRALS. Sometimes, the reverse is true and it is harder to calculate the double integral. An example is to determine the area of a polygon with sides (x1 , y1 ), ..., (xn , yn ) (see problem 21, section 13.4 in the book). In that case, there n is a closed formula for the area: A = 1 i=1 (xi yi+1 xi+1 yi ), something a computer can do evaluate very fast 2 and which does not involve any integration. This formula is used for example in computer graphics. APPLICATION: FINDING THE CENTROID OF A REGION. See homework. Greens theorem allows to express the coordinates of the centroid (
R
EXAMPLES. 1) F (x, y) = (y, x). curl(F )(x, y) = 2. 2) F (x, y) = f , (conservative eld = gradient eld = potential) Because M (x, y) = f x (x, y), N (x, y) = fy (x, y), we have curl(F ) = Nx My = fyx fxy = 0. GREENS THEOREM. (1827) If F (x, y) = (M (x, y), N (x, y)) is a vector eld and R is a region which has as a boundary a piecewise smooth closed curve C traversed in the direction so that the region R is to the left. Then
x dA/A,
R
y dA/A)
as line integrals. One just has to nd the right vector elds for each coordinate. For example, to verify x dA =
C
F dr
C
F ds =
curl(F ) dxdy take the vector eld F dr = x2 dy. APPLICATION: AREA FORMULAS.
Note: for a region with holes, the boundary consists of many curves. They are always oriented so that R is to the left. GEORGE GREEN (1793-1841) was one of the most remarkable physicists of the nineteenth century. He was a self-taught mathematician and miller, whose work has contributed greatly to modern physics. Unfortunately, we dont have a picture of George Green. SPECIAL CASE. If F is a gradient eld, then both sides of Greens theorem are zero:
C F ds is zero by the fundamental theorem for line integrals. R curl(F ) dA is zero because curl(F ) = curl(grad(f )) = 0.
The vector elds F (x, y) = (M, N ) = (y, 0) or F (x, y) = (0, x) have vorticity curl(F (x, y)) = 1. The right hand side in Greens theorem is the area of R: Area(R) =
C
y dx =
x dy
EXAMPLE. Let R be the region under the graph of a function f (x) on [a, b]. The lineintegral around the boundary of R is 0 from (a, 0) to (b, 0) because F (x, y) = 0 there. The lineintegral is also zero from (b, 0) to b (b, f (b)) and (a, f (a)) to (a, 0) because N = 0. The line integral on (t, f (t)) is a ((y(t), 0) (1, f (t))dt =
b a
f (t) dt. Greens theorem assures that this is the area of the region below the graph.
APPLICATION. THE PLANIMETER. The planimeter is a mechanical device for measuring areas: in medicine to measure the size of the cross-sections of tumors, in biology to measure the area of leaves or wing sizes of insects, in agriculture to measure the area of forests, in engeneering to measure the size of proles. There is a vector eld F associated to a planimeter (put a vector of length 1 orthogonally to the arm). One can prove that F has vorticity 1. The planimeter calculates the line integral of F along a given curve. Greens theorem assures it is the area. The picture to the right shows a Java applet which allows to explore the planimeter (from a CCP module by O. Knill and D. Winter, 2001). To explore the planimeter, visit the URL http://www.math.duke.edu/education/ccp/materials/mvcalc/green/
The fact that curl(grad(f )) = 0 can be checked directly but it can also be seen from the cross product of two identical vectors is 0. One just has to treat as a vector.
APPLICATION: CALCULATING LINE INTEGRALS. Sometimes, the calculation of line integrals is harder than calculating a double integral. Example: calculate the line integral of F (x, y) = (x 2 y 2 , 2xy) = (M, N ) along the boundary of the rectangle [0, 2] [0, 1]. Solution: curl(F ) = Nx My = 2y 2y = 4y so that 2 1 2 1 2 C F dr = 0 0 4y dydx = 2y |0 x|0 = 4. Remark. One can easily nd examples, where the calculation of the line integral is not possible in closed form directly, but where Green allows to do it nevertheless.
Math21a, O. Knill
GREENS THEOREM is extremely useful in physics. It belongs to the most advanced topics in calculus. If you master it, you have so to speek the black belt in calculus. Of course, it needs some time to learn. THERMODYNAMICS. When studing gases or liquids, one draws often a P V diagram (evenso one draws V usually as the x-axis). The volume in the x-axis and the pressure in the y axis. For periodic (running of a car, the pump in a refridgeratore), one gets a closed curve : t r(t) = (V (t), p(t)) in the V p plane. The curve is parameterized by the time t. At a given time, the gas has a specic volume V (t) and a specic pressure p(t). Consider the vector eld F (V, p) = (p, 0) and a closed curve . What is
T 0 (p(t), 0) T 0 pdV is T T
(V (t), p (t) dt = 0 p(t)V (t)dt = 0 pdV . The curl of F (V, p) is 1. You see that the integral the area of the region enclosed by the curve.
Where is the physics? If the volume of a gas changes by constant pressure, then the work on the system is pdV . On the other hand, if the volume is held constant, then for a gas, one does no work on the system, when changing the pressure. EXAMPLE: ELECTRO ENGINE. Let us look at a cyclic process, where the volume is decreased under low pressure and increased under high pressure. It is clear that the gas does some work in this case. How much is T it? Well, it is 0 pdV for a curve which goes clockwise around a closed region R. Greens theorem tells us that the work done is the area of the region R. ELECTROMAGNETISM. In the plane (atland), the electric eld is a vector eld E = (E 1 , E2 ), while the d magnetic eld is a scalar eld. One of the 2D Maxwell equation is curl(E) = 1 dt B, where c is the speed of light. c Consider a region R bounded by a wire . Greens theorem tells us that d/dt R B(t)dxdy is the lineintegral of E around the boundary. But Eds is a voltage. A change of the magnetic eld produces a voltage. This is the dynamo. This statement will become much more clear and useful when we lift Green to three dimensions (which will be called the theorem of Stokes). FLUID DYNAMICS. If v is the velocity distribution of a uid in the plane, then (x, y) = curl(v)(x, y) is called the vorticity of the uid. If v = U (potential ows), then the uid is called irrotational. As you can check, then = curl(v) = 0 by Greens theorem. The integral dxdy is called the vortex ux through R. Greens theorem tells that this ux is related to R the circulation on the boundary. In water, you could ideally measure the amount of vorticity inside a region R by measureing the work, you have to do by swimming around the boundary of R. A RELATED THEOREM. If we rotate the vector eld F = (P, Q) by /2 we get a new vector eld G = (Q, P ) and the integral F ds becomes a ux of G through the boundary of R. Introducing div(F ) = (Px + Qy ) we see that curl(F ) = div(G). Greems theorem now becomes div(G) dxdy =
R
G dn ,
where dn(x, y) is a normal vector at (x, y) orthogonal to the velocity vecgtor r (x, y) at a point (x, y). This new theorem has a generalisation to three dimensions too. It is called Gauss theorem or divergence theorem.
Math21a, O. Knill
AREA OF SURFACES OF REVOLUTION. If we rotate the graph of a function f (x) on an interval [a, b] around the x-axis, we get a surface parameterized by (u, v) r(u, v) = (v, f (v) cos(u), f (v) sin(u)) on R = [0, 2] [a, b] and is called a surface of revolution. We have ru = (0, f (v) sin(u), f (v) cos(u)), rv = (1, f (v) cos(u), f (v) sin(u)) and ru rv = (f (v)f (v), f (v) cos(u), f (v) sin(u)) The surface area is = f (v)(f (v), cos(u), sin(u)). b |ru rv | dudv = 2 a |f (v)| 1 + f (v)2 dv. EXAMPLE. If f (x) = x on [0, 1], we get the surface area of a cone:
2 0 1 0
x 1 + 1 dvdu = 2 2/2 = 2.
INTEGRAL OF A SCALAR FUNCTION ON A SURFACE. If S is a surface, then S f (x, y) dS/Area should be an average of f on the surface. If f (x, y) = 1, then A = S dS should be the area of the surface. If S is the image of r under the map (u, v) r(u, v), then dS = |ru rv | dudv.
P.S. In computer graphics, surfaces of revolutions are constructed from a few prescribed points (x i , f (xi )). The machine constructs a function (spline) and rotates
Given a surface S = r(R), where R is a domain in the plane and where r(u, v) = (x(u, v), y(u, v), z(u, v)). The surface integral of f (u, v) on S is dened as S f dS = R f (u, v)|ru rv | dudv. INTERPRETATION. If f (x, y) measures a quantity then on S. Analoguously to the scalar line ingegral a footnote to the surface area integral only.
b a S
GABRIELS TRUMPET. Take f (x) = 1/x on the interval [1, ). Volume: The volume is (use cylindrical coordinates in the x di rection): 1 f (x)2 dx = 1 1/x2 dx = . 2 Area: The area is 0 1 1/x 1 + 1/x4 dx 2 1 1/x dx = 2 log(x)|0 = . The Gabriel trumpet is a surface of nite volume but with innite surface area! You can ll the trumpet with a nite amount of paint, but this paint does not suce to cover the surface of the trumpet! Question. How long does a Gabriel trumpet have to be so that its surface is 500cm 2 (area of sheet of paper)? L Because 1 1 + 1/x4 2, the area for a trumpet of length L is between 2 1 1/x dx = 2 log(L) and 22 log(L). In our case, L is between e500/( 22) 2 1024 cm and e500/(2) 4 1034 cm. Note that the universe is about 1026 cm long (assuming that the universe expanded with speed of light since 15 Billion year). It could not accommodate a Gabriel trumpet with the surface area of a sheet of paper.
f dS/
EXPLANATION OF |ru rv |. The vector ru is a tangent vector to the curve u r(u, v), when v is xed and the vector rv is a tangent vector to the curve v r(u, v), when u is xed. The two vectors span a parallelogram with area |ru rv |. A little rectangle spanned by [u, u + du] and [v, v + dv] is mapped by r to a parallelogram spanned by [r, r + ru ] and [r, r + rv ]. A simple case: consider r(u, v) = (2u, 3v, 0). This surface is part of the xy-plane. The parameter region R just gets stretched by a factor 2 in the x coordinate and by a factor 3 in the y coordinate. r u rv = (0, 0, 6) and we see for example that the area of r(R) is 6 times the area of R. POLAR COORDINATES. If we take r(u, v) = (u cos(v), u sin(v), 0), then the rectangle [0, R] [0, 2] is mapped into a at surface which is a disc in the xy-plane. In this case ru rv = (cos(v), sin(v), 0) (u sin(v), u cos(v), 0) = (0, 0, u) and |ru rv | = u = r. We can explain the integration factor r in polar coordinates as a special case of a surface integral. THE AREA OF THE SPHERE. The map r : (u, v) (L cos(u) sin(v), L sin(u) sin(v), L cos(v)) maps the rectangle R : [0, 2] [0, ] onto the sphere of radius L. We compute ru rv = L sin(v)r(u, v). So, |ru rv | = L2 | sin(v)| and 1 dS = R 2 2 2 0 0 L sin(v) dvdu = 4L .
MOBIUS STRIP. The surface r(u, v) = (2+v cos(u/2) cos(u), (2+ v cos(u/2)) sin(u), v sin(u/2)) parametrized by R = [0, 2][1, 1] is called a Mbius strip. o The calculation of |ru rv | = 4+3v 2 /4+4v cos(u/2)+v 2 cos(u)/2 is straightforward but a bit tedious. The integral over [0, 2][1, 1] is 17. QUESTION. If we build the Moebius strip from paper. What is the relation between the area of the surface and the weight of the surface? REMARKS. 1) An OpenGL implementation of an Escher theme can be admired with xlock -inwindow -mode moebius in X11. 2) A patent was once assigned to the idea to use a Moebius strip as a conveyor belt. It would last twice as long as an ordinary one. SURFACE AREA OF IMPLICIT SURFACES. If f (x, y, z) = c is an implicit surface which is a graph over a region R in the xy-plane (add the graph assumption to the box on page 1095 in the Thomas), then the | f |/|fz | dA if fz = 0 on R. This follows from the formula in the case of the graph and the surface area is 2 2 R2 fx +fy +fz 2 2 fact that = (fx /fz )2 + (fy /fz )2 + 1 = gx + gy + 1, if z = g(x, y) by implicit dierentation. |fz |
SURFACE AREA OF GRAPHS. For surfaces (u, v) (u, v, f (u, v)), we have ru = (1, 0, fu (u, v)) and rv = (0, 1, fv (u, v)). The cross product ru rv = (fu , fv , 1) 2 2 has the length 1 + fu + fv . The area of the surface above a region R is
R 2 2 1 + fu + fv dA
EXAMPLE. The surface area of the paraboloid z = f (x, y) = x2 + 2 y 2 is (use polar coordinates) 0 1 + 4r2 r drd = 2(2/3)(1 + 4r2 )3/2 /8|1 = (53/2 1)/6. 0
Math21a, O. Knill
PROPERTY ON THE MOON. More than two years ago, in lack of a better present idea, I bought property on the moon for family (For 30 Us-Dollars one could get 1777.58 Acres)) at the Lunar Embassy (www.moonshop.com). An acre is now sold for 19.99 Dollars plus 1.51 Dollars lunar tax. You can also buy an entire city for 4500 dollars now. The coordinates of the parcel are 34E, 26N . The moon has a radius of r=1737 km. The surface is 3.8106km2 . Multiply this by 247 gives about 10 billion (1010 ) acres (more than an acre for each person on the world). The moon surface is parameterized by r(u, v) = (r cos(u) sin(v), r sin(u) sin(v), r cos(v)), where u is the latitude and /2 v is the latitude. If we look at the moon from the direction (1, 0, 0), how big does the area of a real estate S = r([a, b] [c, d]) appear? The ux of the vector eld (1, 0, 0) through the surface is F dS = a c r2 cos(u) sin2 (v)dvdu. S This is also the area we see. You notice that the visible area is small for cos(u) small or sin(v) small, which is near 90E, 90W or near the poles. EXAMPLE. Calculate the ux of the vector eld F (x, y, z) = (1, 2, 3z) through the paraboloid z = x 2 + y 2 lying above the region x2 + y 2 1. Parameterize it using polar coordinates r(u, v) = (2u2 cos(v), 2u2 sin(v), u) and F (r(u, v)) = (1, 2, 3u2 ). 4u2 sin(v) + 3u3 )dudv = 1. WHERE CAN FLUX INTEGRALS APPEAR? Fluid dynamics The ux of the velocity vector eld of a membrane through a surface is the volume of the uid which passes through that surface in unit time. Often one looks at incompressible uids which means div(v) = 0. In this case, the amount of uid which passes through a closed surface like a sphere is zero because what enters also has toe leave the surface. Electromagnetism The change of the ux of the magnetic eld through a surface is related to the voltage at the boundary of the surface. We will see why one of the Maxwell equations div(B) = 0 means that there are no magnetic monopoles and see how divergence is related to ux. Magnetohydrodynamics Magnetohydrodynamics deals with electrically charged uids like plasmas in the sun or solar winds etc. The velocity eld of the wind induces a current and the ux of the eld trough a surface can be used to calculate the magnetic eld. Gravity We will see that the ux of a eld through a closed surface like the sphere is related to the amount of source inside the the surface. In gravity, where F is the gravitational eld, the ux of the gravitational eld through a closed surface is proportional to the mass inside the surface. Mass is a source for gravitational eld. Thermodynamics. The heat ux through a surface like the walls of a house are related to the amount of heat which is produced inside the house. A badly isolated house needs has a large heat ux and needs a large source of heating. Particle physics. When studying the collision of particles, one is interested in the relation between the incoming ux and out-coming uxes depending on the direction. The key word is: dierential cross-section. Optics. Measurements of light uxes are important for lasers, astronomy, photography. (u cos(v), u sin(v), u2 ) where ru rv = 2 1 We get S F dS = 0 0 (2u2 cos(v)
b d
FLUX INTEGRAL OF A VECTOR FIELD THROUGH SURFACE. If S is a surface, and F is a vector eld in space we dene an integral S F dS which is called the ux of F through the surface S.
DEFINITION. Given a surface S = r(R), where R is a domain in the plane and where r(u, v) = (x(u, v), y(u, v), z(u, v)) is the parameterization of the surface. The ux integral of F through S is dened as the double integral
S
dS F
F dS =
The notation dS = (ru rv ) dudv means an innitesimal vector in the normal direction at the surface. INTERPRETATION. If F = uid velocity eld, then
S
EXAMPLE. Let F (x, y, z) = (0, 1, z 2) and let S be the sphere with r(u, v) = (cos(u) sin(v), sin(u) sin(v), cos(v)) , ru rv = sin(v)r so that F (r(u, v)) = (0, 1, cos (v)) and
2 0 0 2
sin(v)(0, 1, cos2 (v)) (cos(u) sin(v), sin(u) sin(v), cos(v)) dudv . The integral is
2 0 0
Look at the vector eld. Most ux passes in at the south pole, most ux passes out at the north pole. However, there is some symmetry and what enters in the south leaves in the north. This explains why the total ux is zero. WHAT IS THE FLUX INTEGRAL? Because n = ru rv /|ru rv | is a unit vector normal to the surface and on the surface, F n is the normal component of the vector eld with respect to the surface, we can write F n dS. The function F n is the scalar projection of of F in the normal direction. Whereas S F dS = the formula 1 dS gave the area of the surface with dS = |ru rv |dudv, the ux integral weights each area element dS with the normal component of the vector eld f (u, v) = (F (r(u, v)) n(r(u, v)). BIKING IN THE RAIN. I experience (like last Monday) that during rain one gets soaked more by the rain when biking fast then by biking slow or walking foot. Why? For a biker who drives with speed V along the x axis, the rain is a uid with velocity F = (V, 0, W ), where W is the speed of the rain drops falling along the z-axis. If the biker is a rectangular box [0, 1/2][0, 1][1/4, 1/3] we can calculate the ux through that surface. Parameterize the front by r(u, v) = (0, u, v) in the yz-plane. The water soaked up in unit time by the front clothes is the ux of the rain through that surface. We know ru 1/2 1 F dS = 0 (V, 0, W ) (1, 0, 0) dudv = rv = (1, 0, 0) and S 0 V /2. The ux through the side surface is zero (if the rain falls vertically) and the ux through the top is constant, namely W/12. The total ux is W/12 V /2. You catch more rain if you drive faster.
Math21a, O. Knill
DISCOVERY OF STOKES THEOREM Stokes theorem was found by Amp`re in 1825. George Gabriel e Stokes: (1819-1903) was probably inspired by work of Green and rediscovers the identity around 1840.
The ux integral of a vector eld F through a surface S = r(R) is dened as F (r(u, v)) (ru rv ) dudv
The picture shows a tornado near Cordell, OkThe line integral of a vector eld F along a curve C = r([a, b]) is lahoma. Date: May 22, 1981. Photo Credit: NOAA Photo Library, NOAA Central Library. given as b The tornado points into the direction of the F dr = F (r(t)) r (t) dt . eld curl(F ), where F is the velocity of the a C air. Twisters cause annually about 80 deaths in the US. The 17 Illinois twisters last Tuesday killed 8 people
R
EXAMPLE. Calculate the ux of the curl of F (x, y, z) = (y, x, 0) through the surface parameterized by r(u, v) = (cos(u) cos(v), sin(u) cos(v), cos2 (v) + cos(v) sin2 (u + /2)). Because the surface has the same boundary as the upper half sphere, the integral is again 2 as in the above example. For every surface bounded by C the ux of curl(F ) through through the surface is the same. The ux of the curl of a vector eld through a surface S depends only on the boundary of S. Compare this with the earlier statement: For every curve between two points A, B the line integral of grad(f ) along C is the same. The line integral of the gradient of a function of a curve C depends only on the end points of C.
STOKES THEOREM. Let S be a surface with boundary curve C and let F be a vector eld. Then curl(F ) dS =
S C
F dr .
Note: the orientation of C is such that if you walk along the surface (head into the direction of the normal ru rv ), then the surface to your left. EXAMPLE. Let F (x, y, z) = (y, x, 0) and let S be the upper semi hemisphere, then curl(F )(x, y, z) = (0, 0, 2). The surface is parameterized by r(u, v) = (cos(u) sin(v), sin(u) sin(v), cos(v)) on R = [0, 2] [0, /2] and 2 /2 ru rv = sin(v)r(u, v) so that curl(F )(x, y, z)ru rv = cos(v) sin(v)2. The integral 0 0 sin(2v) dvdu = 2. The boundary C of S is parameterized by r(t) = (cos(t), sin(t), 0) so that dr = r (t)dt = ( sin(t), cos(t), 0)dt and F (r(t)) r (t)dt = sin(t)2 + cos2 (t) = 1. The line integral C F dr along the boundary is 2.
SPECIAL CASE: GREENS THEOREM. If S is a surface in the x y plane and F = (M, N, 0) has zero z component, then curl(F ) = (0, 0, Nx My ) and curl(F ) dS = (Nx My ) dxdy.
BIOT-SAVARD LAW. A magnetic eld B in absence of an electric eld satises a Maxwell equation curl(B) = (4/c)j, where j is the current and c is the speed of light. How do we get the magnetic eld B, when the current is known? Stokes theorem can give the answer: take a closed path C which bounds a surface S. The line integral of B along C is the ux of curl(B) through the surface. By the Maxwell equation, this is proportional to the ux of j through that surface. Simple situation. Assume j is contained in a wire of thickness r which we align on the z-axis. To measure the magnetic eld at distance R > r from the wire, we take a curve curl(B) dS = C : r(t) = (R cos(t), R sin(t), 0) which bounds a disc S and measure 2RB = C B ds = S S 4/cj dS = 4J/c, where J is the total current passing through the wire. The magnetic eld satises B = 2J/(cR). This is called the Biot-Savard law. THE DYNAMO, FARADEYS LAW. The electric eld E and the magnetic eld B are linked by a Maxwell equation curl(E) = 1 B. Take a closed wire C which bounds a surface S and consider c BdS, the ux of the magnetic eld through S. Its change can S be related with a voltage using Stokes theorem: d/dt S B dS = B dS = c curl(E) dS = c C E ds = U , where S S U is the voltage measured at the cut-up wire. It means that if we change the ux of the magnetic eld through the wire, then this induces a voltage. The ux can be changed by changing the amount of the magnetic eld but also by changing the direction. If we turn around a magnet around the wire, we get an electric voltage. That is what happens in a power-generator like an alternator in a car. In Dynamo implementations, the wire is turned inside a xed magnet.
PROOF OF STOKES THEOREM. For a surface which is at, Stokes theorem can be seen with Greens theorem. If we put the coordinate axis so that the surface is in the xy-plane, then the vector eld F induces a vector eld on the surface such that its 2D curl is the normal component of curl(F ). The reason is that the third component N x My of curl(F ) = (Py Nz , Mz Px , Nx My ) is the two dimensional curl: F (r(u, v)) (0, 0, 1) = Nx My . If C is F (r(u, v)) (0, 0, 1) dudv = C F (r(t)) r (t)dt. the boundary of the surface, then S For a general surface, we approximate the surface by a mesh of small parallelepipeds. When summing up line integrals along all these parallelepipeds, the lineintegrals inside the surface cancel and only the integral along the boundary remain. On the other hand, the sum of the uxes of the curl through boundary adds up to the ux through the surface.
Math21a, O. Knill
THEOREM. In a simply connected region D, a vector eld F is conservative if and only if curl(F ) = 0 everywhere inside D. Proof. We already know that F = f implies curl(F ) = 0. To show the converse, we verify that the line integral along any closed curve C in D is zero. This is equivalent to the path independence and allows the construction of the potential f with F = f . By assumption, we can deform the curve to a point: if r0 (t) is the original curve and r1 (t) is the curve r1 (t) = P which stays at one point, dene a parametrized surface S by r(t, s) = rs (t). By assumption, curl(F ) = 0 and therefore the ux of curl(F ) through S is zero. By Stokes theorem, the line integral along the boundary C of the surface S is zero too. THE NASH PROBLEM. Nash challenged his multivariable class in the movie A beautiful mind with a problem, where the region is not simply connected.
F f
STOKES:
curl(F ) dS =
F dr
F (r(t)) r (t) dt
CURL(GRAD)=0:
f =0
CONSERVATIVE FIELDS. F is conservative if is a gradient eld F = f . The fundamental theorem of line integral implies that the line integral along closed curves is zero and that line integrals are path independent. We have also seen that F = grad(f ) implies that F has zero curl. If we know that F is conservative, how do we compute f ? If F = (M, N, P ) = (fx , fy , fz ), we got f by integration. There is an other method which you do in the homework in two dimensions: to get the potential value f , nd a path CP from the origin to the point P = (x, y, z) and compute C F dr. Because line integrals are path independent, the fundamental theorem of line integrals gives C F dr = f (P ). CONNECTED. A region is called connected if one can connect any two points in the region with a path. SIMPLY CONNECTED. A region is called simply connected if it is connected and every path in the region can be deformed to a point within the region. EXAMPLES 2D:
Find a region X of R3 with the property that if V is the set of vector elds F on R3 \ X which satisfy curl(F ) = 0 and W is the set of vector elds F which are conservative: F = f . Then, the space V /W should be 8 dimensional.
You solve this problem as an inclass exercise (ICE). The problem is to nd a region D in space, in which one can nd 8 dierent closed paths Ci so that for every choice of constants (c1 , ..., c8 ), one can nd a vector eld F which has zero curl in D and for which one has C1 F dr = c1 , ..., C8 F dr = c8 . One of the many solutions is cut out 8 tori from space. For each torus, there is a vector eld Fi (a vortex ring), which has its vorticity located inside the ring and such that the line integral of a path which winds once around the ring is 1. The vector eld F = c1 F1 + ... + c8 F8 has the required properties. CLOSED SURFACES. Surfaces with no boundaries are called closed surfaces. For example, the surface of a donought, or the surface of a sphere are closed surfaces. A half sphere is not closed, its boundary is a circle. Half a doughnut is not closed. Its boundary consists of two circles. THE ONE MILLION DOLLAR QUESTION. One of the Millenium problems is to determine whether any three dimensional space which is simply connected is deformable to a sphere. This is called the Poincare conjecture. LINEINTEGRAL IN HIGHER DIMENSIONS. Line integrals are dened in the same way in higher dimensions. F dr, where is the dot product in d dimensions and dr = r (t)dt. C d 2 components. In 4 dimensions, it has 6 components. In 2 dimensions it has 1 component, in 3 dimensions, it has 3 components. CURL IN HIGHER DIMENSIONS. In d-dimensions, the curl is the eld curl(F )ij = xj Fi xi Fj with SURFACE INTEGRAL IN HIGHER DIMENSIONS. In d dimensions, a surface element in the ij-plane is written as dSij . The ux integral of the curl of F through S is dened as curl(F ) dS, where the dot product is i<j curl(F )ij dSij . If S is given by a map X from a domain R in the 2-plane to Rd , U = u X and V = v X are tangent vectors to that plane and dSij (u, v) = (Ui Vj Uj Vi ) dudv.
Simply connected.
Simply connected.
EXAMPLES 3D:
The complement of a solid A solid ball is simply con- A solid torus is not simply The complement of a solid torus is not simply conball is simply connected. nected. connected. nected.
STOKES THEOREM IN HIGHER DIMENSIONS. If S is a two dimensional surface in d-dimensional space and C is its boundary, then S curl(F ) dS = C F ds.
Math 21a
In this ICE, you solve Nashs problem, he gave to a multivariable calculus class. Remember Nash saying in the movie A beautiful mind: This problem here will take some of you many months to solve, for others amoung you it might take a life time. You will solve it here in 10 minutes ...
NASHs PROBLEM. Find a subset X of R3 with the property that if V is the set of vector elds F on R3 \ X which satisfy curl(F ) = 0 and W is the set of vector elds F which are conservative: F = f . Then, the space V /W should be 8 dimensional. Remark. The meaning of the last sentence means that there should be 8 vectorelds Fi which are not gradient elds and which have vanishing curl outside X. Furthermore, you should not be able to write any of the 8 vectorelds as a sum of multiples of the other 7 vector elds. Here is a two dimensional version of the problem: 2D VERSION OF NASHs PROBLEM. If X = {0} and V is the set of vector elds F on R2 \ X which satisfy curl(F ) = 0 and W is the set of vector elds F which are gradient elds, then dim(V /W ) = 1. The vector eld F is F (x, y) = (y/(x2 + y 2 ), x/(x2 + y 2 )) has vanishing curl in R2 \ X but the line integral around the origin is 2. It is not a gradient eld. Now: What set X would you have to take to get dim(V /W ) = 8?
The SOLUTION OF THE 3D VERSION OF NASHs PROBLEM can be obtained directly from the solution of the 2D version. How?
Math21a, O. Knill
CURL (3D). The curl of a 3D vector eld F = (P, Q, R) is dened as the 3D vector eld curl(P, Q, R) = (Ry Qz , Pz Rx , Qx Py ) . CURL (2D). Recall, the curl of a 2D vector eld F = (P, Q) is Qx Py , a scalar eld.
THERMODYNAMICS. Gases or liquids are often described in a P V diagram, where the volume in the x-axis and the pressure in the y axis. A periodic process like the pump in a refrigerator leads to closed curve : r(t) = (V (t), p(t)) in the V p plane. The curve is parameterized by the time t. At a given time, the gas has volume V (t) and a pressure p(t). Consider the vector eld F (V, p) = (p, 0) and a closed curve . What is t t t F ds? Writing it out, we get 0 (p(t), 0) (V (t), p (t) dt = 0 p(t)V (t)dt = 0 pdV . The curl of F (V, p) is 1. You see by Greens theorem the integral
t 0
MAXWELL EQUATIONS (in homework you assume no current j = 0 and charges = 0. c = speed of light. div(B) = 0 curl(E) = 1 Bt c curl(B) = 1 Et + c div(E) = 4 No monopoles Faradays law Amp`res law e Gauss law there are no magnetic monopoles. change of magnetic ux induces voltage current or change of E produces magnetic eld electric charges are sources for electric eld
4 c j
WANTED! Is there a multivariable calculus book in which the above wheel is not shown? The wheel indicates the curl vector if F is thought of as a wind velocity eld. As we will see later the direction in which the wheel turns fastest, is the direction of curl(F ). The wheel could actually be used to measure the curl of the vector eld at each point. In situations with large vorticity like in a tornado, one can see the direction of the curl. DIV (3D). The divergence of F = (P, Q, R) is the scalar eld div(P, Q, R) = F = Px + Qy + Rz . DIV (2D). The divergence of a vector eld F = (P, Q) is div(P, Q) = F = Px + Qy . NABLA CALCULUS. With the vector This is both true in 2D and 3D. = (x , y , z ), we can write curl(F ) = F and div(F ) = F.
2D MAXWELL EQUATIONS? In space dimensions d dierent than 3 the electromagnetic eld has d(d + 1)/2 components. In 2D, the magnetic eld is a scalar eld and the electric eld E = (P, Q) a vector eld. The 2D d Maxwell equations are curl(E) = 1 dt B, div(E) = 4. Consider a region R bounded by a wire . Greens c theorem tells us that d/dt R B(t) dxdy is the line integral of E around the boundary. But Eds is a voltage. A change of the magnetic eld produces a voltage. This is the dynamo in 2D. We will see the real dynamo next week in 3D, where electromagnetism works (it would be dicult to generate a magnetic eld in atland). If v is the velocity distribution of a uid in the plane, then (x, y) = curl(v)(x, y) is the vorticity of the uid. The integral R dxdy is called the vortex ux through R. Greens theorem assures that this ux is related to the circulation on the boundary. FLUID DYNAMICS. v velocity, density of uid. Continuity equation Incompressibility Irrotational + div(v) = 0 div(v) = 0 curl(v) = 0 no uid get lost incompressible uids, in 2D: v = grad(u) irrotation uids
LAPLACE OPERATOR. f = divgrad(f ) = fxx + fyy + fzz can be written as 2 f because div(grad(f ). One can extend this to vectorelds F = (P, Q, R) and writes 2 F .
( f) =
IDENTITIES. While direct computations can verify the identities to the left, they become evident with Nabla calculus from formulas for vectors like v v = 0, v v w = 0 or u (v w) = v(u w) (u v)w. div(curl(F )) = 0. curlgrad(F ) = 0 curl(curl(F )) = grad(div(F ) (F )). F = 0. F = 0. F = (
2
F) (
)F .
A RELATED THEOREM. If we rotate the vector eld F = (P, Q) by 90 degrees = /2 we get a new vector eld G = (Q, P ). The integral F ds becomes a ux G dn of G through the boundary of R, where dn is a normal vector with the length of dr. With div(F ) = (Px + Qy ), we see that curl(F ) = div(G). Greens theorem now becomes div(G) dxdy = G dn ,
R
QUIZZ. Is there a vector eld G such that F = (x + y, z, y ) = curl(G)? Answer: no because div(F ) = 1 is incompatible with divIcurl(G)) = 0. ADDENDA TO GREENS THEOREM. Greens theorem, one of the advanced topics in this course is useful in physics. We have already seen the following applications Simplify computation of double integrals Simplify computation of line integrals Formulas for centroid of region Formulas for area Justifying, why mechanical integrators like the planimeter works.
where dn(x, y) is a normal vector at (x, y) orthogonal to the velocity vector r (x, y) at (x, y). This new theorem has a generalization to three dimensions, where it is called Gauss theorem or divergence theorem. Dont treat this however as a dierent theorem in two dimensions. It is in two dimensions just Greens theorem disguised. There are only 2 basic integral theorems in the plane: Greens theorem and the FTLI. PREVIEW. Greens theorem is of the form R F = R F , where F is a derivative and R is a boundary. There are 2 such theorems in dimensions 2, three theorems in dimensions 3, four in dimension 4 etc. In the plane, Greens theorem is the second one besides the fundamental theorem of line integrals FTLI. In three dimensions, there are two more theorems beside the FTLI: Stokes and Gauss Theorems which we will see in the next week. dim 1D 2D 2D dim(R) 1 1 2 theorem Fund. thm of calculus
APROPOS PLANIMETER. The cone planimeter is a mechanical instrument to nd the antiderivative of a function f (x). It uses the fact that the vector eld F (x, y) = (y, 0) has curl(F ) = 1. By Greens theorem, the line integral around the type I region bounded by 0 and the graph of f (x) in the counter clockwise x direction is a f (x) dx. The planimeter determines that line integral.
dim 3D 3D 3D
dim(R) 1 2 3
11 12 21
13 33 31
f F F
Math21a, O. Knill
DIV. The divergence of a vector eld F is div(P, Q, R) = F = Px + Qy + Rz . It is a scalar eld. The ux integral of a vector eld F through a surface S = r(R) was dened as S F dS = R F (r(u, v)) ru rv dudv. f dV = f (x, y, z) dxdydz. Recall also that the integral of a scalar function f on a region R is R G GAUSS THEOREM or DIVERGENCE THEOREM. Let G be a region in space bounded by a surface S and let F be a vector eld. Then div(F ) dV =
G S
GRAVITY INSIDE THE EARTH. How much do we weight deep in earth at radius r from the center of the earth? (Relevant in the movie The core) The law of gravity can be formulated as div(F ) = 4, where is the mass density. We assume that the earth is a ball of radius R. By rotational symmetry, the gravitational force is normal to the surface: F (x) = F (r)x/||x||. The ux of F through a ball of radius r is F (x) dS = 4r2 F (r). By Sr the divergence theorem, this is 4Mr = 4 (x) dV , Br where Mr is the mass of the material inside Sr . We have 2 3 2 2 3 2 (4) r /3 = 4r F (r) for r < R and (4) R /3 = 4r F (r) for r R. Inside the earth, the gravitational force F (r) = 4r/3. Outside the earth, it satises F (r) = M/r 2 with M = 4R3 /3.
0.5
1.5
F dS . WHAT IS THE BOUNDARY OF A BOUNDARY? The fundamental theorem for lineintegral, Greens theorem, Stokes theorem and Gauss theorem are all of the form A dF = A F , where dF is a derivative of F and A is a boundary of A. They all generalize the fundamental theorem of calculus. There is some similarity in how d and behave: f scalar eld F vector eld ddf = curl grad(f ) = 0 ddF = div curl(F ) = 0 S surface in space G region in space S is union of closed curves G is a closed surface S = G =
The orientation of S is such that the normal vector ru rv points outside of G. EXAMPLE. Let F (x, y, z) = (x, y, z) and let S be sphere. The divergence of F is constant 3 and The ux through the boundary is G div(F ) dV = 3 4/3 = 4. S r ru rv dudv = 2 |r(u, v)|2 sin(v) dudv = 0 0 sin(v) dudv = 4 also. S CONTINUITY EQUATION. If is the density of a uid and let v be the velocity eld of the uid, then v dS of the uid through a closed surface S bounding a region G is by conservation of mass, the ux S d/dt G dV , the change of mass inside G. But this ux is by Gauss theorem equal to G div(v) dV . div(v) dV = 0. Taking a very small ball G around a point (x, y, z), where f dV Therefore, G G f (x, y, z) gives div(v). This is called the continuity equation. EXAMPLE. What is the ux of the vector eld F (x, y, z) = (2x, 3z 2 + y, sin(x)) through the box G = [0, 3] [0, 2] [1, 1]? Answer: Use the divergence theorem: div(F ) = 2 and so div(F ) dV = 2 dV = 2Vol(G) = 24. G G Note: Often, it is easier to evaluate a three dimensional integral than a ux integral because the later needs a parameterization of the boundary, which requires the calculation of ru rv etc. PROOF OF THE DIVERGENCE THEOREM. Consider a small box [x, x + dx] [y, y + dy] [z, z + dz]. Call the sides orthogonal to the x axis x-boundaries etc. The ux of F = (P, Q, R) through the x-boundaries is [F (x + dx, y, z) (1, 0, 0) + F (x, y, z) (1, 0, 0)]dydz = P (x + dx, y, z) P (x, y, z) = Px dxdydz. Similarly, the ux through the y-boundaries is Py dydxdz and the ux through the z-boundary is Pz dzdxdy. The total ux through the boundary of the box is (Px + Py + Pz )dxdydz = div(F )dxdydz. For a general body, approximate it with a union of small little cubes. The sum of the uxes over all the little cubes is sum of the uxes through the sides which do not touch an other box (uxes through touching sides cancel). The sum of all the innitesimal uxes of the cubes is the ux through the boundary of the union. The sum of all the div(F )dxdydz is a Riemann sum approximation for the integral G div(F )dxdydz. In the limit, where dx, dy, dz goes to zero, we obtain Gauss theorem. VOLUME CALCULATION. Similarly as the planimeter allowed to calculate the area of a region by passing along the boundary, the volume of a region can be determined as a ux integral. Take for example the vector eld F (x, y, z) = (x, 0, 0) which has divergence 1. The ux of this vector eld through the boundary of a region is the volume of the region. (x, 0, 0) dS = Vol(G). G
The question when div(F ) = 0 implies F = curl(G) or whether curl(F ) = 0 implies G = grad(G) is interesting. We look at it Friday. STOKES AND GAUSS. Stokes theorem was found by Ampere in 1825. George Gabriel Stokes: (1819-1903) was probably inspired by work of Green and rediscovers the identity around 1840. Gauss theorem was discovered 1764 by Joseph Louis Lagrange. Carl Friedrich Gauss, who formulates also Greens theorem, rediscovers the divergence theorem in 1813. Green also rediscovers the divergence theorem in 1825 not knowing of the work of Gauss and Lagrange.
GREEN IDENTITIES. If G is a region in space bounded by a surface S and f, g are scalar functions, then with f = 2 f = fxx + fyy + fzz , one has as a direct consequence of Gauss theorem the rst and second Green identities (see homework) (f g + f g) dV = f g dS (f g gf ) dV = (f g g f ) dS G S G S These identities are useful in electrostatics. Example: if g = f and f = 0 and either f = 0 on the boundary | f |2 dV = 0 which means f = 0. This can S or f is orthogonal to S, then Greens rst identity gives G be used to prove uniqueness for the Poisson equation h = 4 when applying the identity to the dierence f = h1 h2 of two solutions with either Dirichlet boundary conditions (h = 0 on S) or von Neumann boundary conditions ( h orthogonal to S). GAUSS THEOREM IN HIGHER DIMENSIONS. If G is a n-dimensional hyperspace bounded by a (n 1) dimensional hypersurface S, then G div(F )dV = S F dS. DIV. In dimension d, the divergence is dened div(F ) = divergence theorem is done as in three dimensions. F =
i
By the way: Gauss theorem in two dimensions is just a version of Greens theorem. Replacing F = (P, Q) with G = (Q, P ) gives curl(F ) = div(G) and the ux of G through a curve is the lineintegral of F along the curve. Greens theorem for F is identical to the 2D-divergence theorem for G.
Math21a, O. Knill
BOXED OVERVIEW. All integral theorems are of the form R F = R F , where F is a derivative and R is a boundary. There are 2 such theorems in dimensions 2, three theorems in dimensions 3, four in dimension 4 etc. dim 1D 2D 2D dim(R) 1 1 2 theorem Fund. thm of calculus dim 3D 3D 3D dim(R) 1 2 3 theorem Fundam. thm of line integrals Stokes theorem Divergence theorem
ZWICKYS VIEW. Fritz Zwicky was an astronomer who also devised the morphological method for creativity. The method is one of many tools to solve problems which require new ideas. Zwicky was highly creative himself. The idea of the supernovae, dark matter and many pulsar discoveries can be attributed to him. In 1948 for example, Zwicky suggested to use extraterrestrial sources to reconstruct the universe. This should begin with changing other planets, moons and asteroids by making them inhabitable and to change their orbits around the sun in order to adjust their temperature. He even suggested to alter the fusion of the sun to make displace our own space solar system towards an other planetary system. Zwickies morphological method is to organize ideas in boxes like a spreadsheet. For example, if we wanted to make order in the zoo of integral theorems we have seen now, we would one coordinate to display the dimension, in which we work and the second coordinate the maximal dimension along which we integrate in the theorem. 1 Fundamental theorem of calculus Fundamental theorem of line integrals Fundamental theorem of line integrals 2 Greens theorem Stokes theorem 3 Gauss theorem
11 12 21
13 33 31
f F F
MAXWELL EQUATIONS. c is the speed of light. div(B) = 0 curl(E) = 1 Bt c curl(B) = 1 Et + c div(E) = 4 No monopoles Faradays law Amp`res law e Gauss law there are no magnetic monopoles. change of magnetic ux induces voltage current or change of E produces magnetic eld electric charges are sources for electric eld
1 2 3
4 c j
MAGNETOSTATICS: curl(B) = 0 so that B = grad(f ). But since also div(B) = 0, we have f = div(grad(f )) = 0 ELECTROSTATICS. curl(E) = 0 so that E = grad(f ). But since also div(E) = 0, we have f = div(grad(f )) = 0 Static electric and magnetic elds have a harmonic potential. FLUID DYNAMICS. v velocity, density of uid. Continuity equation Incompressibility Irrotational Potential uids + div(v) = 0 div(v) = 0 curl(v) = 0 v = grad(f ), (f ) = 0 no uid get lost incompressible uids no vorticity incompressible, irrotational uids
Fundamental thm of line integrals. We integrate over 1 and 0 dimensional objects. The 0 dimensional object has no boundary.
Green and Stokes theorems. We integrate over 2 and 1 dimensional objects. The 1 dimensional object is a closed curve and has no boundary.
Divergence theorem. We integrate over 3 and 2 dimensional objects. The 2 dimensional object is a closed surface and has no boundary.
Incompressible, irrotational uid velocity elds have a potential which is harmonic HARMONIC FUNCTIONS. A function f (x, y, z) is called harmonic, if f (x, y, z) = 0. Harmonic functions play an important role in physics. For example time independent solutions of the Schrdinger equation i f t = o h f or the heat equation ft = f are harmonic. In uid dynamics, incompressible and irrotational uids with velocity distribution v satisfy v = grad(f ) and since div(v) = 0, also f = 0. Harmonic functions have properties which can be seen nicely using the divergence theorem. MEAN VALUE PROPERTY. The average of a harMAXIMUM PRINCIPLE. A harmonic funcmonic function on a sphere of radius r around a point tion in D can not have a local maximum inside P is equal to the value of the function at the point P . D. You deal with such problems in the homework. They are direct consequences of the divergence theorem. THE PIGEON PROBLEM. A farmer drives a closed van through the countryside. Inside the van are dozens of pigeons. The van weights 200 pounds, the pigeon, an other 100 pounds. The driver has to pass a bridge, which can only sustain 250 pounds. The driver has an idea: if all the pigeon would y while crossing the bridge, a passage would be possible. Question: does the bridge hold? What happens if the cage is open? The ight of the pigeon produces a wind distribution in the cage. The question is whether the ying pigeon will still produces a weight on the van.
One could build now for each of the dierential operators grad, curl and div such a matrix and see whether there is a theorem. Many combinations do not make sense like integrating the curl over a three dimensional object. But there is a theorem, which seem have escaped: if we integrate in two dimensions the div(F ) = M x + Ny over a region R, then there this can be written as an integral over the boundary. There is indeed such a theorem, but it is just a version of Greens theorem in disguise (turn the vector eld by 90 degrees and replace the line by a 2D version of the ux integral). It can be seen as a special case of the divergence theorem in three dimensions and it does not make sense to put it on the footing of the other theorems. Anyway, the morphological method was used in management like in Ciba, it is today just one of a variety of methods to come up with new ideas. IDENTITIES. While direct computations can verify the identities to the left, they become evident with Nabla calculus from formulas for vectors like v v = 0, v v w = 0 or u (v w) = v(u w) (u v)w. div(curl(F )) = 0. curl(grad(F )) = 0 curl(curl(F )) = grad(div(F ) (F )). F = 0. F = 0. F = (
F) (
)F .
QUIZZ. Is there a vector eld G such that F = (x + y, z, y 2 ) = curl(G)? Answer: no because div(F ) = 1 is incompatible with divcurl(G)) = 0.
Math21a, O. Knill
MICHAEL HOPKIN Abstract: Cracking idea gets to the core Astronomer says time is ripe for an unmanned journey to the centre of the Earth.
We have sent probes to Mars, the outer planets and even beyond the farthest reaches of the Solar System - but never to the centre of our own world. Now a planetary scientist has a radical plan to redress the balance. Outer space is trillions upon trillions of times bigger than the Earths interior, and yet we know more about whats out there than we do about whats under our feet, says David Stevenson of the California Institute of Technology in Pasadena. The Earths core is crammed with interesting stu, he says. For example, swirling currents of liquid metal 3,000-5,000 kilometers below the surface are thought to generate the planets magnetic eld. So Stevenson suggests we blast a crack in the Earths surface and pour in thousands of tonnes of molten iron. The iron-lled crack would burrow downwards, closing up behind itself as it descends, and reaching the bowels of the planet in about a week. Concealed in this seething blob of iron would be a grapefruit-sized probe containing instruments to measure temperature, electrical conductivity and chemical composition. The device would send data as sound waves to a surface detector, which would lter the signal from the Earths natural rumblings. Starting the crack would be the tricky part, says Stevenson. He calculates that it would take a blast equivalent to several megatonnes of TNT, an earthquake of magnitude 7 on the Richter scale, or a nuclear device such as those already possessed by many nations. Getting hold of the iron would also be an impressive logistical feat - Stevenson reckons that the experiment would need to commandeer all of the worlds iron foundries for anything from an hour to a week. He is condent, however, that the molten reservoirs sheer size would stop it solidifying before it is poured into the ground. Its an interesting proposition, comments Allan Rubin, who studies the Earths structure at Princeton University in New Haven, Connecticut, but it does make some rather blithe assumptions. We dont even know for denite that the lower mantle can fracture, he points out. Stevenson claims that the cost of his plan would be small beans compared with the riches lavished on space exploration. But he oers prospective investors no guarantee of success: Frankly, I would be surprised if this really works, he admits.
GRAVITY INSIDE THE EARTH. How much do we weight deep in earth at radius r from the center of the earth? (Relevant in the movie The core) The law of gravity can be formulated as div(F ) = 4 where is the mass density. We assume that the earth is a ball of radius R. By rotational symmetry, the gravitational force is normal to the surface: F (x) = F (r)x/||x|| . The ux of F through a ball of radius r is F (x) dS = 4r2 F (r)
Sr
0.5
1.5
(x) dV , By the divergence theorem, this is 4Mr = 4 Br where Mr is the mass of the material inside Sr . We have (4)2 r3 /3 = 4r2 F (r) for r < R and (4)2 R3 /3 = 4r2 F (r) for r R. Inside the earth, the gravitational force F (r) = 4r/3. Outside the earth, it satises F (r) = M/r 2 with M = 4R3 /3.
We have seen above, how the gravitational eld behaves inside a homogeneous body. This would have been a dicult computation without the divergence theorem. Since we know more about the interior of other stars then the interior of our earth, people still think about sending probes to the earth center. One of the rst proposals was by Zwicky who wanted to use tunnels through the earth for travel purposes. One of the recent proposals is to send liquid metal down a crack and let this propagate.
References 1. Stevenson, D. J. Mission to Earths core - a modest proposal. Nature, 423, 239 - 240, (2003).
Math21a,O.Knill
Area 1 dxdy R
b R
1dA
Length a |r (t)| dt Surface area 1dS = |ru rv | dudv Volume B 1 dV = 1 dxdydz B IDENTITIES. div(curl(F )) = 0 curl(grad(f )) = (0, 0, 0) div(grad(f )) = f .
REMARKS. 1) Useful to swap 2D integrals to 1D integrals or the other way round. 2) The curve is oriented in such a way that the region is to your left. 3) The region has to has piecewise smooth boundaries (i.e. it should not look like the Mandelbrot set). b 4) If C : t r(t) = (x(t), y(t)), the line integral is a (M (x(t), y(t)), N (x(t), y(t)) (x (t), y (t)) dt. 5) Greens theorem was found by George Green (1793-1841) in 1827 and by Mikhail Ostrogradski (1801-1862). 6) If curl(F ) = 0 in a simply connected region, then the line integral along a closed curve is zero. If two curves connect two points then the line integral along those curves agrees. 7) Taking F (x, y) = (y, 0) or F (x, y) = (0, x) gives area formulas. PROBLEM. Find the line integral of the vector eld F (x, y) = (x4 + sin(x) + y, x + y 3 ) along the path r(t) = (cos(t), 5 sin(t) + log(1 + sin(t))), where t runs from t = 0 to t = . SOLUTION. curl(F ) = 0 implies that the line integral depends only on the end points (0, 1), (0, 1) of the path. Take the simpler path r(t) = (t, 0), t = [1, 1], which has velocity r (t) = (1, 0). The line integral is 1 4 5 1 1 (t sin(t), t) (1, 0) dt = t /5|1 = 2/5. REMARK. We could also nd a potential f (x, y) = x5 /5 cos(x) + xy + y 5 /4. It has the property that grad(f ) = F . Again, we get f (0, 1) f (0, 1) = 1/5 1/5 = 2/5. STOKES THEOREM. If S is a surface in space with boundary C and F is a vector eld, then
Gradient field
NOTIONSS OF CONSERVATIVE. 1) Gradient: F = grad(f ). 2) Closed curve property: C F dr = 0 for any closed curve. 3) Conservative: Ci paths from A to B, then C1 F dr = C2 F dr. 4) Mixed derivative property: curl(F ) = 0 in simply connected regions.
Conservative
curl(F ) dS =
S C
F ds
TOPOLOGY. 1) Interior of region D: points which have a neighborhood contained in D. 2) Boundary of a curve: endpoints of curve, boundary of 2D region D: curves which bound the region, boundary of a solid D: surfaces which bound the solid. 3) Simply connected region D: a closed curve in D can be deformed within the interior of D to a point. 4) Closed curve Curve without boundary. 5) Closed surface surface without boundary. LINE INTEGRAL THEOREM. If C : r(t) = (x(t), y(t), z(t)), t [a, b] is a curve and f is a function either in 3D or the plane. Then f ds = f (r(b)) f (r(a))
C
REMARKS. 1) Stokes theorem implies Greens theorem if F is z independent and S is contained in the z-plane. 2) The orientation of C is such that if you walk along C and have your head in the direction, where the normal vector ru rv of S, then the surface to your left. 3) Stokes theorem was found by Andr Amp`re (1775-1836) in 1825 and rediscovered by George Stokes (1819e e 1903). 4) The ux of the curl of a vector eld does not depend on the surface S, only on the boundary of S. This is analogue to the fact that the line integral of a gradient eld only depends on the end points of the curve. 5) The ux of the curl through a closed surface like the sphere is zero: the boundary of such a surface is empty. PROBLEM. Compute the line integral of F (x, y, z) = (x3 + xy, y, z) along the polygonal path C connecting the points (0, 0, 0), (2, 0, 0), (2, 1, 0), (0, 1, 0). SOLUTION. The path C bounds a surface S : r(u, v) = (u, v, 0) parameterized by R = [0, 2] [0, 1]. By Stokes theorem, the line integral is equal to the ux of curl(F )(x, y, z) = (0, 0, x) through S. The normal 2 1 vector of S is ru rv = (1, 0, 0) (0, 1, 0) = (0, 0, 1) so that S curl(F ) dS = 0 0 (0, 0, u) (0, 0, 1) dudv = 2 1 u dudv = 2. 0 0 GAUSS THEOREM. If S is the boundary of a region B in space with boundary S and F is a vector eld, then div(F ) dV =
B S
CONSEQUENCES. 1) For closed curves the line integral C f ds is zero. 2) Gradient elds are conservative: if F = f , then the line integral between two points P and Q is path independent. 3) The theorem holds in any dimension. In one dimension, it reduces to the fundamental theorem of calculus b a f (x) dx = f (b) f (a) 4) The theorem justies the name conservative for gradient vector elds. 5) The term potential was coined by George Greeen (1783-1841). PROBLEM. Let f (x, y, z) = x2 + y 4 + z. Find the line integral of the vector eld F (x, y, z) = the path r(t) = (cos(5t), sin(2t), t2 ) from t = 0 to t = 2. f (x, y, z) along
F dS
SOLUTION. r(0) = (1, 0, 0) and r(2) = (1, 0, 4 2 ) and f (r(0)) = 1 and f (r(2)) = 1 + 4 2 . FTLI gives f ds = f (r(2)) f (r(0)) = 4 2 . C GREENS THEOREM. If R is a region with boundary C and F = (M, N ) is a vector eld, then curl(F ) dA =
R C
REMARKS. 1) Gauss theorem is also called divergence theorem. 2) Gauss theorem can be helpful to determine the ux of vector elds through surfaces. 3) Gauss theorem was discovered in 1764 by Joseph Louis Lagrange (1736-1813), later it was rediscovered by Carl Friedrich Gauss (1777-1855) and by George Green. 4) For divergence free vector elds F , the ux through a closed surface is zero. Such elds F are also called incompressible or source free. PROBLEM. Compute the ux of the vector eld F (x, y, z) = (x, y, z 2 ) through the boundary S of the rectangular box [0, 3] [1, 2] [1, 2]. SOLUTION. By Gauss theorem, the ux is equal to the triple integral of div(F ) = 2z over the box: 3 2 2 2z dxdydz = (3 0)(2 (1))(4 1) = 27. 0 1 1
F ds
Math21a,O.Knill
CONSEQUENCES. 1) If curl(F ) = 0 in a simply connected region, then the line integral along a closed curve is zero. If two curves connect two points then the line integral along those curves agrees. 2) Taking F (x, y) = (y, 0) gives an area formula Area(R) = y dx. Similarly Area(A) = xdy. PROBLEM. Find the line integral of the vector eld F (x, y) = (x4 + sin(x) + y, x + y 3 ) along the path r(t) = (cos(t), 5 sin(t) + log(1 + sin(t))), where t runs from t = 0 to t = . SOLUTION. curl(F ) = 0 implies that the line integral depends only on the end points (0, 1), (0, 1) of the path. Take the simpler path r(t) = (t, 0), t = [1, 1], which has velocity r (t) = (1, 0). The line integral is 1 4 5 1 1 (t sin(t), t) (1, 0) dt = t /5|1 = 2/5. REMARK. We could also nd a potential f (x, y) = x5 /5 cos(x) + xy + y 5 /4. It has the property that grad(f ) = F . Again, we get f (0, 1) f (0, 1) = 1/5 1/5 = 2/5. STOKES THEOREM. If S is a surface in space with boundary and F is a vector eld, then
SUMMARY. The FTLI, Green, Stokes and Gauss theorem generalize the fundamental theorem of calculus and are all of the form dR F = R dF , where dR is the boundary of R and dF is a derivative of F . INTEGRATION. Line integral: Surface integral Flux integral: Double integral: Triple integral: DIFFERENTIATION. Derivative: Partial derivative: Gradient: Curl in 2D: Curl in 3D: Div:
b
F ds = a F (r(t)) r (t) dt b d S f dS = a c f (r(u, v))|ru (u, v) rv (u, v)| dudv b d F dS = a c F (r(u, v)) ru (u, v) rv (u, v) dudv S b d f dA = a c f (x, y) dxdy. R b d p f dV = a c o f (x, y, z) dxdydz. R
Area = R 1dA R 1 dxdy Surface area 1dS = |ru rv | dudv 1 dV = Volume B 1 dxdydz B
f (t) = f(t) = d/dtf (t). fx (x, y, z) = f (x, y, z). x grad(f ) = (fx , fy , fz ) curl(F ) = curl((M, N )) = Nx My curl(F ) = curl(M, N, P ) = (Py Nz , Mz Px , Nx My ) div(F ) = div(M, N, P ) = Mx + Ny + Pz .
curl(F ) dS =
S
F ds
LINE INTEGRAL THEOREM. If C : r(t) = (x(t), y(t), z(t)), t [a, b] is a curve and f is a function either in 3D or the plane. Then f ds = f (r(b)) f (r(a))
REMARKS. 1) Stokes theorem reduces to Greens theorem if F is z independent and S is contained in the z-plane. 2) The orientation of is such that if you walk along and have your head in the direction, where the normal vector ru rv of S points, then you have the surface to your left. 3) Stokes theorem was found by Andr Amp`re (1775-1836) in 1825 and rediscovered by George Stokes (1819e e 1903). CONSEQUENCES. 1) The ux of the curl of a vector eld does not depend on the surface S, only on the boundary of S. This is analogue to the fact that the line integral of a gradient eld only depends on the end points of the curve. 2) The ux of the curl through a closed surface like the sphere is zero: the boundary of such a surface is empty. PROBLEM. Compute the line integral of F (x, y, z) = (x3 + xy, y, z) along the polygonal path connecting the points (0, 0, 0), (2, 0, 0), (2, 1, 0), (0, 1, 0).
CONSEQUENCES. 1) If the curve is closed, then the line integral f ds is zero. 2) If F = f , the line integral between two points P and Q does not depend on the chosen path. REMARKS. 1) The theorem holds in any dimension. In one dimension, it reduces to the fundamental theorem of calculus
b a
2) The theorem justies the name conservative for gradient vector elds. 3) In physics, f is the potential energy and f a force. The theorem says that such forces lead to energy conservation. 4) The term potential was coined by George Greeen (1783-1841). PROBLEM. Let f (x, y, z) = x + y + z. Find the line integral of the vector eld F (x, y, z) = the path r(t) = (cos(5t), sin(2t), t2 ) from t = 0 to t = 2.
2 4
SOLUTION. The path bounds a surface S : r(u, v) = (u, v, 0) parameterized by R = [0, 2] [0, 1]. By Stokes theorem, the line integral is equal to the ux of curl(F )(x, y, z) = (0, 0, x) through S. The normal 2 1 vector of S is ru rv = (1, 0, 0) (0, 1, 0) = (0, 0, 1) so that curl(F ) dS = 0 0 (0, 0, u) (0, 0, 1) dudv = S 2 1 u dudv = 2. 0 0 GAUSS THEOREM. If S is the boundary of a region B in space with boundary S and F is a vector eld, then div(F ) dV =
B S
f (x, y, z) along
F dS
SOLUTION. r(0) = (1, 0, 0) and r(2) = (1, 0, 4 2 ) and f (r(0)) = 1 and f (r(2)) = 1 + 4 2 . Applying the fundamental theorem gives f ds = f (r(2)) f (r(0)) = 4 2 . GREENS THEOREM. If R is a region with boundary and F = (M, N ) is a vector eld, then curl(F ) dA =
R
REMARKS. 1) Gauss theorem is also called divergence theorem. 2) Gauss theorem can be helpful to determine the ux of vector elds through surfaces. 3) Gauss theorem was discovered in 1764 by Joseph Louis Lagrange (1736-1813), later it was rediscovered by Carl Friedrich Gauss (1777-1855) and by George Green. CONSEQUENCE. For divergence free vector elds F , the ux through a closed surface is zero. Such elds F are also called incompressible or source free. PROBLEM. Compute the ux of the vector eld F (x, y, z) = (x, y, z 2 ) through the boundary S of the rectangular box [0, 3] [1, 2] [1, 2]. SOLUTION. By Gauss theorem, the ux is equal to the triple integral of div(F ) = 2z over the box: 3 2 2 0 1 1 2z dxdydz = (3 0)(2 (1))(4 1) = 27.
F ds
REMARKS. 1) Useful to swap 2D integrals to 1D integrals or the other way round. 2) The curve is oriented in such a way that the region is to your left. 3) The region has to has piecewise smooth boundaries (i.e. it should not look like the Mandelbrot set). b 4) If : t r(t) = (x(t), y(t)), the line integral is a (M (x(t), y(t)), N (x(t), y(t)) (x (t), y (t)) dt. 5) Greens theorem was found by George Green (1793-1841) in 1827 and by Mikhail Ostrogradski (1801-1862).
Math21a, O. Knill
LAGRANGE. Joseph-Louis Lagrange (1736-1813) worked in all elds of analysis and number theory and analytical and celestial mechanics. Gauss theorem was discovered in 1764 by Joseph Louis Lagrange.
` AMPERE. Andr Marie Amp`re (1775-1836) made contributions to the theory e e of electricity and magnetism. Stokes theorem was found by Amp`re in 1825. e
Gossip: Gossip: While still only 13 years old Amp`re submitted his rst paper to the Acadmie de Lyon. Amper`s father e e e died during the French Revolution. He went to the guillotine writing to Amp`res mother from his cell: e I desire my death to be the seal of a general reconciliation between all our brothers; I pardon those who rejoice in it, those who provoked it, and those who ordered it.... Amp`e had a dicult time with his daughter. She married one of Napoleons lieutenants who was an r alcoholic. The marriage soon was in trouble. Amp`res daughter ed to her fathers house and Amp`re e e allowed later her husband to live with him also. This proved a dicult situation, led to police intervention and much unhappiness for Amp`re. e Lagrange is usually considered a French mathematician. But some refer to him as an Italian mathematician because Lagrange was born in Turin. Only the intervention of Lavoisier saved Lagrange during the French revolution from the guillotine because a law was established arresting all foreign born people. Lavoisier himself was guillotined shortly after. Lagrange rst wife was his cousin. They had no children. In fact, Lagrange had told dAlembert in this letter that he did not wish to have children. His rst wife died after years of illness. Napoleon named Lagrange to the Legion of Honor and Count of the Empire in 1808. On April 3, 1813 Lagrange was named grand croix of the Ordre Imprial de la Runion. He died a week later. e e
GAUSS. Carl Friedrich Gauss (1777-1855) worked in a wide variety of elds both in mathematics and physics like number theory, analysis, dierential geometry, geodesy, magnetism, astronomy and optics. Gauss theorem was discovered 1764 by Joseph Louis Lagrange.
OSTROGRADSKI. Mikhail Vasilevich Ostrogradski (1801-1862) worked on integral calculus, mathematical physics like hydrodynamics and partial dierential equations. He worked also in algebra and dierential equations, theoretical mechanics and wrote several textbooks.
Gossip: Gossip: At the age of seven, while starting elementary school his potential was noticed almost immediately. His teacher, Bttner, and his assistant, Martin Bartels, were amazed when Gauss summed up the integers u from 1 to 100 instantly by spotting that the sum was 50 pairs of numbers each pair summing to 101. It seems that Gauss knew already about non-Euclidean geometry at the age of 15. Gauss married twice. Both wives died, the rst from the birth of a child, the second after a long illness. STOKES. George Gabriel Stokes (1819-1903) established the science of hydrodynamics with his law of viscosity describing the velocity of a small sphere through a viscous uid. Stokes discovery of Stokes theorem (around 1840) was probably inspired by work of Green. Ostrogradski wanted actually to pursue a military carrier. Financial considerations however led him to a career in the civil service which needed a university education. He studied physics and mathematics. He successfully nished his exams but the minister of religious aairs and national education refused to conrm the decision. Ostrogradski therefore never got a degree. He left Russia to study in Paris, between 1822 and 1827 Ostrogradski attended lectures by Laplace, Fourier, Legendre, Poisson and Cauchy.
GREEN. George Green (1793-1841) discovered Greens theorem in 1827. Green also rediscovers the divergence theorem in 1825 not knowing of the work of Gauss and Lagrange.
Gossip: Gossip: Green studied mathematics on the top oor of his fathers mill, entirely on his own. The years between 1823 and 1828 were not easy for Green: As well as having a full time job in the mill, two daughters were born, the one in 1824 mentioned above, and a second in 1827. Between these two events his mother had died in 1825 and his father was to die in 1829. Yet despite the dicult circumstances and despite his imsy mathematical background, Green published one of the most important mathematical works of all time in 1828. Green was the son of a baker: from a short obituary in the Nottingham Review which showed they knew little of his life and less of the importance of his work. ... Through Thomson, Maxwell, and others, the general mathematical theory of potential developed by an obscure, self-taught millers son would lead to the mathematical theories of electricity underlying twentieth-century industry. In 1857 Stokes had to give up his fellowship at Pembroke College because fellows at Cambridge had then to be unmarried. Later, after a change in the rules in 1862 Stokes was able to take up the fellowship at Pembroke again. While Stokes became engaged, he used to express his feelings to his bride Mary Susanna Robinson in rather mathematical terms: I too feel that I have been thinking too much of late, but in a dierent way, my head running on divergent series, the discontinuity of arbitrary constants ... . Such words did not reveal the love that Mary hoped to nd in them and when Stokes wrote her a 55 page (!) letter about the duty he felt towards her, she came close to calling o the wedding. SOURCES. The sources include E.T. Whittakers A History of the Theories of Ether and Electricity and the MacTutor History of Mathematics http://turnbull.dcs.st-and.ac.uk/history/.
Math21a, O. Knill
GREENS THEOREM AND LAPLACIAN. Assume R is a region in the plane and let n denote the unit normal vector to the boundary C of R. For any function u(x, y), we use the notation f /u = grad(u) n which is the directional derivative of u into the direction n normal to C. We also use the notation u = uxx + uyy . Show that u/n dr = u dA
C R
SUMMARY. This is a collection of problems on line integrals, Greens theorem, Stokes theorem and the divergence theorem. Some of them are more challenging. LINE INTEGRALS GREEN THEOREM. The curve r(t) = (cos3 (t), sin3 (t)) is called a hypocycloid. It bounds a region R in the plane. a) Calculate the line integral of the vector eld F (x, y) = (x, y) along the curve. b) Find the area of the hypocycloid. a) Because curl(F ) = 0 the result is zero by Greens theorem. b) Use the vector eld F (x, y) = (0, x) which has curl(F ) = 1. The 2 2 line integral is 0 F (r(t)) r (t) dt = 0 cos3 (t)3 sin2 (t) cos(t) dt 2 2 4 = 0 3 cos (t) sin (t) dt = 3/8. (To compute the integral, use that 8 cos4 (t) sin2 (t) = cos(2t) sin2 (2t) + sin2 (2t)). LENGTH OF CURVE AND LINE INTEGRALS. Assume C : t r(t) is a closed path in space and F (r(t)) is the unit tangent vector to the curve (that is a vector parallel to the velocity vector which has length 1). a) What is C F dr? b) Can F be a gradient eld? Answer: a) F (r(t)) = r (t)/|r (t)|. By denition of the line integral,
b
Answer: Dene F (x, y) = (B, A) if u/n = (A, B). The left integral is the line integral of F along C. The right integral is the double integral over u = curl(F ).
Answer. The integral is zero because the boundary of S is empty. This fact can be seen using Stokes theorem. It can also been seen by divergence theorem curl(F ) dS =
S
divcurl(F ) dV .
using div(curl)(F ) = 0. AREA OF POLYGONS. If Pi = (xi , yi ), i = 1, . . . , n are the edges of a polygon in the plane, then its area is A = i (xi xi+1 )(yi+1 + yi )/2. The proof is an application of Greens theorem. The line integral of the vector eld F (x, y) = (y, 0) through the side Pi , Pi+1 is (xi xi+1 )(yi+1 + yi )/2, because (xi+1 xi ) is the projected area onto the x-axis and (yi+1 + yi )/2 is the average value of the vector eld on that side. Because curl(F )(x, y) = 1 for all (x, y), the result follows from Greens theorem. The result can also be seen geometrically: (xi xi+1 )(yi+1 + yi )/2 is the signed area of the trapezoid (xi , 0), (xi+1 , 0), (xi+1 , yi+1 ). In the picture, we see two of them. The second one is taken negatively. VOLUME OF POLYHEDRA. Verify with the divergence theorem: If Pi = (xi , yi , zi ) are the edges of a polyhedron in space and Fj = {Pi1 , ...Pikj } are the faces, then V = j Aj z j where Aj is the area of the xy-projection (*) of the polygon Fj and z j = (zi1 + ... + zkj )/kj is the average z value of the face Fj . Solution. The vector eld F (x, y, z) = z has divergence 1. The ux through a face F is |Fj |(zi1 + ... + zkj )/kj . Gauss theorem assures that the volume is the sum of the uxes Aj z j through the faces.
(*) The projection of a polygon is the shadow when projecting from space along the z-axes onto the xy-plane. A triangle (1, 0, 1), (1, 1, 0), (0, 1, 2) for example would be projected to the triangle (1, 0), (1, 1), (0, 1).
F (r(t)) r (t) dt =
C a
|r (t)| dt ,
a
which is the length of the curve. b) No: If F were a gradient eld, then by the fundamental theorem of line integrals, we would have that the line integral along a closed curve is zero. But because this is the length of the curve, this is not possible. SURFACE AREA AND FLUX. Assume S : (u, v) r(u, v) is a closed surface in space and F (r(u, v)) is the unit normal vector on S (which points in the direction of ru rv ). F dS? a) What is S b) Is it possible that F is the curl of an other vector eld? c) Is it possible that div(F ) = (0, 0, 0) everywhere inside the surface. Answer: a) F (r(u, v)) = (ru rv )/|ru rv |. By denition of the ux integral, F dS = F (r(u, v)) ru rv = (r rv /|ru rv |) ru rv = S R R u R |ru rv | dudv which is the area of the surface. b) No, if F were the curl of an other eld G, then the ux of F through the closed surface would be zero. But since it is the area, this is not possible. c) From the divergence theorem follows that div(F ) is nonzero somewhere inside the surface.
STOKES OR GAUSS? STOKES AND GAUSS TOGETHER. Can you derive div(curl(F )) = 0 using Gauss and Stokes theorem? Consider a sphere S of radius r around a point (x, y, z). It bounds a ball G. Consider a vector eld F . The ux of curl(F ) through S is zero because of Stokes theorem. Gauss theorem tells that the integral of f = div(curl(F )) over G is zero. Because S was arbitrary, f must vanish everywhere. Compute the ux of the vector eld F (x, y, z) = (x x sin(sin(z)), 2y, 3z + sin(sin(z))) through the upper hemisphere S = { (x, y, z)| x2 + y 2 + z 2 = 1, z 0}. Answer. We use Gauss: div(F ) = 6 and B div(F ) dV = 6Vol(B) = 4. We can not easily compute the ux through the hemisphere. However, we can see that the ux through the oor of the region is zero because the normal component P of of the vector eld F = (M, N, P ) is zero on z = 0. So: the result is 4 0 = 4. GREENS THEOREM. FUNDAMENTAL THEOREM AND STOKES. Can you derive the identity curl(grad(F )) = 0 from integral theorems? To see that the vector eld G = curl(grad(F )) = 0 is identically zero, it is enough to show that the ux of G trough any surface S is zero. By Stokes theorem, the ux trough S is C grad(F )dr. By the fundamental theorem of line integrals, this is zero. VOLUME COMPUTATION WITH GAUSS. Calculate the volume of the torus T (a, b) enclosed by the surface r(u, v) = ((a + b cos(v)) cos(u), (a + b cos(v)) sin(u), b sin(v)) using Gauss theorem and the vector eld F (x, y, z) = (x, y, 0)/2. The vector eld F has divergence 1. The parameterization of the torus gives ru rv = b(a + b cos(v))(cos(u) cos(v), cos(v) sin(u), sin(v)) . The ux of this vectoreld through the boundary of the torus is 2 2 b(a + b cos(v))2 cos(v) dudv = 2 2 ab2 . 0 0 GAUSS OR STOKES? You know that the ux of the vector eld G = curl(F )(x, y, z) through 5 faces of a cube D is equal to 1 each. What is the ux of the same vector eld G through the 6th face? Solution: the problem is best solved with the divergence theorem: because the ux of G through the entire surface is zero, the ux through the 6th face must cancel the sum of the uxes 5 through the other 5 surfaces. The result is 5.
1 Calculate the work of the vector eld F (x, y) = x2 +y2 (y, x) along the boundary of the ellipse r(t) = (3 cos(t) + sin(t), 5 sin(t) + cos(t)).
Solution. Take an other curve C : x2 +y 2 4 and apply Greens theorem to the region R bounded by the ellipse and the circle. Because curl(F ) is zero in D, the line integral along the ellipse is the same as the line integral along the circle: t r(t) = (2 cos(t), 2 sin(t)) with velocity r (t) = (2 sin(t), 2 cos(t)):
2
F dr =
0
1 dt = 2 .
0
TRUE/FALSE QUESTIONS ON INTEGRAL THEOREMS. (TF) The ux of the curl of a vector eld through the unit sphere is zero. (TF) The line integral of the curl of a vector eld along a closed curve is zero. (TF) The line integral
C
(TF) The maximal speed of a curve is independent on how the curve is parametrized. (TF) The ux integral (TF) The area
S S
(TF) The maximal value of ru rv on a surface S is independent on how the surface is parametrized. (TF) There exists a vector eld in space which has zero divergence, zero curl but is not a constant eld. (TF) There exists a vector eld in space which has zero gradient but is not a constant vector eld F (x, y, z) = (a, b, c). (TF) There exists a function in space which has zero Laplacian fxx + fyy + fzz = 0 but which is not constant.
(TF) div(grad(F )) = 0 and div(curl(F )) = 0 and curl(grad(F )) = 0. (TF) The line integral of a gradient eld along any part of a level curve F = const is zero.
Calculate the work of the vector eld F (x, y, z) = (x y + z, y z + x, z x + y), along the path C which connects the points (1, 0, 0) (0, 1, 0) (0, 0, 1) (1, 0, 0) in that order. Answer. The line integral over each part is each 1. The total is 3. curl(F ) = (2, 2, 2) and S : (u, v) r(u, v) = (u, v, 1 u v) ru rv = (1, 1, 1) S curl(F ) ru rv dudv = 6 area ofS = 3,
(TF) If div(F ) = 0, then the line integral along any closed curve is zero. (TF) If curl(F ) = 0, then the line integral along any closed curve is zero. (TF) If div(F ) = 0 then the ux integral along any sphere in space is zero. (TF) If curl(F ) = 0 then the ux integral along any sphere in space is zero.
Math21a, 2004
SCALAR FUNCTION (2D). (n = 2, m = 1). A function f (x, y) dened in the plane is also called a scalar eld. The graph of f is a curve in space (see gure). Level curves are curves in the plane. A derivative is f (x, y), the gradient.
SCALAR FUNCTION (3D). (n = 3, m = 1). A function f (x, y, z) dened in space is also called a scalar eld. Its graph would be an object in 4D. Level surfaces are surfaces in space (see gure). A derivative is the gradient f (x, y, z).
VECTOR FIELD (2D). (n = 2, m = 2) A function on the plane which attaches a vector (P (x, y), Q(x, y)) to each point (x, y). Derivatives are curl(F ) = Qx Py or div(F ) = Px + Qy both scalar elds (real valued functions). Also coordinate changes T (u, v) = (x(u, v), y(u, v)) are the same mathematical object.
VECTOR FIELD (3D). (n = 3, m = 3) At each point in space, we attach a vector F (x, y, z) = (P (x, y, z), Q(x, y, z), R(x, y, z)) at each point (x, y, z). Derivatives are the curl curl(F ), a vector eld or the divergence div(F ) = Px + Qy + Rz , a scalar eld (real valued functions). Also coordinate changes T (u, v, w) = (x(u, v, w), y(u, v, w), z(u, v, w)) are the same mathematical object.
CURVE (2D). (n = 1, m = 2) For each t is dened a point r(t) = (x(t), y(t)) in the plane. A derivative is r (t) = (x (t), y (t)), the velocity.
CURVE (3D). (n = 1, m = 3) For each t, we have a point r(t) = (x(t), y(t), z(t)) in space. A derivative is r (t) = (x (t), y (t), z (t)), the velocity.
SURFACE (2D). (n = 2, m = 3) For each (u, v) there is a point r(u, v) = (x(u, v), y(u, v), z(u, v)) in space. The normal vector at a point r(u, v) is ru (u, v) rv (u, v).
GLOSSARY CHECKLIST
Geometry of Space
Surfaces polar coordinates (x, y) = (r cos(), r sin()) cylindrical coordinates (x, y, z) = (r cos(), r sin(), z) spherical coordinates (x, y, z) = ( cos() sin(), sin() sin(), cos()) g(r, ) = 0 polar curve, especially r = f (), polar graphs g(r, , z) = 0 cylindrical surface, i.e. r = f (z, ) or r = f (z) surface of revolution g(, , ) = 0 spherical surface especially = f (, ) f (x, y) = c level curves of f (x, y) g(x, y, z) = c level surfaces of g(x, y, z) circle: x2 + y 2 = r2 , r(t) = (r cos t, r sin t). ellipse: x2 /a2 + y 2 /b2 = 1 , r(t) = (a cos t, b sin t) sphere: x2 + y 2 + z 2 = r2 , r(u, v) = (r cos u sin v, r sin u sin v, r cos v) ellipsoid: x2 /a2 + y 2 /b2 + z 2 /c2 = 1, r(u, v) = (a cos u sin v, b sin u sin v, c cos v) line: ax + by = d, r(t) = (t, d/b ta/b) plane: ax + by + cz = d , r(u, v) = r0 + uv + v w, (a, b, c) = v w surface of revolution: r(, z) = f (z), r(u, v) = (f (v) cos(u), f (v) sin(u), v) graph: g(x, y, z) = z f (x, y) = 0, r(u, v) = (u, v, f (u, v))
coordinates and vectors in the plane and in space v = (v1 , v2 , v3 ), w = (w1 , w2 , w3 ), v + w = (v1 + w1 , v2 + w2 , v3 + w3 ) dot product v.w = v1 w1 + v2 w2 + v3 w3 = |v||w| cos() cross product, v.(v w) = 0, w.(v w) = 0, |v w| = |v||w| sin() triple scalar product u (v w) volume of parallelepiped parallel vectors v w = 0, orthogonal vectors v w = 0 scalar projection compw (v) = v w/|w| vector projection projw (v) = (v w)w/|w|2 completion of square: example x2 4x + y 2 = 1 is equivalent to (x 2)2 + y 2 = 3 distance d(P, Q) = |P Q| = (P1 Q1 )2 + (P2 Q2 )2 + (P3 Q3 )2 Lines, Planes, Functions symmetric equation of line (xx0 ) = (yy0 ) = zz0 a b c plane ax + by + cz = d parametric equation for line x = x0 + tv parametric equation for plane x = x0 + tv + sw switch from parametric to implicit descriptions for lines and planes domain and range of functions f (x, y) graph G = {(x, y, f (x, y))} intercepts: intersections of G with coordinate axes traces: intersections with coordinate planes generalized traces: intersections with {x = c}, {y = c} or {z = c} quadrics: ellipsoid, paraboloid, hyperboloids, cylinder, cone, hyperboloid paraboloid plane ax + by + cz = d has normal n = (a, b, c) line (xx0 ) = yy0 = zz0 contains v = (a, b, c) a b c sets g(x, y, z) = c describe surfaces, example graphs g(x, y, z) = z f (x, y) linear equation like 2x + 3y + 5z = 7 denes plane quadratic equation like x2 2y 2 + 3z 2 = 4 denes quadric surface distance point-plane: d(P, ) = |(P Q) n|/|n| distance point-line: d(P, L) = |(P Q) u|/|u| distance line-line: d(L, M ) = |(P Q) (u v)|/|u v| nding plane through three points P, Q, R: nd rst normal vector
Partial Derivatives
fx (x, y) = x f (x, y) partial derivative partial dierential equation PDE: F (f, fx , ft , fxx , ftt ) = 0 ft = fxx heat equation ftt fxx = 0 wave equation fx ft = 0 transport equation fxx + fyy = 0 Laplace equation L(x, y) = f (x0 , y0 ) + fx (x0 , y0 )(x x0 ) + fy (x0 , y0 )(y y0 ) linear approximation tangent line: L(x, y) = L(x0 , y0 ), ax + by = d with a = fx (x0 , y0 ), b = fy (x0 , y0 ), d = ax0 + by0 tangent plane: L(x, y, z) = L(x0 , y0 , z0 ) estimate f (x, y, z) by L(x, y, z) near (x0 , y0 , z0 ) |f (x, y) L(x, y)| in box R around (x0 , y0 ) is M (|x x0 | + |y y0 |)2 /2, where M is the maximal value of |fxx (x, y)|, |fxy (x, y)|, |fyy (x, y)| in R. f (x, y) called dierentiable if fx , fy are continuous fxy = fyx Clairots theorem ru (u, v), rv tangent to surface r(u, v)
Gradient Curves plane and space curves r(t) velocity r (t), Acceleration r (t) unit tangent vector T (t) = r (t)/|r (t)| unit normal vector N (t) = T (t)/|T (t)| r (t) is tangent to the curve t v = r then r = 0 v dt + c r(t) = (f (t) cos(t), r(t) sin(t)) polar curve to polar graph r = f (). r(t) = r0 (1 + )/(1 + cos(t)) ellipse. The three Kepler laws. f (x, y) = (fx , fy ), f (x, y, z) = (fx , fy , fz ), gradient Dv f = if v directional derivative d f (r(t)) r (t) chain rule dt f (r(t)) = f (x0 , y0 , z0 ) is orthogonal to the level surface f (x, y, z) = c which contains (x0 , y0 , z0 ). d f (x + tv) = Dv f by chain rule dt yy0 xx0 zz0 fx (x0 ,y0 ,z0 ) = fy (x0 ,y0 ,z0 ) = fz (x0 ,y0 ,z0 ) normal line to surface f (x, y, z) = c at (x0 , y0 , z0 ) (x x0 )fx (x0 , y0 , z0 ) + (y y0 )fy (x0 , y0 , z0 ) + (z z0 )fz (x0 , y0 , z0 ) = 0 tangent plane at (x0 , y0 , z0 ) directional derivative is maximal in the v = f direction f (x, y) increases, if we walk on the xy-plane in the f direction partial derivatives are special directional derivatives if Dv f (x) = 0 for all v, then f (x) = 0 implicit dierentiation: f (x, y(x)) = 0, fx 1 + fy y (x) = 0 gives y (x) = fx /fy
Extrema f (x, y) = (0, 0), critical point or stationary point 2 D = fxx fyy fxy discriminant or Hessian determinant f (x0 , y0 ) f (x, y) in a neighborhood of (x0 , y0 ) local maximum f (x0 , y0 ) f (x, y) in a neighborhood of (x0 , y0 ) local minimum f (x, y) = g(x, y), g(x, y) = c, Lagrange multiplier two constraints: g = 0 or f = g + h, g = c, h = d second derivative test: f = (0, 0), D > 0, fxx < 0 local max, f = (0, 0), D > 0, fxx > 0 local min, f = (0, 0), D < 0 saddle Double Integrals
R f (x, y) dA double integral b d f (x, y) dydx integral over rectangle a c b g2 (x) f (x, y) dydx type I region a g1 (x) d h2 (y) f (x, y) dxdy type II region c h1 (y)
Greens Theorem F (x, y) = (P, Q), curl(F ) = Qx Py = F . Greens theorem: C boundary of R, then C F dr = R curl(F ) dxdy Area computation: Take F with curl(F ) = Nx My = 1 like F = (y, 0) or F = (0, x) or F = (y, x)/2. Greens theorem is useful to compute dicult line integrals or dicult 2D integrals. Flux integrals F (x, y, z) vector eld, S = r(R) parametrized surface r ru rv normal vector, n = |ru rv | unit normal vector u rv ru rv dudv = dS = n dS normal surface element F dS = F (r(u, v)) (ru rv ) dudv ux integral S S Use also notation S F nd Stokes Theorem F (x, y, z) = (P, Q, R), curl(P, Q, R) = (Ry Qz , Pz Rx , Qx Py ) = F Stokess theorem: C boundary of surface S, then C F dr = curl(F ) dS S Stokes theorem is useful to compute dicult ux integrals of curl(F ) or dicult line integrals. Div Grad Curl
b d a c R
f (x, y) dydx = f (x, y) dxdy Fubini 1 dxdy area of region R f (x, y) dxdy volume of solid bounded by graph(f) xy-plane R
d b c a
Triple Integrals
R b d v a c u f (x, y, z) dydx integral b g2 (x) h2 (x,y) f (x, y) dzdydx a g1 (x) h1 (x,y)
f ,curl(F ) =
F , div(F ) =
type I region f (r, , z) r dzdrd cylindrical coordinates f (, , z) 2 sin() dzdrd spherical coordinates R f (x, y, z) dzdydx = u c a f (x, y, z) dxdydz Fubini V = R 1 dV volume of solid R M= (x, y, z) dV mass of solid R with density R ( R x dV /V, R y dV /V, R z dV /V ) center of mass Line Integrals F (x, y) = (P (x, y), Q(x, y)) vector eld in the plane F (x, y, z) = (P (x, y, z), Q(x, y, z), R(x, y, z)) vector eld in space b C F dr = a F (r(t)) r (t) dt line integral Use also notation C F T ds and M dx + N dy + P dz. F (x, y) = f (x, y) gradient eld = potential eld = conservative Fundamental theorem of line integrals FTL: F (x, y) = f (x, y), F (r(t)) r (t)) dt = f (r(b)) f (r(a)) Closed loop property C F dr = 0, for all closed curves C Always equivalent are: closed loop property, conservativeness and gradient eld Mixed derivative test curl(F ) = 0 assures F is not a gradient eld. In simply connected domains, curl(F ) = 0 implies conservativeness.
b a b d v a c u v d b
div(P, Q, R) = Px + Qy + Rz = F Divergence theorem: E bounded by S then S F dS = E div(F ) dV The divergence theorem is useful to compute dicult ux integrals or dicult 3D integrals. Some topology Simply connected region D: can deform any closed curve within D to a point on curve. Interior of a region D: points in D for which small neighborhood is still in D. Boundary of a curve: the end points of the curve if they exist. Boundary of a surface S are curves which bound the surface, points in the surface which correspond to parameters (u, v) which are not in the interior of the parametrization domain. Boundary of a solid D: the surfaces which bound the solid, points in the solid which are not in the interior of D. Closed surface: a surface without boundary like for example the sphere. Closed curve: a curve with no boundary like for example a knot. Some surface parametrizations Sphere of radius : r(u, v) = ( cos(u) sin(v), sin(u) sin(v), cos(v)) Graph of function f (x, y): f (u, v) = (u, v, f (u, v)) Graph of function f (, r) in polar: f (u, v) = (v cos(u), v sin(u), f (u, v)) Plane containing P and vectors u, v: r(u, v) = P + uu + vv Surface of revolution: distance g(z) of z axes : r(u, v) = (g(v) cos(u), g(v) sin(u), v) Cylinder: r(u, v) = (r cos(u), r sin(u), v).
COMMERCIAL SCANNERS. There are scanners on the market which can scan 60000 points per second. The model on the photo to the right costs currently 410,000 dollars (www.cyberware.com).
SOLUTION. The solution to this problem is provided by an algorithm called Delaunay triangularization. It produces a desired set of triangles. Fortunately, Mathematica has already built in a function TriangularSurfacePlot which is contained in the DiscreteMathComputationalGeometry module. The gure to the right shows a triangularsation applied to a random surface.
THE PROBLEM. Given a surface in space. Take a cup for example. How do we model the surface mathematically? Taking pictures of the cup only gives us two dimensional representations. Reconstructing the surface from two dimensional projections is called 3D scanning. SOLUTION. One method is to make two or more projections. Each point in the photo determines a line in space. If we have at least two photos which contain both points, the point is xed: the intersection of these lines is the point we are looking for. The next problem is then construct a surface from these points. To see how this works in detail, we split up the problem into three subproblems. PROBLEM 1) Given the camera position C = (a, b, c) and the center P = (x, y, z) of the object as well as a point p = (u, v) on the lm: nd a line line r C +rU which passes through the point P , where U = C O. SOLUTION. If U = C O = (u1 , u2 , 0) and N = (0, 0, 1). A unit vector orthogonal to u and N is V = U N = (u2 , u1 , 0)/ u2 + u2 ). Then P = C + V u + N v. 1 2 PROBLEM 2) Given the location C1 = (x1 , y1 , z1 ), C2 = (x2 , y2 , z2 ) of the two cameras and the location O = (0, 0, 0) of the center of the object. Given a point (u1 , v1 ) on the rst lm and a point (u2 , v2 ) on the second lm. Find the point P on the surface. SOLUTION. p = (u, v) on the rst lm determines by PROBLEM 1) a line P + rU . Similarly, a point q on the second lm determins a line Q + sV in space. Theoretically, these two lines meet in a point X = (x, y, z). However, due to errors, these two lines will miss in general. We assign the best possible choice, the point closest to both points. Because we know u3 = u1 u2 the direction of the closest connection between the two lines, we have to solve C1 + su1 + tu3 = C2 + ru2 to get the point X = C1 + su1 + (t/2)u3 . This is a system of three equations for the three unknowns t1 , t2 , t3 . We can solve this system (in Lagrange multiplier problems, we solved more complicated nonlinear systems of equations). FAMILIAR EXAMPLE. If the camera C1 is on the x axes and takes a shot of the y z plane, then the point (x, y, z) will be the point (y, z) in the photo. Similarly, if C2 is on the y axes, then a point (x, y, z) will be the point (x, z) on the photo. Ideally, if the point is from both sides, then (x, y, z) is determined.
STEP 1. DATA INPUT (C PROGRAM). A GUI xwindows C program 3dscan.c helps us to enter the data with a mouse. The two pictures are scaled, concatenated to a single picture and displayed. The program 3dscan.c allows to enter pairs of points with the mouse. The data are written onto a text le result.dat.
STEP 2. DATAPROCESSING (MATHEMATICA). Given the object O = (0, 0, 0), the camera positions C1 = (C1x , C1y , C1z ),C2 = (C2x , C2y , C2z ) and the points (u1 , v1 ) on the rst lm and (u2 , v2 ) on the second lm. The formula for the point P (x, y, z) are obtained from solving A1 + t1 C1 + t3 N = A2 + t2 C2 , where Ai = Ci + ui (Ci O) N/|Ci O| + vi N . A mathematica program stereo3d.m takes the data in result.dat and writes a new le 3d.dat which contains the points Pi in space. Also the triangularisation is done with Mathematica. The program is called triangular.m. It takes as in input the le 3d.dat and outputs a Povray le surface.inc which is essentially a set of triangles written in form, Povray can read. STEP 3. RENDERING (POVRAY). Finally, with all the triangles known, we run the data through a ray tracing program surface.pov. This Povray program takes the le result.inc as an input and produces a picture surface.ppm. POVRAY. Povray is a free raytracing program. It allows to render three dimensional objects. To the right, you see a simple Povray program. It simply shows a red sphere on a white background. THE LANGUAGE POVRAY. < a, b, c > point or vector (a,b,c) sphere{P, r} sphere centered of radius r centered at (a,b,c) box{P, Q} rectangular box with diagonal corners P,Q One can take intersections, cylinder{P, Q, r} cylinder of radius r over segment P Q plane{N, d} plane with normal vector N , in distance d from origin triangle { P,Q,R } triangle with endpoints P,Q,R unions, dierences of objects. Furthermore, every object can be scaled, rotated and translated. In the example above, you see how to apply textures. Colors are represented as vectors < r, g, b >, where r is red and g is green and b is blue. The addition of colors is additive. For example < 1, 1, 0 > is yellow. The best way to learn the language is to look at examples. There are thousands of examples available on the web. The ocial distribution of Povray includes many examples and contains a nice manual.
Math21a, O. Knill
INTRODUCTION. Topics beyond multi-variable calculus are usually labeled with special names like linear algebra, ordinary dierential equations, numerical analysis, partial dierential equations, functional analysis or complex analysis. Where one would draw the line between calculus and non-calculus topics is not clear but if calculus is about learning the basics of limits, dierentiation, integration and summation, then multi-variable calculus is the black belt of calculus. Are there other ways to play this sport? HOW WOULD ALIENS COMPUTE? On an other planet, calculus might be taught in a completely dierent way. The lack of fresh ideas in the current textbook oerings, where all books are essentially clones (*) of each other and where innovation is faked by ejecting new editions every year (which of course has the main purpose to prevent the retail of second hand books), one could think that in the rest of the universe, multi-variable calculus would have to be tought in the same way, and where chapter 12 is always the chapter about multiple integrals. Actually, as we want to show here, even the human species has come up with a wealth of dierent ways to deal with calculus. It is very likely that calculus textbooks would look very dierent in other parts of our galaxy. This week broke the news that one has discovered a 5th arm of the milky way galaxy. It is 77000 light years long and should increase the chance that there are other textbooks in our home galaxy. In this text, we want to give an idea that the calculus topics in this course could be extended or built completely dierenty. Actually, even numbers can be dened dierenty. John Conway introduced once numbers as pairs {L|R} where L and R are sets of numbers dened previously. For example {|} = 0 and {0|} = 1, {|0} = 1, {0|1}. The advantage of this construction is that it allows to see numbers as part of games. Donald E. Knuth, (the giant of a computer scientist, who also designd TeX, a typesetting system in which this text is written), wrote a book called surreal numbers in which two students nd themselves on an iland. They nd a stone with the axioms for a new number system is written and develop from that an entirely new number system which contains the real line and more. The book is a unique case, where mathematical discovery is described as a novel. This is so totally dierent from what we know traditionally about numbers that one could expect Conway to be an alian himself if there were not many other proofs of his ingenious creativity.
(*) One of the few exceptions is maybe the book of Marsden and Tromba, which is original, precise and well written. It is unfortunately slightly too mathematical for most calculus consumers and suers from the same disease that other textbooks have: a scandalous prize. A denite counterexample is the book how to ace calculus which is funny, original and contains the essential stu. And it comes as a paperback. Together with a Schaum outline volume (also in paperback), it would suce as a rudimantary textbook combination (and would cost together half and weight one fourth) of the standard doorstoppers.
DISCRETE SPACE CALCULUS. Many ideas in calculus make sense in a discrete setup, where space is a graph, curves are curves in the graph and surfaces are collections of plaquettes, polygons formed by edges of the graph. One can look at functions on this graph. Scalar functions are functions dened on the vertices of the graphs. Vector elds are functions dened on the edges, other vector elds are dened as functions dened on plaquettes. The gradient is a function dened on an edge as the dierence between the values of f at the end points. Consider a network modeled by a planar graph which forms triangles. A scalar function assigns a value f n to each node n. An area function assigns values fT to each triangle T . A vector eld assign values Fnm to each edge connecting node n with node m. The gradient of a scalar function is the vector eld F nm = fn fm . The curl of a vector eld F is attaches to each triangle (k, m, n) the value curl(F ) kmn = Fkm + Fmn + Fnk . It is a measure for the circulation of the eld around a triangle. A curve in our discrete world is a set of points rj , j = 1, . . . , n such that nodes rj and rj+1 are adjacent. For a vector eld F and a curve , the line n integral is j=1 Fr(j)rj+1 . A region R in the plane is a collection of triangles T . The double integral of an area function fT is T R fT . The boundary of a region is the set of edges which are only shared by one triangle. The orientation of is as usual. Greens theorem is now almost trivial. Summing up the curl over a region is the line integral along the boundary. One can push the discretisation further by assuming that the functions take values in a nite set. The integral theorems still work in that case too. QUANTUM MULTIVARIABLE CALCULUS. Quantum calculus is calculus without taking limits. There are indications that space and time look dierent at the microscopic small, the Planck scale of the order h. One of the ideas to deal with this situation is to introduce quantum calculus which comes in dierent types. We discuss q-calculus where the derivative is dened as Dq f (x) = dq f (x)/dq (x) with dq f (x) = f (qx) f (x) . You can
n
1 see that Dq xn = [n]xn1 , where [n] = qq1 . As q 1 which corresponds to the deformation of quantum mechanics with h 0 to classical mechanics, we have [n] n. There are quantum versions for dierentiation rules like Dq (f g)(x) = Dq f (x)g(x) + f (qx)Dq g(x) but quantum calculus is more friendly to students because there is no simple chain rule. Once, we can dierentiate, we can take anti-derivatives. It is denoted by f (x) dq (x). As we know the derivative of xn , we have xn dq(x) = n an xn+1 /[n + 1] + C with a constant C. The anti-derivative of a general function
is a series
NONSTANDARD CALCULUS. At the time of Leonard Euler, people thought about calculus in a more intuitive, but less formal way. For example (1 + x/n)n = ex with innitely large n would be perfectly ne. A modern approach which catches this spirit is nonstandard analysis, where the notion of innitesimal is given a precise meaning. The simplest approach is to extend the language and introduce innitesimals as objects which are smaller than all standard objects. We say x y if |x y| is innitesimal. All numbers are traditionally dened like or 2 are standard. The notion which tells that every bounded sequence has an accumulation point is expressed by the fact that there exits a nite set A such that all x D are innitesimally close to an element in A. The fact that a continuous function on a compact set takes its maximum is seen by taking M = maxaA f (a). What impressed me as an undergraduate student learning nonstandard calculus (in a special course completely devoted to that subject) was the elegance of the language as well as the compactness in which the entire calculus story could be packed. For example, to express that a function f is continuous, one would say x y then f (x) f (y). This is more intuitive than the Weierstrass denition > 0 > 0|x y| < |f (x) f (y)| < which is understood today primarily by intimidation. To illustrate this, Ed Nelson, the founder of one of the nonstandard analysis avors, asks the meaning of > 0 > 0|x y| < |f (x) f (y)| < in order to demonstrate how unintuitive this denition really is. The derivative of a function is dened as the standard part of f (x) = (f (x + dx) f (x))/dx, where dx is innitesimal. Dierentiability means that this expression x is nite and independent of the innitesimal dx chosen. Integration a f (y) dy is dened as the standard part of xj [a,x] f (xi )dx where xk = kdx and dx is an innitesimal. The fundamental theorem of calculus is the triviality F (x + dx) F (x)) = f (x)dx. The reasons that prevented nonstandard calculus to go mainstream were lack of marketing, bad luck, being below a certain critical mass and the initial believe that students would have to know some of the foundations of mathematics to justify the game. It is also quite a sharp knife and its easy to cut the nger too and doing mistakes. The name nonstandard calculus certainly was not fortunate too. People call it now innitesimal calculus. Introducing the subject using names like hyper-reals and using ultra-lters certainly did not help to promote the ideas (we usually also dont teach calculus by introducing Dedekind cuts or completenes) but there are books like by Alain Robert which show that it is possible to teach nonstandard calculus in a natural way.
is dened. With an anti-derivative, there are denite integrals. The fundamental theorem of q-calculus b f (x)dq (x) = F (b) F (a) where F is the anti-derivative of f still holds. Many results generalize to q-calculus a like the Taylor theorem. A book of Kac and Cheung is a beautiful read about that. Multivariable calculus and dierential equations can be developed too. A handicap is the lack of a chain rule. f drq = f (r(b)) For example, to dene a line integral, we would have to dene F dq r in such a way that f (r(a)). In quantum calculus, the naive denition of the length of a curve depends on the parameterization of the curve. Surprises with quantum dierential equations QODE dq f = f which is f (qx)f (x) = (q1)f (x) simplies to f (qx) = qf (x). A classic dierentiation gives f (qx) = f (x) showing that the QODE has many solutions f (x) = Cx + g(log(x)/ log(q)), where g(x) = g(x + 1) is periodic.
j=0
INFINITE DIMENSIONAL CALCULUS. Calculus in innite dimensions is called functional analysis. Functions on innite dimensional spaces which are also called functionals for which the gradient can be dened. The later is the analogue of Du f . One does not always have Du f = f u. An example of an innite dimensional space is the set X of all continuous functions on the unit interval. An example of a two dimensional surface in that space would be r(u, v) = (cos(u) sin(v)x2 + sin(u) sin(v) cos(x) + cos(v)/(1 + x2 ). This surface is actually a two dimensional sphere. On this space X one can dene a dot product f g = f (x)g(x) dx. The theory which deals with the problem of extremizing functionals in innite dimensions is called calculus of variations. There are problems in this eld, which actually can be answered within the realm of multivariable calculus. For example: a classical problem is to nd among all closed regions with boundary of length 1 the one which has maximal area. The solution is the circle. One of the proofs which was found more than 100 years ago uses Greens theorem. One can also look at the problem to nd the polygon with n edges and length 1 which has maximal area. This is a Lagrange extremization problem with regular polygons as solutions. In the limit when the number of points go to innity, one obtains the isoperimetric inequality. Other problems in the calculus of variations are the search for the shortest path between two points in a hilly region. This shortest path is called a geodesic. Also here, one can nd approximate solutions by considering polygons and solving an extremization problem but direct methods in that theory are better.
GENERALIZED CALCULUS. In physics, one wants to deal with objects which are more general than functions. For example, the vector eld F (x, y) = (y, x)/(x2 + y 2 ) has its curl concentrated on the origin (0, 0). This is an example of an object which is a distribution. An example of such a Schwartz distribution is a function f which is innite at 0, zero everywhere else, but which has the property that f d dx = 1. It is called the Dirac delta function. Mathematically, one denes distributions as a linear map on a space of smooth test functions which decay fast at innity. One writes (f, ) for this. For continuous functions one has (f, ) = f (x)(x) dx, for the Dirac distribution one has (f, ) = (0). One would dene the derivative 0x<0 one has of a distribution as (f , ) = f ( ). For example for the Heavyside function H(x) = 1x>0 (H, ) = (x) dx and because (H, ) = (x) dx = (0) one has (H , ) = (0) the Dirac delta function. The Dirac delta function is still what one calls a measure, an object which appears also in probability theory. However, if we dierentiate the Dirac delta function, we obtain (D , ) = (D, ) = (0). This is an object which can no more be seen as a probability distribution and is a new truly generalized function. COMPLEX CALCULUS Calculus in the complex is called complex analysis. Many things which are a bit mysterious in the real become more transparent when considered in the complex. For example, complex analysis helps to solve some integrals, it allows to solve some problems in the real plane better. Here are some places where complex analysis could have helped us: to nd harmonic functions, one can take a nice function in the complex like z 4 = (x + iy)4 = x4 x2 y 2 + y 4 + i(x3 y + xy 3 ) and look at its real and complex part. These are harmonic functions. Dierentiation in the complex is dened as in the real but since the complex plane is two dimensional, one asks more: f (z + dz) f (z)/dz has to exist and be equal for every dz 0. One writes z = (x iy )/2 and complex dierentiation satises all the known properties from dierentiation on the real line. For example d/dzz n = nz n1 . Multivariable calculus very much helps also to integrate functions in the complex. Again, because the complex plane is two dimensional, one can integrate along paths and the complex integral C f (z) dz is actually a line integral. If z(t) = x(t) + iy(t) is the path and f = u + iv then
C
FRACTAL CALCULUS. We have dealt in this courses with 0-dimensional objects (points), 1-dimensional objects (curves), 2-dimensional objects (surfaces) as well as 3-dimensional objects (solids). Since more than 100 years, mathematicians also studied fractals, objects with noninteger dimension are called fractals. An exampls is the Koch snowake which is obtained as a limit by repeated stellation of an equilateral triangle of initial arclength A = 3. After one stellation, the length has increased by a factor 4/3. After n steps, the length of the curve is A(4/3)n . The dimension is log(4/3) > 1. There are things which do no more work here. For example, the length of this curve is innite. Also the curve has no dened velocity at all places. One can ask whether one could apply Greens theorem still in this case. In some sense, this is possible. After every nite step of this construction one can compute the line integral along the curve and Greens theorem tells that this is a double integral of curl(F ) over the region enclosed by the curve. Since for larger and large n, less and less region is added to the curve, the integral curl(F ) dxdy is dened in the limit. So, one can dene the line integral along the curve. Closely related to fractal theory is geometric measure theory, which is a generalization of dierential geometry to surfaces which are no more smooth. Merging in ideas from generalized functions and dierential forms, one denes currents, functionals on smooth dierential forms. The theory is useful for studiing minimal surfaces. Fractals appear naturally in dierential equations as attractors. The most infamous fractal is probably the Mandelbrot set, which is dened as the set of complex numbers c for which the iteration of the map f (z) = z 2 + c starting with 0 leads to a bounded sequence 0 c c2 + c (c2 + c)2 + c.... The boundary of the Mandelbrot set is actually not a fractal. It is so wiggly that its demension is actually 2. One can modify the Koch snowake to get dimension 2 too. If one adds new triangles each time so that the length of the new curve is doubled each time, then the dimension of the Koch curve is 2 too. THE FOUNDATIONS OF CALCULUS. Would it be possible that aliens somewhere else would build up mathematics radically dierent, by starting with a dierent axiom system? It is likely. The reason is that already we know that there is not a single way to build up mathematical truth. We have some choice: it came as a shock around the middle of the last century that for any strong enough mathematical theory, one can nd statements which are not provable within that system and which one can either accept as a new axiom or accept the negation as a new axiom. Even some of the respected axioms are already independent of more elementary ones. One of them is the axiom of choice which says that for any collection C of nonempty set, one can choose from each set an element and form a new set. A consequence of this axiom which is close to calculus is a compactness property for functions on the interval. If we take the distance d(f, g) = max(f (x) g(x)) between two functions and take a sequence of dierentiable functions satisfying |fn (x)| M and |fn (x)| M then there exists a subsequence fnk which converges to a continuous function. A rather counterintuitive consequence of the Axiom of choice is that one can decompose the unit ball into 5 pieces Ei , move those pieces using rotations and translations and reassemble them to form two copies of the unit ball. We can not integrate dV over this regions: the sum of their volumes would be either Ei 4/3 or 8/3 depending on whether we integrate before or after the arrangement. This is such a paradoxical construction that one calls it a paradox: the Banach-Taski paradox. An other axiom for which is not clear, whether it matters in calculus is the continuum hypothesis which tells that there is no cardinality between the innity of the natural numbers 0 and the innity of the real numbers 1 . It had been realized in the 19th century by Cantor that these two innities are dierent. Cantors ar- 1 0. 2 4231423412341234134... gument is to assume that one could enumerate all 2 0.3 4 4223498273413904173... numbers between 0 and 1: then look at the diagonal 3 0.69 1 4341074147346738874... number, in which each digit is altered. For example: x = 0.35285.... . This real number x disagrees with 4 0.999 7 4283382464200104131... all the numbers in the list and was therefore not ac- 5 0.3620 4 4747389238934211147... counted for in the counting. The possibilities to question or alter the mathematical builup does not stop on the set theoretical level. People even tried to change logic. Among things which have been proposed are fuzzy logic, where truth can take a value between 0 and 1 or quantum logic or a logic in which one has three possibilites, true, not true or undecided. One not only has the possibility to extend mathematics dierently. A rather rich playground can be covered by restricting tools. One can for example ask, what part of calculus can still be done in without the axiom of choice. One can also ask that one only is allowed to talk about objects which can be constructed explicitely. There were people, strict nitists, who went even further and suggested to disqualify too large numbers like 10 1010 . Calculus teachers have even to go further and produce problems so that the answer is 1 or 0 or or 1/3. Problems in nal exams, where the answer is 1234/12 is unthinkable. The philosophical direction teachers are forced to follow is called ultra strict nitism...
f (z) dz =
b (ux a
the Cauchy integral theorem which says that C f (z) dz = 0 if C is the boundary of a region in which f is dierentiable. Integration in the complex is useful for example to compute denite integrals. One can ask, whether calculus can also be done in other number systems besides the reals and the complex numbers. The answer is yes, one can do calculus using quaternions, octonions or over nite elds but each of them has its own diculty. Quaternion multiplication already does no more commute AB = BA and octonions multiplication is even no more associative (AB)C = A(BC). In order to do calculus in nite elds, dierentiation will have to be replaced by dierences. A Finnish mathematician Kustaanheimo promoted around 1950 a nite geometrical approach with the aim to do real physics using a very large prime number. These ideas were later mainly picked up by philosophers. It is actually a matter of fact that the natural numbers are the most complex and the complex numbers are the most natural. CALCULUS IN HIGHER DIMENSIONS. When extending calculus to higher dimensions, the concept of vectorelds, functions and dierentiations grad,curl,div are reorganized by introducing dierential forms. For an integer 0 k n, dene k-forms as objects of the form = I aI dxI = i1 <i2 <...<ik ai1 ,...,ik dxi1 . . . dxik , where dxi dxj is a multiplication called exte-
vy )dt + i
b (uy a
rior product which is anti-commutative: = . Then, one denes an exterior derivative as d I aI dxI = daI dxI In three dimensions, where we write dx = dx1 , dy = dx2 and dz = dx3 : k = form = d = 0 f fx dx + fy dy + fz dz 1 M dx + N dy + P dz (Nx My )dx dy + (Px Mz )dx dz + (Py Nz )dy dz 2 Adx1 dx2 + Bdx1 dx3 + Cdx2 dx3 (Az By + Cx )dx dy dz 3 gdx1 dx2 dx3 0. (The computation of the curl was Nx dx dy + Px dx dz + My dy dx + Py dy dz + Mz dz dx + Nz dz dy = (Nx My )dx dy + (Px Mz )dx dz + (Py Nz )dy dz. ) After an identication of 0 with 3 forms and 1 with 2 forms (called Hodge *operation) one can see the exterior derivatives as gradient, curl and divergence: It is useful also to clarify the notion of a surface by dening manifolds. Many denitions which we have seen for curves or surfaces can be extended to manifolds. The dot product can be dened more generally on manifolds and leads to a theory called Riemannian geometry used in the theory of general relativity. When learning relativity, one deals with 4-dimensional manifolds which incoorporate both space and time. There, the language of dierential forms is already mandatory. The exterior derivative of a 1 form is a 2 form which has 6 component. An example of such a 2-form is the electromagnetic eld F = dA combining 3 electric and 3 magnetic components. The Maxwell equations are dF = 0, d F = I, where d = d is dened using the Hodge * operation. The consequence d dA = I becomes the wave equation d dA = 0 in the absense of I a vector incoorporating both electric charge and current i.
POVRAY
camera{ up y right x location <0,2,-5> look_at <0,0,0> } light_source { <0,300,-100> colour rgb <1,1,1> } #background { rgb <1,1,1> }
A SCENE. The y axes is up. We place the object (the intersection of three cylinders) at the origin and the camera slightly above on the z axes.
#macro r(c) pigment { rgb c } finish { phong 1.0 ambient 0.5 diffuse 0.5 } #end intersection { cylinder { <-1,0,0>,<1,0,0>, 1 } cylinder { <0,-1,0>,<0,1,0>, 1 } cylinder { <0,0,-1>,<0,0,1>, 1 } texture { r(<1,0,0>) } rotate <10,10,5> } plane {<0,1,0>,-2 texture { r(<0,1,0>) } } plane {<0,0,1>, 2 texture { r(<0,0,1>) } }
RUNNING POVRAY. If the povray le is called test.pov, run povray as povray good.ini +i test.pov. The .ini le contains instructions like size of the picture, quality of rendering etc. With povray anim.ini +i test.pov, a sequence of pictures is rendered. The .ini le contains now instructions how many frames the movie should have.
Width=200 Height=200 Quality=11 Antialias_Depth=4 Antialias=On Antialias_Threshold=0.1 Jitter_Amount=0.5 Jitter=on Initial_Frame = 1 Final_Frame = 10 Initial_Clock = 0.0 Final_Clock = 1.0
TEXTURES. Textures to planets of the Solar system are available on the web. The texture is mapped onto the sphere using the map X(u, v) = (cos(u) sin(v), sin(u) sin(v), cos(v)). In the source code, the units are chosen so that 1=1km. Having natural units allows to model things more easily. In the scene an articial light has been added from the camera in order to see the rings better.
camera { location <0,50000,-320000> up z right x look_at 0 } #declare sun= light_source { 0 color rgb <1,1,1> looks_like { sphere { 1, 696265 pigment { color rgb <1,1,0> } finish { ambient 1} }} translate -z*142600000 } light_source {<0,20000,-250000> color rgb <0.3,0.1,0>} #declare saturn_planet = sphere {0, 60368 pigment {image_map {gif "saturn.gif" map_type 1 interpolate 2}} finish {ambient 0 diffuse 1} } #declare C_ring = disc { <0, 0, 0> y, 92000, 74500 pigment {color rgb<0.99,0.88,0.79> filter 0.6} finish {ambient 0 diffuse 5} } #declare inner_B_ring = disc { <0, 0, 0> y, 98390, 92000 pigment {color rgb<0.99,0.88,0.79> filter 0.2} finish {ambient 0 diffuse 5} } #declare outer_B_ring = disc { <0, 0, 0> y, 117500, 98390 pigment {color rgb<0.99,0.88,0.79> filter 0.05} finish {ambient 0 diffuse 5} } #declare inner_A_ring = disc { <0, 0, 0> y, 133570, 122200 pigment {color rgb<0.99,0.88,0.79> filter 0.05} finish {ambient 0 diffuse 5} } #declare outer_A_ring = disc { <0, 0, 0> y, 136800, 133895 pigment {color rgb<0.99,0.88,0.79> filter 0.2} finish {ambient 0 diffuse 5} } #declare F_ring = disc { <0, 0, 0> y, 140460, 140210 pigment {color rgb<0.99,0.88,0.79> filter 0.05} finish {ambient 0 diffuse 5} } union { object {sun} object {saturn_planet scale <1,0.9,1>} object {C_ring } object {inner_B_ring} object {outer_B_ring} object {inner_A_ring} object {outer_A_ring} object {F_ring} rotate x*20 }
WHAT IS RAYTRACING? The objects, the camera and lights are in place. If photons leave the light source, they will reect at the objects, change color and intensity and some of them will reach the camera. Adding up the light intensities of all these photons gives the picture. Raytracers work more ecient: instead of shooting photons from the light source and wasting most of the photos because they dont reach the lm, it is better to start the light ray at the lm and compute backwards.
#include "colors.inc" #include "skies.inc" #include "sbb.inc" light_source { <-200, 10, -200> color rgb <1,1,1> light_source { < 200,100, -200> color rgb <1,1,1> } }
WATER AND SKY. Water and sky are frequenly added, often by artistic reasons.
#declare p=<0,40,-100>; camera { location p up y right x look_at 0 rotate y*360*clock} #declare WaterTexture = texture { pigment { color rgb<0.39, 0.41, 0.83> } finish { ambient 0.15 brilliance 5 diffuse 0.6 specular 0.80 roughness 1/100 reflection 0.65 } } #declare Water = plane { y, 0.0 texture { WaterTexture normal { waves 0.05 frequency 5000.0 scale 3000.0 } } } object{ SBBBruecke translate -x*100} object{ Water } sky_sphere { S_Cloud2 }
COLORS. Every color is given by a vector < r, g, b > in the color cube [0, 1] [0, 1] [0, 1]. Color vectors can be added like usual vectors.
light_source { <0, 50, 0> color rgb <1,1,1> } camera { direction z location <0,6,-15> look_at <0,2,0> } plane { y,0 pigment { rgb <0.6,0.6,0.6> } finish { ambient 0.1 diffuse 0.7 } normal { bumps 0.8 } }
PROGRAMMING. Povray is a programming language. Macros are procedures which can be reused and called within the the macro. This allows recursion like in this rendering of the 3D fractal to the right. You see also how one can play with colors. Identifying them with vectors in space colors the pyramid according to the color cube.
camera {location <1,1.2,-1.7> up y right x look_at <0,0,0> } light_source {< 100, 80, 100> colour rgb <1,1,1> } light_source {< 100, 80, -100> colour rgb <1,1,1> } light_source {< 100, 80, -100> colour rgb <1,1,1> } light_source {<-100, 80, -100> colour rgb <1,1,1> } background { rgb <1,1,1> } #macro te(c) texture { pigment { rgb c } finish { phong 1.0 phong_size 10 ambient 0.1 diffuse 0.7 } } #end #declare maxrecursion=4; #macro shirpinski(p,w,n) #local hw=w/2; #local fw=w/4; #if (n>=maxrecursion) union { triangle { p,p+< hw,-w,-hw>,p+< hw,-w, hw> } triangle { p,p+< hw,-w, hw>,p+<-hw,-w, hw> } triangle { p,p+<-hw,-w, hw>,p+<-hw,-w,-hw> } triangle { p,p+<-hw,-w,-hw>,p+< hw,-w,-hw> } triangle { p+< hw,-w, hw>,p+<-hw,-w, hw>,p+<-hw,-w,-hw> } triangle { p+<-hw,-w,-hw>,p+< hw,-w,-hw>,p+< hw,-w, hw> } te(p) } #else shirpinski(p,hw,n+1) shirpinski(p+< fw,-hw,-fw>,hw,n+1) shirpinski(p+< fw,-hw, fw>,hw,n+1) shirpinski(p+<-fw,-hw, fw>,hw,n+1) shirpinski(p+<-fw,-hw,-fw>,hw,n+1) #end #end union { shirpinski(<0,1,0>,1.3,0) translate -y*0.5 rotate y*30 translate y*0.5 }
REFRACTION. When light passes from one medium to an other, the path of the ray of light is bent because the speed in different media is dierent and the path choses the path traversed in shortest time. This is called refraction. For example air and water have dierent densities and thus refract dierently.
plane { y, 12 hollow on pigment { rgb <0.5,0.7,1.0> filter 0.93 } finish { reflection 0.7 } interior { ior 1.33 caustics 1.0 } translate <5, 0, -10> normal { bumps 0.8 } }
The index of refraction ior value is used to describe the relative density of substances. The default ior value 1.0 (air) gives no refraction. Water has ior 1.33, glass is 1.5 and diamond 2.4. In the picture to the right, the camera is under water, the light source above the water. You see caustics like at the bottom of a swimming pool.
OBJECTS. Many objects like quadrics ax2 + bxy + cy 2 + dx + ey + f z + g = 0 are predened in Povray. The most basic objects are boxes, spheres, cylinders, lathes (extruded curves). By joining, intersecting or taking dierences of such objects, one can build more complicated objects. Additionally, every object can be rotated and scaled.
{ location <1,2,-4> up <0, 1,0> right <1,0,0> look_at <-1,-2,4> } { <-100, 30, -10> color rgb <1,1,1> } { <0, 2000, 0> color rgb <1,1,1> area_light <-6,0,-6>, <6,0,6>, 5, 5 { rgb <1.0,1.0,1.0> }
#macro te(c) texture { pigment { rgb c} finish { phong 1.0 phong_size 10 ambient 0.2 diffuse 0.8 }} #end poly {2,<1,0,0,0,-1,0,0,1,0,-0.3> scale 1.5 poly {2,<1,0,0,0,-1,0,0,1,0, 0.3> scale 1.5 poly {2,<1,0,0,0,-1,0,0,1,0, 0.0> scale 1.5 hollow hollow hollow clipped_by { sphere { <0,0,0> 2.0 } } te(<1,1,0,0.6>)} clipped_by { sphere { <0,0,0> 2.0 } } te(<0,1,1,0.6>)} clipped_by { sphere { <0,0,0> 2.0 } } te(<1,0,1,0.6>)}
EXTERIOR PROGRAMS. Many organic or an-organic molecules are available on the web in .pdb format. There are viewers which allow to see the molecule and translators, which export a povray le, which can then be rendered. To the right, you see the caeine molecule.
COMPND AUTHOR AUTHOR AUTHOR HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM HETATM CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT CONECT MASTER END
caffeine Created by Dave Woodcock at Okanagan University College email:woodcock@okanagan.bc.ca Date revised: Fri Sep 29 14:53:27 2000 GENERATED BY BABEL 1.6 1 C 1 0.000 0.000 0.000 1.00 0.00 2 C 1 1.392 0.000 0.000 1.00 0.00 3 N 1 2.076 1.164 0.000 1.00 0.00 4 C 1 1.373 2.321 -0.003 1.00 0.00 5 O 1 1.978 3.365 -0.017 1.00 0.00 6 N 1 0.017 2.344 0.003 1.00 0.00 7 C 1 -0.710 1.202 0.002 1.00 0.00 8 O 1 -1.915 1.218 -0.006 1.00 0.00 9 N 1 -0.404 -1.287 -0.019 1.00 0.00 10 N 1 1.830 -1.279 -0.020 1.00 0.00 11 C 1 0.715 -2.048 -0.031 1.00 0.00 12 C 1 -1.795 -1.761 -0.044 1.00 0.00 13 C 1 3.546 1.178 -0.016 1.00 0.00 14 C 1 -0.690 3.634 -0.013 1.00 0.00 15 H 1 0.720 -3.138 -0.055 1.00 0.00 16 H 1 -1.813 -2.850 -0.090 1.00 0.00 17 H 1 -2.307 -1.428 0.860 1.00 0.00 18 H 1 -2.302 -1.352 -0.918 1.00 0.00 19 H 1 3.894 1.455 -1.011 1.00 0.00 20 H 1 3.929 0.190 0.239 1.00 0.00 21 H 1 3.911 1.904 0.710 1.00 0.00 22 H 1 -1.557 3.583 0.645 1.00 0.00 23 H 1 -0.027 4.428 0.329 1.00 0.00 24 H 1 -1.020 3.851 -1.029 1.00 0.00 1 2 2 7 9 2 1 1 3 10 3 2 4 13 4 3 5 5 6 5 4 4 6 4 7 14 7 1 6 8 8 8 7 7 9 1 11 12 10 2 11 11 11 9 10 10 15 12 9 16 17 18 13 3 19 20 21 14 6 22 23 24 15 11 16 12 17 12 18 12 19 13 20 13 21 13 22 14 23 14 24 14 0 0 0 0 0 0 0 0 24 0 24 0
ANIMATION. When doing animations, the camera moves along a curve. The velocity and acceleration vector can help to determine, in which direction the camera should look. The frames below were made with a bridge built after the Rheinfall bridge in Switzerland.
RENDERING. Raytracing is a CPU time intensive task. The software has to compute the light ray paths bouncing around in a virtual world, compute reections or refractions. Tracing an image can take from a few seconds to days. A single frame in movies like Toy Story takes several hours to render. To get the large number of frames needed for a movie companies like Pixar (recently again visible with Monsters inc.) use computer farms a huge number of workstations now mostly running linux. THE ROLE OF MATH 21a. Many topics you learned appear in the area of ray tracing. For example, to compute the normal vector to a polygon, one uses an area formula, which we have proven in a homework using Greens theorem (see below). Normal vectors play an important role because they are needed to compute the reection of rays. Just look inside a book or article on 3D graphics and many now familiar objects will pop up. EXAMPLE 1). The method of computing normals to a surface by just looking at three points is error prone. It is often better to consider a polygon Pi = (xi , yi , zi ) on the surface. What is the normal to such a polygon? Note that the points Pi are not necessarily on a plane. Here is what people do in 3D graphics: consider the xy projection of the polygon. This gives a polygon (xi , yi ) in the plane. Now compute the area of that projected polygon with the formula 1/2 k (xk+1 + xk )(yk+1 yk ) (see page 275 in your book). This formula was proven using Greens theorem but can be seen geometrically. This area will be the third component c of the normal vector. Analoguously, compute the other components.
MODELS. There are converters to produce povray les from other formats. For example, models created with Poser can be transformed into a form readable by Povray.
camera { location <120,11,70> up y right x direction <0,0,7> look_at <30,18,16>} light_source { <-213, 157, -10> color rgb<1,1,1> } light_source { <210, 157, -160> color rgb<0.5,0.5,0.5> } light_source { <-538, 180,481> color rgb<1,1,1> } light_source { <180, 74, -102> color rgb<1,1,1> } #include "liberty.inc" object {statue_of_liberty texture { pigment { color rgb<1,1,1> } finish { ambient 0.3 diffuse 0.4 phong 0.7 reflection 0 phong_size 32 } }}
The normal vector to a not necessarily planar polygon Pi = (xi , yi , zi ) in space is dened as 1/2 k (yk+1 + yk )(zk+1 zk ) n = 1/2 k (zk+1 + zk )(xk+1 xk ) . 1/2 k (xk+1 + xk )(yk+1 yk ) EXAMPLE 2) Snells law of refraction is the problem to determine the fastest path between two points, if the path crosses a border of two media and the media have dierent indices of refraction. This is a Lagrange multiplier problem: A light ray travles from A = (1, 1) to the point B = (1, 1) crossing a boundary between two media (air and water). In air (y0) the speed of the ray is v1 = 1 (in units of speed of light). In the second medium (y0) the speed of light is v2 = 0.9. The light ray travels on a straight line from A to a point P = (x, 0) on the boundary and on a straight line from P to B. Verify Snells law of refraction sin(1 )/ sin(2 ) = v1 /v2 . where 1 is the angle the ray makes in air with the y axes and where 2 is the angle, the ray makes in water with the y axes. Solution: Minimize F (x, y) = (1 x)2 + y 2 /v1 + (1 x)2 + y 2 /v2 = l1 /v1 + l2 /v2
The converted le is usually included as a .inc le. The beginning of the le liberty.inc (obtained from the web at http://www.multimania.com/froux/modeles) is displayed blow. There are many models available on the web (good and less good).
#declare statue_of_liberty = union{ mesh{ smooth_triangle{<1.98,27.1,1.5><9.77,-1.99,-0.8><1.97,27.1,1.02><9.82,-1.3,1.4><1.93,27.34,1.1><9.55,1.41,-2.61>} smooth_triangle{<2.1,27.11,1.46><-6.71,1.7,-7.21><2.1,27.49,1.53><-6.33,0.1,-7.74><2.21,27.33,1.36><-7.91,1.6,-5.91>} smooth_triangle{<2.02,25.82,1.19><2.3,-4.59,-8.58><2.01,25.82,1.19><-0.5,-4.63,-8.85><2.01,25.86,1.17><0,-5.1,-8.6>} .... }
RAY TRACING COMPETITION. There is a annual ray tracing comptetion going on. Here is an example of an entry from the 1999 competition The authors of the scene are Ian and Ethel MacKay. The source le for this scene is a single povray le.
under the constraint G(x, y) = y = 0. The Lagrange equations show that Fx (x, y) = 0. This is already Snells law Fx = v1 2(x + 1)/(2l1 ) + v2 2(1 x)/(2l2 ) = 0 means v1 /v2 = sin(1 )/ sin(2 ). URLS http://www.povray.org http://www.povworld.org ocial povray site collection of objects
OTHER RAYTRACING PROGRAMS OR MODELERS. Note that Povray provides the source code to the software in contrast to commercial software which can be very expensive. http://www.blender.nl http://www.aliaswavefront.com http://www.lightwave.com http://www.corel.com http://www.curiouslabs.com http://www.eovia.com http://www.artice.com http://www.3dlinks.com Blender (free 3D modeling) Alias Wave Front (Maya) Lightwave 3D Bryce Poser (3D gure design) Carrara (Ray Dream studio) Radiance (architecture) Links
MATHEMATICA
VECTORS. Vectors v = (x, y, z), the dot product v w or the vector product v w. PROJECTION of v onto w is w(v w)/|w|2 . SCALAR PROJECTION: length of projection.
{3,4,5}+2.0*{-4,5,6} {3,4,5}.{-4,5,6}
Math21a, O. Knill
Cross[{3,4,5},{-4,5,6}] l[v_]:=Sqrt[v.v]; l[{3,4,5}]
f[x_,y_,z_]:=x^2 y z; F[x_,y_,z_]:={-y,x,z^2 x}; grad[U_]:={D[U[x,y,z],x],D[U[x,y,z],y],D[U[x,y,z],z]}; curl[F_]:={D[F[x,y,z][[3]],y]-D[F[x,y,z][[2]],z], D[F[x,y,z][[1]],z]-D[F[x,y,z][[1]],x], D[F[x,y,z][[2]],x]-D[F[x,y,z][[3]],y]}; div[F_]:=D[F[x,y,z][[1]],x] +D[F[x,y,z][[2]],y] +D[F[x,y,z][[3]],z];
DISTANCES. d(P, Q) = |P Q| d(P, Q + tv) = |(P Q) v)|/|v| d(P, Q + tv + sw) = |(P Q)(vw)| |vw| d(P + tv, Q + sw) =
|(P Q)(vw)| |vw|
P0={2,3,4}; Q0={3,4,6}; v0={1,1,1}; w0={2,4,-1}; l[v_]:=Sqrt[v.v]; PP[P_,Q_]:=Sqrt[(P-Q).(P-Q)]; PL[P_,{Q_,v_}]:=Module[{n=Cross[P-Q,v]/l[v]},l[n]]; PS[P_,{Q_,v_,w_}]:=Module[{n=Cross[v,w]},(P-Q).n/l[n]]; LL[{P_,v_},{Q_,w_}]:=Module[{n=Cross[v,w]},m=l[(P-Q).n]/l[n]; PP[P0,Q0] PS[P0,{Q0,v0,w0}] PL[P0,{Q0,v0}] LL[{P0,v0},{Q0,w0}]
f[x_,y_]:=Sin[x*y]-x^2*y; Dx[f_][x_,y_]:=D[f[u,v],u] /. {u->x,v->y} Dy[f_][x_,y_]:=D[f[u,v],v] /. {u->x,v->y} grad[f_][x_,y_]:={Dx[f][x,y,z],Dy[f][x,y,z]}; Dxx[f_][x_,y_]:=D[f[u,v],{u,2}] /. {u->x,v->y} Dxy[f_][x_,y_]:=D[D[f[u,v],u],v] /. {u->x,v->y} Dyy[f_][x_,y_]:=D[f[u,v],{v,2}] /. {u->x,v->y} hess[f_][x_,y_]:={{Dxx[f][x,y],Dxy[f][x,y]},{Dxy[f][x,y],Dyy[f][x,y]}} Q[x_,y_]:=f[1,1]+grad[f][1,1].{x-1,y-1}+(hess[f][1,1].{x-1,y-1}).{x-1,y-1}/2
PLANE CURVES. r(t) = (x(t), y(t)). SPACE CURVES. r(t) = (x(t), y(t), z(t)).
ParametricPlot[{Cos[t] Cos[17t],Sin[t] Cos[17t]},{t,0,2Pi}]
DSolve[D[p[x],x]==p[x]*(1-p[x]),p[x],x]
VECTOR FIELD. F (x, y) = (P (x, y), Q(x, y)) SURFACES. X(u, v) = (x(u, v), y(u, v), z(u, v)). GRAPHS. Graph of map z = f (x, y).
ParametricPlot3D[{v Cos[u],v Sin[u],5 v^3},{u,0,2 Pi},{v,-5,10}] Needs["GraphicsPlotField"] PlotVectorField[{-y,2 x},{x,-1,1},{y,-1,1}] PlotGradientField[x^2 y,{x,-1,1},{y,-1,1}] Needs["GraphicsPlotField3D"] PlotVectorField3D[{-y,2 x,z},{x,-1,1},{y,-1,1},{z,-1,1}] PlotGradientField3D[x^2 y z,{x,-1,1},{y,-1,1},{z,-1,1}]
S=Plot3D[Sin[x*y],{x,-2,2},{y,-2,2}]
INTEGRAL. Antiderivative
Integrate[Cos[Sqrt[x]],x]
b a
f (x) dx.
NIntegrate[Cos[Sqrt[x]]/x^2,{x,1,Infinity}]
LENGTH OF CURVE. a x + y 2 + z 2 dt. Explicit solutions with Integrate. DOUBLE INTEGRAL. TRIPLE INTEGRAL. LINE INTEGRAL.
b a b d f (x, y) a c b d f a c e
dxdy.
f (x, y, z) dxdydz.
WAVE EQUATION utt = c2 uxx . LAGRANGE MULTIPLIERS. Extremize F (x, y, z) under constraint G(x, y, z) = c. Solve system F (x, y, z) = G(x, y, z), G(x, y, z) = c for the x, y, z, .
F[x_,y_,z_]:=-x^2-y^2-z^2; G[x_,y_,z_]:=x+y+z; Solve[{D[F[x,y,z],x]== L*D[G[x,y,z],x], D[F[x,y,z],y]== L*D[G[x,y,z],y], D[F[x,y,z],z]== L*D[G[x,y,z],z], G[x,y,z]==1},{x,y,z,L}] s=NDSolve[{D[u[x,t],{t,2}] == D[u[x,t],{x,2}], u[x,0] == Sin[4*Pi*x], Derivative[0,1][u][x,0]==0, u[0,t] == u[1,t]}, u, {x,0,1}, {t,0,1}]; Plot3D[Evaluate[u[x,t]/. s[[1]]],{t,0,1},{x,0,1}]
Math21a, O. Knill
Dierential equations are laws which determine how a system evolves in time. An example of a system is our solar system. The motion of the planets is described by Newton equations, an ordinary dierential equation (ODE). An other example is the electromagnetic eld for a xed charge and current distribution. The motion of this system is described by Maxwell equations. In vacuum, they reduce to the wave equation, describing electromagnetic waves like light. The Maxwell equations or the wave equations are examples of partial dierential equations (PDEs). ODE. An ordinary dierential equation (ODE) is an equation relating derivatives f (t), f (t), ... of a function f or a curve t f (t). Only derivative with respect to one variable can appear. Otherwise, the equation is called a partial dierential equation (PDE). If derivatives up to the order n appear, the equation is called a dierential equation of order n. If f (t) is a vector in Rd , then the ODE is in d dimensions: Equation f (t) + cos(f (t) sin(t)) = 0 fx (x, y) + fy (x, y) = 0 x(t) = sin(x(t)) (x, y) = (y, x) curl(F ) = A ODE? yes no yes yes no Equation f (x) = f (x) sin(f (x)) = f (x) (f (x), g (x), h (x)) = F (f (x), g(x), h(x)) (, y) = (y, x) x (x)5 = x order 2 3 1 2 1 dim 1 1 3 2 1
EXISTENCE OF SOLUTIONS of x = F (x). Given x(0), there exists a solution x(t) for some time t [0, a] if F is smooth. Solutions dont always exist for all times: x = x2 can be solved by integrating dx/x2 = dt so that 1/x = t + c or x(t) = 1/(t + c). From x(0) = 1/c we get c = 1/x(0) and x(t) = 1/(t 1/x(0)). The solutions exists for t 1/x(0). THE EQUATION x = ax. For a > 0, it models a explosive chain-reaction or population growth (the number of newborn people is proportional to the number of people which exist already). For a < 0, x = ax has solutions which decay (example is radioactive decay: as more atoms there are, as more atoms decay). The explicit solution is x(t) = x(0)eat . For a = 0, there are only solutions x which are constant in time. LINEAR EQUATIONS. A ODE is linear if it can be written as x = Ax, where A is a matrix. It can be solved by x(t) = eAt x(0), where the matrix eB is dened as eB = 1 + B + B 2 /2! + B 3 /3!... and for example B 3 = BBB is obtained by matrix multiplication. To understand the solutions, it is helpful to choose coordinates in which A is simple, for example diagonal. (See Math21b). EXAMPLE. The ODE x = x is with y = x equivalant to (x, y) = (y, x) and can be written as x x 0 1 x d . Because A2 = 1, A3 = A, A4 = 1, A5 = A etc. we have = A = dt y y 1 0 y cos(t) sin(t) 1 t2 /2! + t4 /3! ... t t3 /3! + t5 /5! ... At leading to an explicit solution = e = sin(t) cos(t) t + t3 /3! t5 /5! + ... 1 t2 /2! + t4 /3! ... x(t) = cos(t)x(0) + sin(t)y(0), y(t) = sin(t)x(0) + cos(t)y(0). Indeed, the circular curves r(t) = (x(t), y(t)) solve the dierential equation. SEPARATION OF VARIABLES. A system x = g(x, t) (equivalently x = g(x, t), t = 1) can sometimes be solved by separation of variables: dx = f (x)g(t)dt or dx/f (x) = g(t)dt can be integrated: t If x = g(t), then x(t) = 0 g(t) dt. x If x = h(x), then dx/h(x) = dt and so t = 0 dx/h(x) = H(x) so that x(t) = H 1 (t). x t If x = g(t)/h(x), then H(x) = 0 h(x) dx = 0 g(t) dt = G(t) so that x(t) = H 1 (G(t)). 2 2 t In general, there are no closed form solutions (i.e. x = et has a solution x(t) = 0 et dt which can t2 2 4 6 = 1 t + t /2! t /3! + . . . is x(t) = not be expressed by exp, sin, log, , etc.. The anti-derivative of e t t3 /3 + t4 /(3 2!) t7 /(7 3!) + . . .). 2D SYSTEMS. A two dimensional ODE is of the form x = P (x, y), y = Q(x, y). If r(t) = (x(t), y(t)) is the solution curve, then the ODE tells that the velocity vector r (t) is equal to F (r(t)). Often a good understanding is achieved by drawing vector eld and some solution curves. Examples 2) and 3) below are 2D systems. Example 1) shows a system in three dimensions and also the timedependent system 4) became a 3D system when adding t as the z variable.
While for usual equations like x2 + 2x + 1 = 0, the unknown x is a number, for a dierential equation like x = x it is a function x(t) respectively a curve t x(t). Think always of t as time. SOLVING AN ODE. Solving an ODE means to nd all functions or curves which satisfy the equation. Examples. f (x) = f (x) has solutions ex or 5ex and f (x) = f (x) has solutions cos(x) or 4 sin(x) and (x (t), y (t)) = (2, x(t)) has solutions (2t, t2 ). FACT. Every ODE can be written as d/dtx(t) = F (x(t)), where F is a vector eld and x is a vector: PROOF. Solve F (f, f , f , . . . , f (n) ) = 0 for f (n) = G(f, f , f , . . . , f (n1) ) and introduce the vector x = (x1 , x2 , . . . , xn ) = (f, f , f , . . . , f (n1) ). Then x = (x2 , x3 , . . . , G(x1 , . . . , xn1 )) = F (x). Example: f (t) sin(f (t)) + f (t) = 0. Dene x = (x(t), y(t), z(t)) = (f (t), f (t), f (t)). Then d/dtx = (f (t), f (t), f (t)) = (sin(f (t)) f (t), f (t), f (t)) = (sin(y) x, y, x) = F (x). By introducing t as a separate variable, one can have F time-independent. F is then called autonomous. By increasing the dimension, an ODE can be written as a rst order autonomous system x = F (x). EXAMPLES OF ODEs. x(t) = ax(t). x = ax(1 x). x = ax. mj xj = i=j mi /|xi xj |2 Population models for a > 0, radioactive decay for a < 0 Logistic equation: population model Harmonic oscillator: describes periodic oscillations Newton equations. Example: xj positions of planets of mass mj .
1) LORENTZ SYSTEM. SOLVING DIFFERENTIAL EQUATIONS. The dierent approaches are illustrated with x = x.
1 1) Integration. To nd explicit solutions of dx/dt = x we write dx/x = dt or x dx = t + c. Integration on both sides gives log(x) = t + c or x(t) = et ec = Cet . 2) Expansion. For example by Taylor expansion: if x(t) = a0 + a1 t + a2 t2 + ..., then x(t) = a1 + 2a2 t + 3a3 t2 + .... Comparing coecients gives a1 = a0 , a2 = a1 /2 = a0 /2, a3 = a2 /3 = a0 /6 etc. so that 2 x(t) = a0 (1 + t/2 + t /3! + ...). 3) Approximation. Simplest numerical method is the linear approximation x(t + dt) = x(t) + dtx(t) = x(t) + dtx(t) = (1 + dt)x(t) and x(t + kdt) = (1 + dt)k x(t). If dt = t/n and k = n, then x(0 + t) = n x(0 + nt/n) = (1 + t/n) x(0).
x = 10(y x) y z
y[t]
0.5
= xz + 28x y 8z = xy 3
0.5
x[t]
-0.5
-1
Sharks 2 1.75 1.5 1.25 1 0.75 0.5 0.25 0.25 0.5 0.75 1 1.25 1.5 1.75 2 Shrimps
In the example, all three methods led to the correct solution x(t) = Cet . In 1), C was an integration constant, in 2), the zeroth Taylor coecient a0 , in 3), C = x(0). The explicit expression et came in 1) from anti-derivation, in 2) from (1 + t/2 + t2 /3! + ...) = et , in 3) from limn (1 + t/n)n = et . For most ODEs, there are no closed form solutions. One can work however with truncated Taylor series or approximating polygons x(dt), x(2dt), . . . for the path x(t).
Math21a, O. Knill
PDE. If an equation for a function contains derivatives with respect to dierent variables, it is called PDE. We will see examples of PDES, see how they are derived from physics and how one can solve them. EXAMPLES of partial dierential equations: ut = ux advection equation, models transport utt = u = uxx + uyy wave equation in 2D. ut = uxx heat equation in 1D ut = u = (uxx + uyy ) heat equation in 2D. utt = u m2 u Klein-Gordon equation, appears in quantum theory. u = uxx + uyy + uzz = 0 Laplace equation in 3D. grad(U ) = F search of potential U for vector eld F . (Need curl(F ) = 0). div(B) = 0, div(E) = 0, B = c curl(E), E = c curl(B). Maxwell equations in vacuum. curl(A) = F search of vector potential for vector eld F . (Need div(F ) = 0). u = 4 Poisson equation. charge, E = grad(u) is electric eld. ut + uxxx + 6uux = 0 KdV equation has soliton solutions famous nonlinear waves. o i u = h2 u/2m + V u Schrdinger equation h in quantum mechanics. utt uxx + sin(u) = 0 Sine-Gordon equation has kink-antikink solutions. u + u u = u p + f, div(u) = 0 Navier Stokes equations. Win 1 Mio prove existence! u = uux Burger equation, models shocks, breaking waves. u = (ux )2 /2 + V (x) Hamilton-Jacobi equation. Classical mechanics. det(f ) = Monge-Ampere equation, f Hessian of f = f (x, y, z). Appears in geometry.
(Check ut /u = r + (x2 2t)/(4t2 ), uxx /u = (x2 2t)/(42 t2 )). Also translations u(x s, t) are solutions. By superposition, sums of such functions are solutions and by passing to limits of Riemann sums, also integrals 1 u(x, t) = 4t
a(s)ert e(xs)
/(4t)
ds
is a solution. By taking the limit t 0, we see that a(s) = u(0, s). We have therefore an explicit formula for the solution of the diusion equation. The initial heat distribution determines the distribution at time t. It is considered an explicit formula. It can be generalized to arbitrary dimensions. The three pictures show an evolution in the plane.
DERIVATION OF HEAT EQUATION. Conservation of mass tells that the ux of a uid with density and j dS = speed j through a surface S bounding a region G is equal to the change of mass in the region S G dV . By Gauss theorem, S j dS = G div(j) dV so that G (div(j) ) dV = 0. Because the spherical region is arbitrary, we have f = div(j) = 0 (if the function f were not zero, we could chose a region G contained in f > 0). The density and the current are therefore linked by the continuity equation = div(j). If particles move randomly, they tend to move more likely from places with high density to places with low density. This means j = grad(). Plugging this into the continuity equation gives = div(grad)() = . This is the diusion equation, also called heat equation. DERIVATION OF THE WAVE EQUATION. The identity B = grad(div(B)) curl(curl(B)) gives together with div(B) = 0 and curl(B) = E/c the relation B = d/dtcurl(E)/c which leads with B = c curl(E) to the wave equation B = d2 /dt2 B/c2 . This equation Btt = c2 B (as well the equation Ett = c2 B derived in the same way) describes the propagation of electric and magnetic elds in vacuum. DERIVATION OF THE TRANSPORT EQUATION. Start again with the continuity equation u = div(j) = j x in one dimensions. If the current j is proportional to ux we get ut = aux . DERIVATION OF BURGERS EQUATION. If j = (u2 )x , this means that the current j depends nonlinearly on u, becoming large for large u. The corresponding equation ut = 2uux is a model for waves near the beach. SUPERPOSITION. A PDE is called linear if it is linear in each variable, as well as in u, u x , ut etc. The heat, Laplace, wave, advection or Maxwell equations in vacuum are linear. The Burger equation, Sin-Gordon or KdE equation are examples of nonlinear equations. If u and v are solutions of a linear equation, then u and the superposition u + v are solutions too. THE ADVECTION EQUATION. A general solution of ut = cux ru is u(t, x) = ert f (x + ct) , here f (x) = u(0, x). This formula provides an explicit solution of a PDE. The initial function u(0, x) determines u(t, x) at later time in an explicit way.
WAVE EQUATION. Write utt uxx = 0 as (t x )(t + x )u or (t + x )(t x )u. You see that if u satises the transport equation (t + x )u = 0 or (t x )u = 0, then u solves the wave equation. Solutions are f (x t) or g(x + t). Now, if u(0, x) = F (x) and ux (u, x) = G(x) are known and u(t, x) = f (x t) + g(x + t), then F (x) = u(0, x) = f (x) + g(x) and G(x) = ut (0, x) = f (x) + g (x) determine f and g: from F = f + g, F = f + g , G = g f we get f = (F G)/2 and g = (F + G)/2 and so f, g. The pictures show an evolution of the wave equation in two dimensions.
SOLUTIONS BY SEPARATIONS OF VARIABLE. Some linear equations in one dimension can be solved by starting with an Ansatz u(t, x) = T (t)X(x). TRANSPORT EQUATION. ut = T X, ux = T X . Because T /T = X/X does not depend on x (look at LHS) and not depend on t (look at RHS), it is a constant C and we have T (t) = eCt and X(x) = eCx and therefore u(t, x) = T (t)X(x) = eCt eCx = eC(t+x) . By summing up such solutions one build any solution f (t + x). DIFFUSION EQUATION. ut = T X, uxx = T X . Again, T /T = X /X is constant C = k 2 so that 2 2 T (t) = ek t and X(x) = eikx and u(t, x) = ek t eikx . (If X is a bounded function, then C can not be positive 2 so that we can write C = k 2 .) A general solution is a superposition u(t, x) = a(k)ek t eikx dx of such ikx solutions. One can determine a(k) from the initial condition u(0, x) = a(k)e dx using Fourier theory. WAVE EQUATION. Also the wave equation can be treated like that. We get T /T = X /X = C. Again C = k 2 and X(x) = eikx , T (t) = eikt so that u(t, x) = eikx eikt is a solution. We see that a(k)eik(xt) and b(k) = eik(x+t) are solutions. Superposition leads to arbitrary solutions u(t, x) = f (x t) + g(x + t). BEYOND PDEs. A computer which solves ODEs or PDEs numerically discretizes the system. u t is replaced by the dierence un+1 un , utt by un+1 2un un1 . The equation x = ax for example is discretizes as xn+1 xn = axn or xn+1 = (1 + a)xn . Instead of a curve x(t), the solution is a sequence xn . Time is discrete. Also PDEs can be discretized. The diusion equation becomes un+1,m un,m = un,m+1 2un,m + un,m1 which is un+1,m = un,m+1 un,m + un,m1 . This is also called a coupled map lattice. In each time step, a lattice conguration {un,m } m= is mapped into a new conguration. If also the values of un,m are discretizes, one gets a cellular automaton. Both can be used to simulate partial dierential equations numerically. 2
A great deal of my work is just playing with equations and seeing what they give. I dont suppose that applies so much to other physicists; I think its a peculiarity of myself that I like to play about with equations, just looking for beautiful mathematical relations which maybe dont have any physical meaning at all. Sometimes they do. Paul A. M. Dirac LAPLACE EQUATION. In the plane, the equation is u = divgradu = uxx + uyy = 0. Solutions are called harmonic. You have found such solutions already in an earlier homework assignment.
POISSON EQUATION. A generalization of the Laplace equation is the Poisson equation u = , where is a scalar function. If is a charge distribution, then u is the electric potential: The vector eld E = grad(u) satises the Maxwell equation div(E) = . The trick to solve this Maxwell equation is to solve the Poisson equation. There are solution formulas using Greens functions gd , depending on the dimension d: 1D 2D 3D u(x) = 1/2 u(x) = 1 2 u(x) = 1 4
R
R2
g1 g2 g3
Here is a general way to produce solutions: if z = x + iy is a complex number, then the real or imaginary part of (x + iy)n = rn ein are solutions of the Laplace equation. For example, u(x, y) = Re((x + iy)3 ) = x3 3xy 2 = r3 cos(3) or u(x, y) = Im((x + iy)3 ) = 3x2 y y 3 = r3 sin(3) solve the Laplace equation.
On the right, the notation f b = f (x y)g(y) dy is used. is a multiplication of functions called convolution. Fourier theory allow to prove these formulas with no eort: the Poisson equation u = becomes after Fourier transform d x2 u = so that u = gd , where gd = 1/ d x2 . Reversing the Fourier i=1 i i=1 i g transform gives u = gd (there is a general rule f = f g. Because the Fourier transform of 1/x2 is g1 (x) = |x|, 1 2 2 2 2 the Fourier transform of 1/(x + y ) is g2 (x) = 4 log |x + y | and the Fourier transform of 1/(x2 + y 2 + z 2 ) is 1 2 2 2 2 1/ (x + y + z ), the solution formulas become obvious. UNIQUENESS OF SOLUTIONS? Note that if you take a solution u of the Poisson equation and add a harmonic function u satisfying u = 0, you get an other solution. ABOUT THE GREEN FUNCTIONS. The Green functions gd are the natural Newton potentials in Rd . The one dimensional potential is studied because two innite planes attract each other with force |x|. The n-body problem with such potentials attractive (gravitational) or repelling (electric) is studied a lot. EXISTENCE OF SOLUTIONS. Having explicit solutions to partial dierential equations is rather exceptional. In general one has to work hard to establish existence of solutions. Existence can be subtle. Even for one of the simplest nonlinear PDEs grad(u) = F , there are not necessarily solutions. Only if curl(F ) = 0, then a potential u can exist. For nonlinear PDEs, existence can be very hard to prove. One million dollars have been written out by the Clay institute for a proof in the case of the Navier Stokes equation. Anyhow, as the following story shows, mathematicians are crazy about existence: An engineer, a chemist and a mathematician are staying in three adjoining cabins at an old motel. First the engineers coee maker catches re. He smells the smoke, wakes up, unplugs the coee maker, throws it out the window, and goes back to sleep. Later that night the chemist smells smoke too. She wakes up and sees that a cigarette butt has set the trash can on re. She says to herself, Hmm. How does one put out a re? One can reduce the temperature of the fuel below the ash point, isolate the burning material from oxygen, or both. This could be accomplished by applying water. So she picks up the trash can, puts it in the shower stall, turns on the water, and, when the re is out, goes back to sleep. The mathematician, of course, has been watching all this out the window. So later, when he nds that his pipe ashes have set the bed-sheet on re, he is not in the least taken aback. He says: Aha! A solution exists! and goes back to sleep ...
In one dimension, only linear functions u(x) = ax + b are harmonic: just solve uxx = 0. In three dimensions, harmonic functions are constructed in spherical coordinates u(r, , ) = Re(r l Plm (cos())eim ) with special polynomials Pl . The angular portions of such functions are called spherical harmonics and denoted by Y lm . The pictures show three examples. These functions are important for quantum mechanics because there are functions Rnl of r such that un,l,m (r, , ) = Rnl (r)Ylm (, ) dene stationary electron distributions in the hydrogen atom. Knowing about these functions allows to understand of the hydrogen atom and makes the construction of the periodic system of elements transparent.
PDEs IN MULTIVARIABLE CALCULUS. Where did PDEs matter in multivariable calculus? You can play with spherical harmonics in a Java applet on http : //www.sct.gu.edu.au/research/laserP/livejava/spher harm.html Harmonic functions have the prop2 erty that they are stationary solutions to the heat equation ut = u or the wave equation utt = c u or the Schrdinger equation of a free particle. o when doing partial derivatives, we checked that functions are solutions of PDEs. Examples were the continuity equation, the Laplace equation, the wave equation, the Burger equation. we have seen the meaning of the heat equation Tt = T using the divergence theorem. The Laplace equation f = 0 denes harmonic functions. We have seen relations between certain PDEs and the topology of the space: curl(F ) = 0 implied F = grad(f ) if simply connected div(F ) = 0 implied F = curl(G) if every sphere can be collapsed to a point grad(f ) = 0 implied f = const if region is connected the Maxwell equations illustrate the divergence theorem as well as Stokes theorem. we have seen the Poisson equation div(F ) = describing gravity as well as electrostatics.