Lecture 10 - Gradient Vectors
Lecture 10 - Gradient Vectors
Recall the chain rule for multivariable function 𝑤 = 𝑓(𝑥, 𝑦, 𝑧) , where 𝑥 = 𝑥(𝑡), 𝑦 =
𝑦(𝑡), 𝑧 = 𝑧(𝑡)
𝑑𝑤 𝑑𝑥 𝑑𝑦 𝑑𝑧
= 𝑓! + 𝑓" + 𝑓#
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑡
We can rewrite this with a new notation. Define a (position) vector 𝑟⃑(𝑡) = 𝑥(𝑡)𝚤̂ +
𝜕𝑓 𝜕𝑓 𝜕𝑓 𝜕𝑓 𝜕𝑓 𝜕𝑓
∇𝑓 = 𝚤̂ + 𝚥̂ + 𝑘3 = 〈 , , 〉
𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
$% $'⃑(&)
Then $&
= ∇𝑓 ⋅ $&
. This newly defined vector ∇𝑓 = 〈𝑓! , 𝑓" , 𝑓# 〉 is called “Gradient
vector” (or Gradient) of function 𝑓(𝑥, 𝑦, 𝑧) at some point (𝑥, 𝑦, 𝑧). Gradient refers to the
Remarks:
• At each point (𝑥, 𝑦, 𝑧), ∇𝑓 gives a vector. For a certain region of points, ∇𝑓 gives a
• ∇𝑓 is read as “grad 𝑓”, or “gradient of 𝑤”, or “del 𝑓”. ∇ by itself is read as “del”.
+ + +
• ∇: vector differential operator: ∇= +! 𝚤̂ + +" 𝚥̂ + +# 𝑘3
∇(𝑐, 𝑓 + 𝑐- 𝑔) = 𝑐, ∇𝑓 + 𝑐- ∇𝑔
• Recall that function 𝑓(𝑥, 𝑦) around (𝑥. , 𝑦. ) can be approximated with a plane, i.e.,
= 𝑓(𝑥. , 𝑦. ) + ∇𝑓(𝑥. , 𝑦. ) ⋅ 〈𝑥 − 𝑥. 𝑦 − 𝑦. 〉
From point (𝑥. , 𝑦. ) to nearby point (𝑥, 𝑦) = (𝑥. + Δ𝑥, 𝑦. + Δ𝑦), we have
Solution:
𝜕𝑓 𝜕𝑓 𝜕𝑓
∇𝑓 = 𝚤̂ + 𝚥̂ + 𝑘3
𝜕𝑥 𝜕𝑦 𝜕𝑧
𝑧
= @2𝑥 + B 𝚤̂ + (2𝑦)𝚥̂ + (−4𝑧 + ln 𝑥)𝑘3
𝑥
Solution:
∇𝑓 = (2𝑥)𝑖̂ + (−2𝑦)𝑗̂
∇𝑓 = 2𝚤̂ + 2𝚥̂
In vector calculus, the gradient of a scalar field is a vector field that points in the direction
of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.
In simple terms, the variation in space of any quantity can be represented (e.g. graphically) by a
slope.
Interpretations:
• For example, consider a room in which the temperature is given by a scalar field 𝑇, so at
each point (𝑥, 𝑦, 𝑧) the temperature is 𝑇(𝑥, 𝑦, 𝑧) (we will assume that the temperature
does not change in time). Then, at each point in the room, the gradient of 𝑇 at that point
will show the direction in which the temperature rises most quickly. The magnitude of
the gradient will determine how fast the temperature rises in that direction.
• Consider a surface whose height above sea level at a point (𝑥, 𝑦) is 𝐻(𝑥, 𝑦). The gradient
of 𝐻 at a point is a vector pointing in the direction of the steepest slope at that point. The
steepness of the slope at that point is given by the magnitude of the gradient vector |∇𝑓|
Summary:
The gradient is a fancy word for derivative, or the rate of change of a function. It’s a vector (a
increase)
We can use concept of directional derivative in Lecture 15 to explain why gradient vector gives
Example 3: Watch out for which gradient you are looking for
Given a surface 𝑧 = 𝑓(𝑥, 𝑦) = 𝑥 - + 𝑦 - . We can also say that this surface is one of the level
∇𝑓 = 2𝑥𝚤̂ + 2𝑦𝚥̂
∇𝑤 = −2𝑥𝚤̂ − 2𝑦𝚥̂ + 𝑘3
• Given a point 𝑃. (1,1) which is on level curve 𝑧 = 2. We have the gradient vector of
This vector points to the direction of greatest increase for variable 𝑧 or function 𝑓(𝑥, 𝑦) at
location 𝑃. (1,1).
This vector points to the direction of greatest increase for variable 𝑤 or function
The graphs showing here were generated using Maple to illustrate the differences.
Question: What are the gradient vectors of ∇𝑓 and ∇𝑤 at points (0,0) and (0,0,0), respectively?
Theorem:
For example: Given 𝑧 = 𝑓(𝑥, 𝑦). Suppose its level curves or contour plot is shown
below. Then a gradient at any point (𝑥, 𝑦) gives a vector perpendicular to that level
curve.
∇𝑓
𝑦
∇𝑤 = 〈𝑎" , 𝑎! , 𝑎# 〉
This is a plane equation in 3D space and the normal vector to this plane is
〈𝑎, , 𝑎- , 𝑎1 〉
Solution:
∇𝑤 = 〈2𝑥 2𝑦〉
𝑥- + 𝑦- = 𝐶
which is a cluster of concentric circles. And the gradient vectors are in the direction from origin
to the tangent point, which are perpendicular to the tangent line or we can say they are
𝑦 ∇𝑤
The gradient of the function 𝑓(𝑥, 𝑦) = 4 − (cos - 𝑥 + cos - 𝑦 )- depicted as a vector field on the
∇𝑓 = 𝑓! 𝚤̂ + 𝑓" 𝚥̂
= −2(cos - 𝑥 + cos - 𝑦)(2 cos 𝑥)(− sin 𝑥)𝚤̂ − 2(cos - 𝑥 + cos - 𝑦)(2 cos 𝑦)(− sin 𝑦)𝚥̂
Apparently, this function has a global minimum at (0,0). At point (0,0), the gradient is
∇𝑓|(.,.) = 0
Matlab Code:
x = -2:0.2:2; y = x;
[X,Y] = meshgrid(x,y);
f = 4 - (cos(X).^2+cos(Y).^2).^2
mesh(X,Y,f);
hold on
hidden off;
%hidden off;
[Dx,Dy] = gradient(f);
Given a function of three variables, 𝑤 = 𝑓(𝑥, 𝑦, 𝑧). If 𝑟⃑(𝑡) = 𝑥(𝑡)𝚤̂ + 𝑦(𝑡)𝚥̂ + 𝑧(𝑡)𝑘3 is a
smooth curve on the level surface 𝑓(𝑥, 𝑦, 𝑧) = 𝐶, then 𝑓O𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)P = 𝐶. Differentiating
both sides with respect to 𝑡 and with chain rule, we have
𝑑 𝑑
𝑓O𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)P = (𝐶)
𝑑𝑡 𝑑𝑡
𝑑𝑥 𝑑𝑦 𝑑𝑧
𝑓! + 𝑓" + 𝑓# =0
𝑑𝑡 𝑑𝑡 𝑑𝑡
𝑑𝑟⃑ 𝑑𝑟⃑
∇𝑓 ⋅ = 0 ⟹ ∇𝑓 ⊥ c = 𝑣⃑e
𝑑𝑡 𝑑𝑡
Comments:
• At every point along the curve, ∇𝑓 is perpendicular to the curve’s velocity vector. The
• Now let’s focus on a point 𝑃. (𝑥. , 𝑦. , 𝑧. ) on the surface and curves passing through 𝑃. .
For all curves on the surface through 𝑃. , the velocity vectors at 𝑃. are orthogonal to ∇𝑓 at
𝑃. .
• Hence the curves’ tangent lines all lie in the plane through 𝑃. and normal to ∇𝑓. We call
The tangent plane at the point 𝑃(𝑥. , 𝑦. , 𝑧. ) on the level surface 𝑓O𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)P = 𝐶 is the
The normal line of the surface at 𝑃(𝑥. , 𝑦. , 𝑧. ) is the line through 𝑃. parallel to vector ∇𝑓|2! . The
𝑥 = 𝑥. + 𝑓! (𝑃. )𝑡
f𝑦 = 𝑦. + 𝑓" (𝑃. )𝑡
𝑧 = 𝑧. + 𝑓# (𝑃. )𝑡
Note, if ∇𝑓|2! = 0, then we are at local minimum or maximum. The tangent plane will be
𝑧 = 𝑧.
Solution:
Here 𝑓(𝑥, 𝑦, 𝑧) = 𝑥 - + 𝑦 - − 𝑧 - . Then the gradient vector for this surface at (2,1,1) is
= 〈4, 2, −2〉
4𝑥 + 2𝑦 − 2𝑧 = 8
𝑥 = 2 + 4𝑡
k𝑦 = 1 + 2𝑡
𝑧 = 1 − 2𝑡
We can also use gradient of a function 𝑓(𝑥, 𝑦) to obtain the its linearization or approximation of
𝑓(𝑥, 𝑦) at point 𝑃. (𝑥. , 𝑦. ). Suppose that from a level surface 𝑓(𝑥, 𝑦, 𝑧) = 𝐶, we can explicitly
express 𝑧 as function 𝑓(𝑥, 𝑦). In another word, the level surface is rewritten as 𝑧 − 𝑓(𝑥, 𝑦) = 0.
Define 𝑤 = 𝑧 − 𝑓(𝑥, 𝑦). For this level surface, the gradient vector is
𝜕𝑤 𝜕𝑤 𝜕𝑤 𝜕𝑓 𝜕𝑓
∇𝑤 = 𝚤̂ + 𝚥̂ + 𝑘3 = − 𝚤̂ − 𝚥̂ + 𝑘3
𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦
At 𝑃. ,
𝜕𝑓 𝜕𝑓
∇𝑤|2! = − l 𝚤̂ − l 𝚥̂ + 𝑘3 = −𝑓! (𝑃. )𝚤̂ − 𝑓" (𝑃. )𝚥̂ + 𝑘3
𝜕𝑥 2! 𝜕𝑦 2
!
which is an approximation of the surface 𝑧 = 𝑓(𝑥, 𝑦) at 𝑃. . We can also say the above equation
Lecture 13.
Given a differentiable function, 𝑧 = 𝑓(𝑥, 𝑦). The level curve are then 𝑓(𝑥, 𝑦) = 𝐶.
𝑦 ∇𝑤
𝑟⃑(𝑡)
vector 𝑟⃑(𝑡) = 𝑥(𝑡)𝚤̂ + 𝑦(𝑡)𝚥̂, then 𝑓(𝑥(𝑡), 𝑦(𝑡)) = 𝐶. Using chain rule, we have
𝑑 𝑑
𝑓O𝑥(𝑡), 𝑦(𝑡)P = (𝐶)
𝑑𝑡 𝑑𝑡
𝑑𝑥 𝑑𝑦
𝑓! + 𝑓" =0
𝑑𝑡 𝑑𝑡
𝑑𝑥 𝑑𝑦
O𝑓! 𝚤̂ + 𝑓" 𝚥̂P ⋅ m 𝚤̂ + 𝚥̂n
𝑑𝑡 𝑑𝑡
𝑑𝑟⃑ 𝑑𝑟⃑
∇𝑓 ⋅ = 0 ⟹ ∇𝑓 ⊥ c = 𝑣⃑e
𝑑𝑡 𝑑𝑡
At every point (𝑥. , 𝑦. ) in the domain of the differentiable function 𝑓(𝑥, 𝑦), the gradient of
At the point 𝑃. (𝑥. , 𝑦. ) on the curve, the gradient vector is ∇𝑓 = 𝑓! (𝑥. , 𝑦. )𝚤̂ + 𝑓" (𝑥. , 𝑦. )𝚥̂.
o⃑ = 𝑃
If 𝑃(𝑥, 𝑦) is another point on the tangent line, then we can define 𝑇 ooooooo⃑
. 𝑃 = (𝑥 − 𝑥. )𝚤̂ +
o⃑ = 0
∇𝑓 ⋅ 𝑇
$!
Example 8: Given a level curve %
+ 𝑦 ! = 2. Find the tangent line at point
(−2,1)
𝑥-
𝑓(𝑥, 𝑦) = + 𝑦-
4
𝑥
∇𝑓|(0-,,) = @ 𝚤̂ + 2𝑦𝚥̂Bp = −𝚤̂ + 2𝚥̂
2 (0-,,)
(−1)(𝑥 + 2) + 2(𝑦 − 1) = 0
𝑥 − 2𝑦 = −4