What is the Difference between Directional Derivative and Gradient?
Introduction
A directional derivative is a rate of change of a function in a specific direction whereas the gradient calculates the greatest rate of change. In this article, we will discuss more about the difference between directional derivatives and the gradient with their properties.
What is Gradient (Grad)?
The gradient of a function f(x,y) in two dimensions, is defined as
$$ grad\;f(x,y)\;=\;∇f(x,y)\;=\;\frac{df}{dx}i\;+\;\frac{df}{dy}j$$
That is obtained by applying the vector operator to a scalar function f(x,y). Where,
$$∇\;=\;\frac{d}{dx}i\;+\;\frac{d}{dy}j$$
The gradient of a scalar function is a vector quantity that gives the direction of greatest rate of change in that function.
What is Directional Derivative?
Let f(x,y) be a function at a point (xo,yo), in the direction of a vector v = (a,b) then the direction derivative of this function is defined by the partial derivative of f(x,y) at point (xo,yo) such that
$$D_vf(x_o,y_o)\;=\;f_x(x_o,y_o)a\;+\;f_y(x_o,y_o)b$$
The directional derivative is denoted by Dvf(xo,yo).
Here a and b are the components of unit vector v in the direction of rate of change.
What is the difference between the gradient and the directional derivative?
The directional derivative and the gradient are much similar terms. But there are some major differences between them. Let’s discuss the difference between them in the following difference table.
Directional Derivative |
Gradient |
It indicates the rate of change of a function in a specific direction. |
It indicates the direction of greatest rate of change of a function. |
It is a scalar quantity. |
It is a vector quantity. |
It is the dot product of the partial derivative of the function and the unit vector. |
It is the product of the vector operator and the scalar function. |
Directional derivatives can calculate the rate of change in any direction of an arbitrary unit vector. |
Gradient calculates only the greatest rate of change. |
Properties of Gradient of a Function
The gradient grad f(x,y) = ∇f(x,y) = df / dx i + df / dy j has following properties
- The gradient vector at any point x represents a direction of maximum increase in the function.
- The rate of maximum increase is equal to the magnitude of ∇f i.e.
∇f = |∇f|
- The directional derivative of a function is the dot product of its gradient vector and the unit vector in a specific direction.
- The gradient takes a scalar function f(x, y) and produces a vector ∇f.
- The vector ∇f(x,y) lies in the plane.
Properties of Directional Derivative
The directional derivative $$D_vf(x_o,y_o)\;=\;f_x(x_o,y_o)a\;+\;f_y(x_o,y_o)b$$ has following properties
- It can calculate the rate of change in a function in the direction of any vector.
- Directional derivative exists for every unit vector v i.e. all directional derivatives exist at the origin.
- It is the dot product between the partial derivatives of the function and the unit vector in the direction of change.
Important Equations of the Directional Derivative and the Gradient
- The directional derivative in two dimensions,
$$D_vf(x_o,y_o)\;=\;f_x(xo,yo)a\;+\;f_y(x_o,y_o)b$$
- The gradient in two dimensions,
$$∇f(x,y)\;=\;\frac{df}{dx}i\;+\;\frac{df}{dy}j$$
- The directional derivative in three dimensions,
$$D_vf(x_o,y_o,z_o)\;=\;f_x(x_o,y_o,z_o)a\;+\;f_y(x_o,y_o,z_o)b\;+\;f_z(x_o,y_o,z_o)c$$
- The gradient in three dimensions,
$$∇f(x,y,y)\;=\;\frac{df}{dx}i\;+\;\frac{df}{dy}j\;+\;\frac{df}{dz}k$$
How to calculate gradient and directional derivative of a function?
To calculate directional derivative and gradient of a function, the concept of derivative and partial derivative is important.
Here is an example to discuss how to find the gradient of a function.
Example
Let f(x,y) = x2y,.
(a) Find ∇f(3,2).
(b) Find the derivative of function (f) in the direction of (1,2) at the point (3,2).
Solution
(a) The gradient is just a partial derivative of f(x,y) = x2y at (3,2).
$$\frac{df}{dx}\;=\;2xy$$
$$\frac{df}{dy}\;=\;x^2$$
So,
$$∇f(x,y)\;=\;2xyi\;+\;x^2j$$
At 3,2,
$$∇f(3,2)\;=\;2xyi\;+\;3^2j\;=\;12i\;+\;9j$$
(b)Let v=v1i+v2j = 1i + 2j
$$|v|\;=\;\sqrt{1^2\;+\;2^2}\;=\;\sqrt{5}$$
So the unit vector is
$$v\;=\;\frac{v}{|v|}\;=\;\frac{1i+2j}{\sqrt 5}\;=\;\frac{1}{\sqrt 5}i\;+\;\frac{2}{\sqrt 5}j$$
The derivative of f in the direction of (1,2) at the point 3,2 is
$$D_vf(3,2)\;=\;f_x(3,2)v_1\;+\;f_y(3,2)v_2$$
$$D_vf(3,2)\;=\;\frac{12}{\sqrt 5}\;+\;\frac{18}{\sqrt 5}\;=\;\frac{12\;+\;18}{\sqrt 5}\;=\;\frac{30}{\sqrt 5}$$
FAQ’s
What does it mean when the directional derivative is 0?
The directional derivative is a scalar number that measures the rate of change in a particular direction. If directional derivative results in zero, it means that there is no change in the function in that specific direction. So, the zero directional derivative indicates that the function neither increases or decreases.
Is directional derivative always positive?
No, the directional derivative is not always positive. It can be either negative or positive. The negative directional derivative means the function is decreasing along that direction and the positive sign indicates that the function is increasing along the opposite direction of that vector.
How is gradient related to derivative?
The gradient is a vector that calculates the greatest rate of change in the function at a point. And the directional derivative is the dot product of gradient and the unit vector in a particular direction such that,
$$D_vf(x,y)\;=\;∇f.v$$