Version: 4/1/06. Note: These notes are mostly from my 5B course, with the addition of the part on components and projections. Look them over to make sure that we are on the same page as regards inner-products, cross products, directions, components and projections. These come up immediately this term again, in the guise of the component v n of v in the normal direction and the component v T of v in the tangential direction. Even if most of these notes have been around a while, I just found three typos. Let me know other ones that you find, and I will update, clarify and expand. 1. Dot and Cross Product, Lines, Planes and Gradients We will write vectors in the form x = (x 1,..., x n ), as well as other ways. We will not worry about the difference between this horizontal x and its vertical brother col(x 1,..., x n ) = As explained in class, the main difference between these two ways to write a list of n numbers lies in algebra. Eg, if A is an n n matrix, A( horizonal x) is not strictly defined, the two matrices have the wrong sizes to multiply them, but we just understand Ax to be A applied to the vertical version, and then maybe convert back to horizontal mode, depending on the context. Note that x = (x 1,..., x n ) = x 1 (1, 0,..., 0) + + x n (0, 0,..., 1). The x i are the coordinates of x in the standard basis of IR n. If n = 2 or n = 3, we put i = (1, 0), j = (0, 1) if n = 2 and Then The length of x is x 1. x n. i = (1, 0, 0), j = (0, 1, 0), k = (0, 0, 1) if n = 3. (x 1, x 2 ) = x 1 i + x 2 j (x 1, x 2, x 3 ) = x 1 i + x 2 j + x 3 k. x = x 2 1 + + x 2 n. The distance from x = (x 1,..., x n ) to y = (y 1,..., y n ) is x y. Note that, for any scalar c, cx = (cx 1,..., cx n ) = c 2 x 2 1 + + c 2 x 2 n = c x. If n = 3, the law of cosines applied to the triangle with vertices 0 = (0, 0, 0), x, y states (draw a pic) (1.1) y x 2 = x 2 + y 2 2 cos(θ) x y 1
2 where θ is the angle between x and y. Now (1.2) x y 2 = (y 1 x 1 ) 2 + (y 2 x 2 ) 2 + (y 3 x 3 ) 2 Comparing (1.1) and (1.2) we have = x 2 1 + x 2 2 + x 2 3 + y 2 1 + y 2 2 + y 2 3 2(x 1 y 1 + x 2 y 2 + x 3 y 3 ) = x 2 + y 2 2(x 1 y 1 + x 2 y 2 + x 3 y 3 ). (1.3) x 1 y 1 + x 2 y 2 + x 3 y 3 = cos(θ) x y. The left hand side is written x y and called the inner-product or scalar product of x and y. Thus (1.4) x y = x y cos(θ) or, if x y 0, cos(θ) = x y x y. Example: Compute the cosine of the angle between (1,2,3) and ( 6, π, e). Soln: cos(θ) = (1, 2, 3) ( 6, π, e) (1, 2, 3) ( 6, π, e) = 6 + 2π + 3e 1 + 4 + 9 36 + π2 + e. 2 The inner-product makes sense in n dimensions: (1.5) x y = (x 1,..., x n ) (y 1,..., y n ) = x 1 y 1 + + x n y n, as do the relations (1.4), except that we have little intuition about angles in, say, 27 dimensional space. However, we take the point of view now that (1.4) defines the cosine of the angle between x and y. In order to define cos(θ) by (1.4), we need to know that x y / x y can t be bigger than 1. Cauchy-Schwarz inequality: (1.6) x y x y. Why is this true? Note that (1.2) says (a) below, (1.7) (a) x y 2 = x 2 + y 2 2(x y) (b) x + y 2 = x 2 + y 2 + 2(x y), while (b) is the same thing with y replaced by y. For any t 0 x + ty 2 = x 2 + 2t (x y) + t 2 y 2. Minimize with respect to t : setting the t derivative equal to 0 we find t min = x y y 2, (y = 0 is a trivial case of (1.6)), plug in t min, find 0 x + t min y 2 = x 2 2 x y ( ) 2 x y (x y) + y 2 = x 2 y 2 y 2 (x y)2 y 2,
whence (1.6). Note that the inequality is strict, that is unless x + t min y 2 = 0, which amounts to (x y) 2 < x 2 y 2, (1.8) x = x y y 2 y. Properties of x y. x y = y x (ax + by) z = a(x z) + b (y x) (or x x y, y x y are linear). x 2 = x x. We say x and y are orthogonal (equivalently, perpendicular, equivalently x y) if (1.9) x y = 0. Cross product: given two vectors in IR 3, say x = (x 1, x 2, x 3 ), y = (y 1, y 2, y 3 ), we define i j k x y = det x 1 x 2 x 3 = (x 2 y 3 x 3 y 2 ) i + (x 3 y 1 x 1 y 3 ) j + (x 1 y 2 x 2 y 1 ) k (1.10) y 1 y 2 y 3 = (x 2 y 3 x 3 y 2, x 3 y 1 x 1 y 3, x 1 y 2 x 2 y 1 ). Note that if z = (z 1, z 2, z 3 ) = z 1 i + z 2 j + z 3 k, then z (x y) = det in particular, x (x y) = 0, y (x y) = 0. Also, (1.11) x y 2 = x 2 y 2 (x y) 2 z 1 z 2 z 3 x 1 x 2 x 3 y 1 y 2 y 3 ; = x 2 y 2 (1 cos 2 (θ)) = x 2 y 2 sin 2 (θ). So x y x, x y y and x y = x y sin(θ). Other Properties of x y. x y = y x (the cross product is antisymmetric) x (ay + bz) = ax y + bx z (x x y is linear) (ax + by) z = ax z + by z (y x y is linear) x (y z) = (x z)y (x y)z where a, b IR and x, y, z IR 3. 3
4 1.1. Components and Projections. Suppose A, B are given vectors in IR n and B 0. We attempt to write (1.12) A = αb + C where C is perpendicular to B. That is, in a picture, if we put the tails of A and αb at the same point, say the origin, and form the triangle with the three vertices: the origin, the head of A and the head of αb, the result is a right triangle. Draw the picture and understand this. C is the vector joining from the head of αb to the head of A. Can this be done? If (1.12) holds and C B, the taking the inner-product of both sides with B yields A B = αb B + C B = α B 2, or (1.13) α = A B B 2 From the way we found α, it is the only number for which C = A αb is perpendicular to B; let us check: (A A B B 2 B) B = A B A B B 2 B B = A B A B B 2 B 2 = 0. The component of A in the direction of B is the number α B = A B B. For this number we have ( A A B B ) ˆB B. where ˆB = B B is the unit vector parallel to B, aka the direction of B. For us, direction means unit vector and any nonzero vector B has a direction, ˆB, as above. The vector αb is the projection of A along B (or along the direction of B). 1.2. Planes and Lines in 3d. In this section, in contrast with the above, we use x, y, z as the three coordinates in space. That is, x, y, z are numbers, not vectors. Take careful note. Where do we meet the dot product? A plane in IR 3 is the set of solutions (x, y, z) of one linear equation (1.14) Ax + By + Cz = D
where A, B, C, D are given real numbers with at least one of A, B, C not being 0. Let P be the plane (1.14) and (x 0, y 0, z 0 ) P, then and (1.14) can be rewritten Ax 0 + By 0 + Cz 0 = D (1.15) (A, B, C) (x x 0, y y 0, z z 0 ) = A(x x 0 ) + B(y y 0 ) + C(z z 0 ) = 0. This says that (x, y, z) P iff N (x x 0, y y 0, z z 0 ) where N = (A, B, C). The vector N is called a normal to the plane (draw a pic). Another idea of a plane in IR 3 is that it contains a point, call it (x 0, y 0, z 0 ) and two directions, along which one can move and stay in the plane. That is, for two independent vectors v 1, v 2, the points of the plane are of the form (1.16) (x, y, z) = (x 0, y 0, z 0 ) + sv 1 + tv 2 for some s, t IR. This is called a parametric representation of the plane. This is the same thing as asking that (1.15) hold where N = (A, B, C) is a nonzero vector satisfying N v 1, N v 2. Indeed, (1.16) implies N ((x, y, z) (x 0, y 0, z 0 )) = N (sv 1 + tv 2 ) = sn v 1 + tn v 2 = 0. We know that we may take N = v 1 v 2. Parametric equation of a line: through (x 0, y 0, z 0 ) parallel to v = a i + b j + c k : (1.17) (x, y, z) = (x 0, y 0, z 0 ) + tv or x = x 0 + ta, y = y 0 + tb, z = z 0 + tc. Problems: Find the equation of a plane containing three points, a point and two directions, two points and parallel to a line, one point and parallel to a plane. You will need your notes from class here, I don t have time to type up the examples. 1.3. Gradients and Directional Derivatives. Here is another place we meet the dot product. Let f(x, y, z) be a function of (x, y, z). If x = g(t), y = h(t), z = k(t), the chain rule tells us (1.18) d f = f dx x + f dy y + f ( dz f z = x, f y, f ) ( dx z, dy, dz ) ( dx = f, dy, dz ) where ( f f = x, f y, f ) z is called the gradient of f. This is nothing new, it is basically the Jacobian matrix of f, we are just thinking of it as a vector now. If (x(t), y(t), z(t)) is moving on a line at constant speed, that is, for some vector v = (v 1, v 2, v 3 ) and (x 0, y 0, z 0 ), we have (1.19) (x(t), y(t), z(t)) = (x 0, y 0, z 0 ) + tv = (x 0 + tv 1, y 0 + tv 2, z 0 + tv 3 ), 5
6 we have (1.20) d f = f(x 0, y 0, z 0 ) v. t=0 This is the derivative of f along v. If v is a unit vector, that is v = 1, we call this the directional derivative of f in the direction v. In general, for us, the direction of a vector v (in any number of dimensions) is the vector of unit length parallel to v. That is, direction of v = 1 v v = v v. Note that v v = 1 v = 1; v or course, only nonzero vectors have a direction. In what direction is f increasing most rapidly? Answer: the direction of f! Indeed, the directional derivative of f in a direction v is f v = f v cos(θ) = f cos(θ) which is biggest ( f ) if cos(θ) = 1 and smallest ( f ) when cos(θ) = 1. If v is any nonzero vector, the derivative of f along v, f v, can also be written ( ) v (1.21) f v = f v = (derivative of f in the direction of v) length of v. v Example: A space ship is traveling in, of all things, space. At time t = 0 it is at (1, 3, 5). The temperature in this region of space, which is in the vicinity of the sun, is given by T = x 2 y sin(x)+yz. In which direction should the ship head to cause the temperature to increase most rapidly? How about the direction of most rapid decrease? Ans: temperature increases most rapidly in the direction of f = (2x y cos(x), sin(x)+z, y). At (1,-3,5), this is 1 (2 3 cos(1), 5 sin(1), 3). (2 3 cos(1))2 + (5 sin(1)) 2 + 9 The direction of most rapid decrease is 1 (2 3 cos(1), 5 sin(1), 3). (2 3 cos(1))2 + (5 sin(1)) 2 + 9 If c(t) = (x(t), y(t), z(t)) = (g(t), h(t), k(t)) is a curve in space, think of it as giving the position of a particle at time t, then the velocity of the particle at time t is ( dx (1.22) c (t) =, dy, dz ) = (g (t), h (t), k (t)).
7 The speed is (dx ) 2 c (t) = + ( ) 2 dy + The tangent line to the curve at t = t 1 is given by ( ) 2 dz = g (t) 2 + h (t) 2 + k (t) 2. l(t) = c(t 1 ) + (t t 1 )c (t 1 ) = (g(t 1 ), h(t 1 ), k(t 1 )) + (t t 1 )(g (t 1 ), h (t 1 ), k (t 1 )). The tangent line gives the position of a particle which is at the same place as c(t) at t = t 1 and has constant velocity c (t 1 ). The vector c (t 1 ) is said to be tangent to c(t) at t = t 1. The direction of c (t 1 ) is also tangent, and it is the unit tangent vector c (t 1 )/ c (t 1 ). This is the direction of the motion - or particle - at t = t 1. Note that velocity = c (t 1 ) = c (t 1 ) c (t 1 ) c (t 1 ) = speed direction Example: A space ship has the position c(t) = (t 2, 2t, cos(t)). A superbug riding on the space ship releases from the ship at time t = 5. Far from any massive bodies and having no engines, the bug travels in a straight line at constant velocity. Where is it at time t = 7? Ans: c(5) + (7 5)c (5). Example: The temperature field is given by T (x, y, z) = xy 2 + z. A creature is at the location (1,2,-3) moving with speed 7 in the direction of (5, 11, 7). At what rate is its temperature changing? Ans: If c(t) is the position of the creature, with time chosen so that c(0) = (1, 2, 3), the information we are given is that Thus, for the creature, c 1 (0) = speed direction = 7 (5, 11, 7). 25 + 121 + 49 d T t=0 = T (1,2, 3) c (0) = (y 2, 2xy, 1) (1,2, 3) c (0) 1 = 7 (4, 4, 1) (5, 11, 7) 25 + 121 + 49 1 = 7 (20 + 44 + 7) 35.6 25 + 121 + 49 1.3.1. Level Sets and Tangent Planes. Suppose the curve c(t) lies in the level set L = {(x, y, z) : f((x, y, z)) = K} of f. Then f(c(t)) = K is constant and d f(c(t)) = ( f(c(t))) c (t) = 0. Let (x 0, y 0, z 0 ) L and consider all curves in L passing through (x 0, y 0, z 0 ) at time 0. It is natural to define the tangent plane to L at (x 0, y 0, z 0 ) by requiring the set of all velocity
8 vectors c (0) of such curves to be parallel to this plane. We conclude that f(x 0, y 0, z 0 ) is orthogonal to all vectors along this plane, which is then given by (1.23) f(x 0, y 0, z 0 ) (x x 0, y y 0, z z 0 ) = 0. Example: Find the equation of the tangent plane to the surface x 3 yz = 1 at (1, 0, 11). Ans: (1.24) (3x 2, z, y) (1,0,11) (x 1, y 0, z 11) = 0 or 3x 11y = 3. We note that the graph of a function z = f(x, y) is the level set F = 0 of the function (1.25) F (x, y, z) = z f(x, y). Therefore, by the above, the tangent plane to a point (x 0, y 0, z 0 ) on the graph (so z 0 = f(x 0, y 0 )) is given by g(x 0, y 0, z 0 ) (x x 0, y y 0, z f(x 0, y 0 )) = ( f ) x, f y, 1 (x x 0, y y 0, z f(x 0, y 0 )) = 0 (x 0,y 0 ) or z = f(x 0, y 0 ) + f x (x 0, y 0 )(x x 0 ) + f y (x 0, y 0 )(y y 0 ), which amounts to the familiar linear approximation of f.