<<

MATH 241, SECTION B1 CLASS NOTES

1. 14.6: the directional and vector 1.1. Introduction. Recall that the of a function z = f(x, y) with respect to x at a point (a, b) is defined as ∂f f(a + h, b) − f(a, b) (a, b) = lim ∂x h→0 h Similarly ∂f f(a, b + h) − f(a, b) (a, b) = lim ∂y h→0 h ∂f One interpretation: ∂x (a, b) measures the instantaneous change of z = f(x, y) at (a, b) as we move along the line y = b (respectively along x = a). This begs the question: as with limits, what happens if we approach (a, b) along a different direction? Answer: we get the . 1.2. Definition and first examples. To begin: recall that the line through a point (a, b) in the direction of the vector v = hv1, v2i, is given by thv1, v2i + ha, bi. Note that we can choose any scalar multiple of v and get a line in the same direction. So assume that v is a unit vector (we can use v/|v|). Definition 1.1. For any function z = f(x, y), the directional derivative of f at a point (a, b) in the direction of v = hv1, v2, i for a unit vector v is the limit (if it exists)

f(a + hv1, b + hv2) − f(a, b) Dvf(a, b) = lim h→0 h ∂f ∂f Note: in the special cases where v = i or v = j, Dif(a, b) = ∂x (a, b) and Djf(a, b) = ∂y (a, b). 2 Note: we generally treat (a, b) as variables, defining a map Dvf : R → R. However, we can also treat v as a variable, getting a map Df : R2 → R2 → R. This is called the total derivative of f. This is the first and last we’ll see of Df in this course. Directional will be easy to calculate once we know our partial derivatives:

Theorem 1.2. If z = f(x, y) is differentiable, then f has directional derivative in direction v = hv1, v2i satisfies Dvf(x, y) = fx(x, y)v1 + fy(x, y)v2

Proof. Note that for g(h) = f(a + hv1, b + hv2),

0 g(h) − g(0) f(a + hv1, b + hv2) − f(a, b) g (0) = lim = lim = Dvf(a, b) h→0 h h→0 h 2 is a composition of the function f with the function ` : R → R `(h) = (a + hv1, b + hv2). Using the chain 0 dx dy 0 rule, g (h) = fx(x, y) dh + fy(x, y) dh = fx(x, y)a + fy(x, y)b. So g (0) = fx(a, b)a + fy(a, b)b.  Note that this works just as well for functions of three variables; if w = f(x, y, z), then the directional derivative in a direction u = hu1, u2, u3i is defined similarly and satisfies Duf(x, y, z) = fx(x, y, z)u1 + fy(x, y, z)u2 + fz(x, y, z)u3. √ √ 2 3 Example 1.3. For v = h 2/2, 2/2i and z = f(x, y) = x y − 2y , find Dvf(2, −1).

2 2 fx(x, y) = 2xy and fy(x, y) = √x − 6y . So f is√ differentiable√ (fx and fy are√ continuous everywhere); therefore Dvf(−1, 2) = fx(−1, 2)( 2/2) + fy(−1, 2)( 2/2) = 2/2(−4 + −2) = 3 2.

Date: June 26th. 1 1.3. The gradient vector.

Definition 1.4. The gradient vector of a function f at a point (x, y) is the vector ∇f = hfx(x, y), fy(x, y)i. Note that we may treat the input point (x, y) determining the gradient vector as a variable; this gives us a function ∇f : R2 → R2. This is called a vector field; we’ll talk more about these in a couple weeks. Example 1.5. Find ∇f(0, 1) for f(x, y) = sin(x) + exy.

xy xy xy xy fx(x, y) = cos(x) + ye and fy(x, y) = xe . So ∇f(x, y) = hcos(x) + ye , xe i. Therefore ∇f(0, 1) = h2, 0i.

The key fact relating this to the directional derivative: for f differentiable, v = hv1, v2i,

Dvf(a, b) = fx(a, b)v1 + fy(a, b)v2 = hfx(a, b), fy(a, b)i · v √ xy Example 1.6. Find Duf(0, 1) for u = h1/2, 3/2i and f(x, y) = sin(x) + e .

From last example: ∇f(0, 1) = h2, 0i. So * √ + 1 3 D f(0, 1) = ∇f(0, 1) · u = h2, 0i · , = 1 u 2 2 This calculation shortcut to the directional derivative allows us to answer an interesting question: what unit vector u allows us to maximize Duf(x, y)? i.e., in what direction in the xy-plane do I need to head in order to get the maximum change in z? The answer:

Theorem 1.7. Suppose that f is differentiable, u a unit vector, P a point. Then Duf(P ) is maximal when u and ∇f(P ) point in the same direction. In this case, Duf = |f(P )|. Proof. Du(P ) = ∇f(P ) · u = |∇f(P )||u| cos(θ) = |∇f(P )| cos(θ) where θ is the angle between u and ∇f(P ). cos(θ) is maximal when θ = 0.  Example 1.8. For f(x, y) = 1 − x2 − y2, find the direction of maximal rate of change of f at the point (2, 1). What is this maximal rate of change?

The maximal rate of change lines up with the gradient√ ∇f = h−√2x, −2yi. at (2, 1), this takes the form h−4, −2i. The rate of change here is just |∇f(2, 1)| = 42 + 22 = 20. *Draw level sets for the above example* Notice that the gradient vector is perpendicular to the level set z = −4. This is not an accident; the gradient vector ∇f(a, b) will always be perpendicular to the level set is lies on (more precisely: perpendicular to the tangent line of a level set). We will use this fact later this week and we will see why this is true sometime next week (maybe). 1.4. Directional derivatives, the gradient vector, and tangent planes. If F (x, y, z) = 0 is a surface (e.g., for x2 + y2 + z2 = 1, we use F (x, y, z) = x2 + y2 + z2 − 1), then the surface is a level set associated to F . Just as gradient vectors for functions z = f(x, y) are perpendicular to level curves, gradient vectors for surfaces w = f(x, y, z) are perpendicular to level surfaces. In particular, this means that for any point P on the surface F (x, y, z) = 0, ∇F (P ) gives the normal vector to the surface at P . Example 1.9. Find the equation to the tangent plane of x2 + y2 + z2 = 1 at any point P .

This is a sphere. Using F (x, y, z) = x2 + y2 + z2 − 1, ∇F (x, y, z) = h2x, 2y, 2zi. This matches what we saw on a previous groupwork exercise; the tangent planes to a sphere at (x, y, z) are perpendicular to the vector hx, y, zi. 2 Something interesting about this example: in the case where z = 0, the sphere equation we normally use is not differentiable here; i.e., if we wanted to think of (part of) the sphere as a graph we would need to use z = p1 − x2 − y2 (or its negative counterpart). But this function is NOT differentiable at z = 0 (i.e., when x2 + y2 = 1); it is easy enough to check the partial derivatives are not defined here. So ∇F gives us an easy formula for the tangent plane normal vector even in the case where our surface is not the graph of a function.

3