Lecture 7 Gradient and Directional Derivative (Cont'd)
Total Page:16
File Type:pdf, Size:1020Kb
Lecture 7 Gradient and directional derivative (cont’d) In the previous lecture, we showed that the rate of change of a function f(x,y) in the direction of a vector u, called the directional derivative of f at a in the direction uˆ, is simply the dot product of the gradient vector ∇~ f(a) with the unit direction vector uˆ: ∂f ∂f Duf(a)= ∇~ f(a) · uˆ = (a)u + (a)u . (1) ˆ ∂x 1 ∂y 2 The gradient vector ∇~ f(a) contains all the information necessary to compute the directional derivative of f at a in any direction. We then considered the “hotplate temperature function” f(x,y) = 50 − x2 − 2y2 and computed the rate of change of temperature at the reference point (1, −1) – the location of an ant – in several directions. We found that the direction u = (1, −1) was a good direction if the ant wanted to cool itself, but the question remained: Is it the best direction? In order to answer this question, we should return to Eq. (1). Let’s rewrite the dot product in Eq. (1) as follows, Duˆ f(a) = k ∇~ f(a) kk uˆ k cos θ (2) = k ∇~ f(a) k cos θ, where θ is the angle between the unit vector uˆ and ∇~ f(a). We have expressed the directional derivative Duˆ f(a) in terms of the magnitude of the gradient vector ∇~ f(a) evaluated at a and the angle between the gradient vector and the direction vector uˆ. We have all that we need. The function cos θ can assume all values between 1 and −1. Its maximum value 1 corresponds to θ = 0. Its minimum value −1 corresponds to θ = π. It assumes the value of 0 at θ = ±π/2. This leads to the following three special cases: 1. θ = 0. Then uˆ points in the direction of ∇~ f(a). In this case, the rate of change Duˆ f assumes its maximum (or most positive) value, k ∇~ f(a) k≥ 0. This is the direction of steepest ascent of f at (a, b). 45 2. θ = π. Then uˆ points in the direction of −∇~ f(a). In this case, the rate of change Duˆ f assumes its minimum (or most negative) value, − k ∇~ f(a) k≤ 0. This is the direction of steepest descent of f at (a, b). 3. θ = ±π/2. Then uˆ points in a direction that is perpendicular to ∇~ f(a). In this case, the rate of change Duˆ f is zero. There are some noteworthy consequences of these consequences! 1. Directions in which the rate of change of f are zero must be tangent to the level curve of f that passes through (a, b). Why? If you travel on a level curve, the value of f does not change. And the instantaneous direction of motion at any point on this curve is the tangent vector to the curve at that point. 2. The gradient vector ∇~ f(a, b) must be perpendicular to the level curve of f that passes through (a, b). These results are sketched below. direction of steepest ascent of f ∇~ f −∇~ f level set of f(x, y) passing through (x, y) direction of steepest descent of f Example: We now return to the ant-hotplate problem f(x,y) = 50 − x2 − 2y2. Recall that the gradient vector field of f is ∇~ f(x,y)= −2xi − 4yj. (3) And recall that the ant was situated at (a, b) = (1, −1). The question that remained unanswered in the last lecture was, “In which direction should the ant start to travel in order to cool itself as quickly as possible?” We now know the answer to this question - the ant should travel in the direction of 46 −∇~ f(1, −1), the direction of steepest descent at (1, −1). This is the vector ∇~ f(1, −1) = −2i + 4j. (4) Note that this vector does not point directly at the origin, the hottest point on the plate, but this is because of the elliptical nature of the level curves, as we’ll see below. If we now consider all points (x,y) on the hotplate, the temperature function f(x,y) defines a scalar field on this plate – you need only one number to characterize the temperature at a point. Associated with this scalar field is the vector field defined by the gradient vector ∇~ f(x,y). Why is it a vector field? Because it is measuring rates of change of the scalar field – in particular, ∇~ f(x,y) defines (i) the direction of steepest ascent as well as (ii) the magnitude of the rate of change in that direction. Magnitude + direction = vector. The gradient field ∇~ f(x,y) defined by the temperature function f(x,y) is sketched roughly in the next figure. As expected, the vectors point “inward.” y x Sketch of the gradient vector field ∇~ f(x, y)= −2xi − 4yj. The gradient field points inward because f(x,y) is increasing as we move toward (0, 0), at which f achieves its global maximum: ∇~ f(0, 0) = (0, 0). Notice that the magnitudes of the gradient vectors decrease as we approach (0, 0) – this implies that the magnitudes of the rates of change are decreasing, indicating that the graph of f is flattening out as we approach the local maximum (0, 0). The relationship between the gradient vectors – as directions of steepest ascent – and level curves – as contours of equal value – is clearly illustrated in the second figure below, in which both are plotted for the hotplate temperature function. 47 y direction f of steepest ascent of f(x,y) x level set f(x,y)= C Sketch of gradient field vectors ∇~ f(x, y) and level curves for the hotplate function f(x, y)=50 − x2 − 2y2. Actually, the ant – and nature, as we’ll see below – is more interested in the vector field −∇~ f: the direction of maximum decrease, or steepest descent, of the temperature function f(x,y). At each point (x,y), the vector −∇~ f(x,y) gives the best direction for which the ant to travel in order to cool itself as quickly as possible. A sketch of this vector field, along with some level curves, is given below. y direction f of steepest descent of f(x,y) x level set f(x,y) = C Sketch of gradient field vectors −∇~ f(x, y) and level curves for the hotplate function f(x, y)=50 − x2 − 2y2. In fact, this vector field is quite relevant to the physical phenomenon of heat flow: Heat always travels from a region of higher temperature to one of lower temperature in roughly the most efficient manner. (We use the word “roughly” because the process of heat transfer involves the random collision of molecules that leads to transfer of kinetic and rotational energy.) A simplified version of Fourier’s “Law” of Cooling is as follows: 48 h = −κ∇~ T (5) Here, h is the “heat flux vector” that characterizes the heat flow, both in terms of direction and the amount of heat going through a unit volume per unit time. T (x,y,z) is the temperature function and κ is the thermal conductivity, a constant that is specific to the medium of interest. Once again, note that heat flows in the direction of the negative gradient, i.e., the direction of steepest descent of the temperature function T . And the greater the magnitude of ∇~ T , i.e., the greater the rate of change of T in this direction, the greater the flow of heat, which makes intuitive sense. Notes: 1. The word “Law” was put in quotes since it is not a law, but rather a mathematical model of a physical process. In the same way, as we’ll discuss later, Hooke’s “Law” for springs is not a law but a simplified mathematical model. 2. The thermal conductivity κ above was assumed to be constant in this simplified form of Fourier’s Law. In reality, κ may vary from region to region. As well, because of the microstructure of the medium, i.e., the way that atoms in the medium are bound to each other, the conductivity may be different in various directions – for example, it may be easier to flow in the x-direction than in the y- and z-directions. For this reason, κ may have to be represented by a tensor. You will encounter tensors in your third-year mathematical physics course.) A few words on heat transfer and transport processes in general In fact, heat transfer is a special case of a transport process – the movement of “something,” whether it be heat, a chemical in solution, or bacteria in air – from regions of higher concentration to regions of lower concentration. The transfer is described by a flux density vector field F that gives the direction of motion at a point as well as the rate of transfer of the “something.” Heat transfer is a special case of Fick’s Law of transport which states that the flux vector F points in the direction of steepest descent of the concentration f of the “something” concerned, i.e., F(x,y,z)= −k∇~ f(x,y,z), (6) where k > 0 is a constant specific to the process and material being studied. Once again, the direction 49 of the flow is away from regions of higher concentration. This idea will be important in your future studies of transport processes. The gradient vector and directional derivatives in higher dimensions The definition of the gradient vector given earlier for functions of two variables f(x,y) extends in a natural way to scalar valued functions f : Rn → R where n ≥ 2: ∂f ∂f ∇~ f(x)= (x)e1 + · · · + (x)en, (7) ∂x1 ∂xn n where x = (x1,x2, · · · ,xn) and the the ek, k = 1, 2, · · · ,n are unit vectors in R .