Directional Derivative — Definition, Formula & Examples
The directional derivative measures the rate at which a function changes as you move from a point in a specific direction. It generalizes partial derivatives, which only measure change along the coordinate axes.
Given a differentiable function , the directional derivative of at a point in the direction of a unit vector is defined as . When is differentiable, this equals .
Key Formula
Where:
- = Directional derivative of f in the direction of u
- = Gradient vector of f (vector of all partial derivatives)
- = Unit vector specifying the direction
- = Partial derivatives of f with respect to x and y
- = Components of the unit vector u
How It Works
To compute a directional derivative, you first find the gradient at the point of interest. Then you ensure the direction vector is a unit vector (divide by its magnitude if needed). Finally, take the dot product of the gradient with the unit vector. The result is a scalar telling you how fast increases in that direction. A positive value means is increasing; negative means decreasing. The maximum directional derivative occurs in the direction of the gradient itself.
Worked Example
Problem: Find the directional derivative of at the point in the direction of the vector .
Find the gradient: Compute the partial derivatives and form the gradient vector.
Normalize the direction vector: Divide the given vector by its magnitude to get a unit vector.
Compute the dot product: Take the dot product of the gradient with the unit vector.
Answer: The directional derivative is . The function increases at a rate of 7.2 units per unit distance in the direction of .
Why It Matters
Directional derivatives appear whenever you need the rate of change along a path that is not aligned with the coordinate axes. In physics, they describe how temperature or pressure changes along an arbitrary direction in a field. In machine learning, they underpin gradient descent, where you choose the direction of steepest descent to minimize a loss function.
Common Mistakes
Mistake: Using a direction vector that is not a unit vector in the dot product formula.
Correction: Always normalize the direction vector first by dividing it by its magnitude. If you skip this step, you scale the derivative by the length of the vector and get an incorrect rate of change.
