Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Gradient and Directional Derivative

The gradient of a function represents the rate of change of a function, it is defined as

∇f(x,y)=⟨fx, fy⟩=∂f∂xi⃗+∂f∂yj⃗\displaystyle \nabla f(x,y)=\left\langle f_x,\ f_y\right\rangle=\frac{\partial f}{\partial x}\vec{i}+\frac{\partial f}{\partial y}\vec{j}

and

∇f(x,y,z)=⟨fx, fy, fz⟩=∂f∂xi⃗+∂f∂yj⃗+∂f∂zk⃗\displaystyle\nabla f(x,y,z)=\left\langle f_x,\ f_y,\ f_z\right\rangle=\frac{\partial f}{\partial x}\vec{i}+\frac{\partial f}{\partial y}\vec{j}+\frac{\partial f}{\partial z}\vec{k}

  • It is a vector!
  • The gradient vector points in the direction of maximum increase, and the magnitude of this vector represents the maximum rate of change.

Example

Find the gradient of the function f(x,y)=sin⁡x+e2x2yf\left(x,y\right)=\sin x+e^{2x^2y} at the point (x,y)=(0, 1)\left(x,y\right)=\left(0,\ 1\right).

∇f=⟨fx, fy⟩=⟨cos⁡x+e2x2y(4xy), e2x2y(2x2)⟩\nabla f=\left\langle f_x,\ f_y\right\rangle=\left\langle\cos x+e^{2x^2y}\left(4xy\right),\ e^{2x^2y}\left(2x^2\right)\right\rangle

∇f(0,1)=⟨0, 0⟩\nabla f\left(0,1\right)=\left\langle0,\ 0\right\rangle



The directional derivative tells us the rate of change of a function z=f(x,y)z=f\left(x,y\right) in the direction of a unit vector u⃗=⟨a, b⟩\vec{u}=\left\langle a,\ b\right\rangle, and is defined by

Du⃗ f=fx a+fy b\displaystyle D_{\vec{u}}\ f=f_x\ a+f_y\ b

or

Du⃗ f=∇f⋅u⃗D_{\vec{u}}\ f=\nabla f\cdot\vec{u}

  • It is a scalar!
  • It is the projection of the gradient vector along the unit vector u⃗\vec{u}
  • Its maximum value is when the unit vector u⃗\vec{u} is in the direction of the gradient vector, and is equal to ∣∇f∣\left|\nabla f\right|

Example

Suppose that f(x,y)=x2−2xy+3y2f\left(x,y\right)=x^2-2xy+3y^2 and u⃗\vec{u} is the unit vector with an angle of θ=π4\theta=\frac{\pi}{4} with the positive x-axis.

a.) Find Du⃗ f(0, 1)D_{\vec{u}\ }f\left(0,\ 1\right).

b.) In what direction does ff have the max rate of change at this point? What is the max rate of change?

a.) Since θ=π4\theta=\frac{\pi}{4}, we know that u⃗=⟨cos⁡π4, sin⁡π4⟩=⟨12,12⟩\vec{u}=\left\langle\cos\frac{\pi}{4},\ \sin\frac{\pi}{4}\right\rangle=\langle\frac{1}{\sqrt 2},\frac{1}{\sqrt 2}\rangle

Method 1

Du⃗ f=(2x−2y)(12)+(−2x+6y)(12)D_{\vec{u}}\ f=\left(2x-2y\right)\left(\frac{1}{\sqrt{2}}\right)+\left(-2x+6y\right)\left(\frac{1}{\sqrt{2}}\right)

Du⃗ f(0,1)=(0−2)(12)+(0+6)(12)=42 or 22D_{\vec{u}}\ f\left(0,1\right)=\left(0-2\right)\left(\frac{1}{\sqrt{2}}\right)+\left(0+6\right)\left(\frac{1}{\sqrt{2}}\right)=\frac{4}{\sqrt{2}}\ \text{or}\ 2\sqrt{2}

Method 2

∇f=⟨2x−2y,−2x+6y⟩\nabla f=\left\langle2x-2y,-2x+6y\right\rangle

Du⃗ f=⟨2x−2y, −2x+6y⟩⋅⟨12,12⟩=(2x−2y)(12)+(−2x+6y)(12)D_{\vec{u}}\ f=\left\langle2x-2y,\ -2x+6y\right\rangle\cdot\left\langle\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right\rangle=\left(2x-2y\right)\left(\frac{1}{\sqrt{2}}\right)+\left(-2x+6y\right)\left(\frac{1}{\sqrt{2 }}\right)

Du⃗ f(0,1)=(0−2)(12)+(0+6)(12)=42 or 22D_{\vec{u}}\ f\left(0,1\right)=\left(0-2\right)\left(\frac{1}{\sqrt{2}}\right)+\left(0+6\right)\left(\frac{1}{\sqrt{2}}\right)=\frac{4}{\sqrt{2}}\ \text{or}\ 2\sqrt{2}


b.) ff increases fastest (max rate of change) in the direction of the gradient vector at this point ∇f(0,1)=⟨−2, 6⟩\nabla f\left(0,1\right)=\left\langle-2,\ 6\right\rangle, and its maximum value is ∣⟨−2,6⟩∣=40\left|\left\langle-2,6\right\rangle\right|=\sqrt{40}

Practice: Gradient and directional derivative

For the function f(x,y)=x2y3+xy,f (x, y ) = x^2y^3 +\sqrt{xy},


a) Calculate directional derivative in the direction of the unit vector which makes angle π/3\pi/3 with the polar axis.

b) In which direction does the maximum directional derivative occur and what is this maximum value?

c) Answer a) and b) again at the point (1,1)(1,1)


Select the correct answer for c) only.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors