Mathematics

Directional Derivative: Formula, Rules & Examples

A directional derivative measures how quickly a multivariable function changes when you move from a point in a specified direction. For a differentiable scalar function f, the directional derivative in the direction of a unit vector u is the dot product of the gradient with that direction. In two variables, the standard formula is Dᵤf = ∇f · u = fₓu₁ + fᵧu₂. A positive value means the function increases in that direction, a negative value means it decreases, and zero means there is no first-order change along that direction at the point. The direction vector normally must be normalized before applying the formula. The gradient points in the direction of greatest local increase, so directional derivatives also reveal how a chosen path compares with the steepest possible ascent. They extend the idea of an ordinary derivative from one input direction to infinitely many possible directions in several dimensions. Directional derivatives are therefore fundamental in multivariable calculus, optimization, geometry, physics, and any problem involving spatial rates of change.

What Is a Directional Derivative?

Suppose:

z = f(x, y)

An ordinary partial derivative tells us how f changes along one coordinate axis.

The derivative:

∂f/∂x

measures change in the x-direction, while:

∂f/∂y

measures change in the y-direction.

A directional derivative generalizes this idea to an arbitrary direction.

If:

u = (u₁, u₂)

is a unit vector, then:

Dᵤf = fₓu₁ + fᵧu₂

Equivalently:

Dᵤf = ∇f · u

The operation · is the dot product.

Directional Derivative Formula

For:

f(x, y)

and a unit direction vector:

u = (u₁, u₂)

the formula is:

Dᵤf(x, y) = ∇f(x, y) · u

where:

∇f = (∂f/∂x, ∂f/∂y)

Therefore:

Dᵤf = (∂f/∂x)u₁ + (∂f/∂y)u₂

In three variables:

f(x, y, z)

with:

u = (u₁, u₂, u₃)

the formula becomes:

Dᵤf = fₓu₁ + fᵧu₂ + f_z u₃

provided u has magnitude 1.

The Gradient and Directional Derivative

The gradient gathers the first partial derivatives of a scalar function into a vector.

For:

f(x, y)

the gradient is:

∇f = (fₓ, fᵧ)

The directional derivative is obtained by projecting this gradient onto the desired direction:

Dᵤf = ∇f · u

This gives an important geometric interpretation.

The gradient represents the direction of steepest local increase. The directional derivative tells us how much of that steepest increase occurs along the direction we actually choose.

How to Calculate a Directional Derivative

To calculate a directional derivative at a point:

  1. Find the partial derivatives.
  2. Form the gradient.
  3. Evaluate the gradient at the specified point.
  4. Normalize the direction vector if necessary.
  5. Take the dot product of the gradient and the unit direction vector.

The normalization step is essential when the supplied direction vector does not already have length 1.

Example: Direction Vector Already Normalized

Let:

f(x, y) = x² + 3xy

Find the directional derivative at:

(1, 2)

in the direction:

u = (3/5, 4/5)

First calculate the partial derivatives:

fₓ = 2x + 3y

fᵧ = 3x

At (1, 2):

fₓ(1, 2) = 2 + 6 = 8

fᵧ(1, 2) = 3

So:

∇f(1, 2) = (8, 3)

Now take the dot product:

Dᵤf = (8, 3) · (3/5, 4/5)

= 24/5 + 12/5

= 36/5

Therefore:

Dᵤf = 7.2

The function increases at a rate of 7.2 units of output per unit distance in that direction.

Normalizing a Direction Vector

Suppose the given direction is:

v = (3, 4)

Its magnitude is:

|v| = √(3² + 4²)

= √25

= 5

The corresponding unit vector is:

u = v/|v|

Therefore:

u = (3/5, 4/5)

Using v directly in the standard formula would scale the answer by the vector’s length and would not represent change per unit distance.

Full Example With Normalization

Let:

f(x, y) = x²y + 3y²

Find the directional derivative at:

(1, 2)

in the direction:

v = (3, 4)

First calculate the gradient.

For x:

fₓ = 2xy

For y:

fᵧ = x² + 6y

At (1, 2):

fₓ = 2(1)(2) = 4

fᵧ = 1² + 6(2)

= 1 + 12

= 13

Therefore:

∇f(1, 2) = (4, 13)

Normalize the direction:

|v| = 5

so:

u = (3/5, 4/5)

Now calculate:

Dᵤf = (4, 13) · (3/5, 4/5)

= 12/5 + 52/5

= 64/5

Therefore:

Dᵤf = 12.8

What Does a Positive Directional Derivative Mean?

If:

Dᵤf > 0

the function increases as we move in the direction u.

The larger the positive value, the more rapidly the function initially rises per unit distance in that direction.

For example:

Dᵤf = 6

means the local first-order rate of change is 6 output units per unit distance along u.

What Does a Negative Directional Derivative Mean?

If:

Dᵤf < 0

the function decreases in the specified direction.

For example:

Dᵤf = −4

means that moving one local unit in direction u produces an initial decrease of approximately four output units, interpreted through the local linear model.

Reversing the direction reverses the sign:

D₋ᵤf = −Dᵤf

What Does a Zero Directional Derivative Mean?

If:

Dᵤf = 0

there is no first-order change in the function along that direction at the point.

Since:

Dᵤf = ∇f · u

a zero value means the gradient and direction vector are perpendicular, assuming the gradient is nonzero.

The function may still curve upward or downward along that direction; the zero result describes only the first-order rate at the point.

Direction of Maximum Increase

For a unit vector u:

Dᵤf = ∇f · u

Using the angle θ between ∇f and u:

Dᵤf = |∇f| cos θ

The largest possible value occurs when:

cos θ = 1

which means:

θ = 0°

Therefore, maximum increase occurs in the direction:

u = ∇f/|∇f|

and the maximum directional derivative is:

D_max = |∇f|

This is one of the most important properties of the gradient.

Direction of Maximum Decrease

The strongest decrease occurs directly opposite the gradient.

That direction is:

u = −∇f/|∇f|

The corresponding directional derivative is:

D_min = −|∇f|

Thus the gradient not only identifies steepest ascent but also immediately determines steepest descent.

Example: Maximum Directional Derivative

Let:

f(x, y) = x² + y²

At:

(3, 4)

the gradient is:

∇f = (2x, 2y)

Therefore:

∇f(3, 4) = (6, 8)

Its magnitude is:

|∇f| = √(6² + 8²)

= √100

= 10

So the maximum directional derivative at (3, 4) is:

10

The direction of maximum increase is:

(6, 8)/10

= (3/5, 4/5)

The direction of maximum decrease is:

(−3/5, −4/5)

with directional derivative:

−10

Directional Derivative From the Limit Definition

The directional derivative can also be defined directly using a limit.

For a unit vector u:

Dᵤf(a) = lim [f(a + hu) − f(a)]/h as h → 0

This is the multivariable counterpart of the one-variable derivative definition.

The vector:

a + hu

moves from point a a small distance h in direction u.

The quotient measures the average rate along that line, while the limit gives the instantaneous directional rate.

The same limiting principles that support ordinary derivatives therefore extend naturally to several variables.

Directional Derivative Along Coordinate Axes

Partial derivatives are special cases of directional derivatives.

In two variables, let:

i = (1, 0)

Then:

Dᵢf = ∇f · (1, 0)

= fₓ

Similarly, with:

j = (0, 1)

we obtain:

Dⱼf = fᵧ

So the partial derivative measures directional change along a coordinate axis, while a directional derivative allows any chosen direction.

Directional Derivatives in Three Variables

Suppose:

f(x, y, z) = x² + yz

Then:

∇f = (2x, z, y)

At:

(1, 2, 3)

we have:

∇f(1, 2, 3) = (2, 3, 2)

Suppose the desired unit direction is:

u = (1/√3, 1/√3, 1/√3)

Then:

Dᵤf = (2, 3, 2) · (1/√3, 1/√3, 1/√3)

= 2/√3 + 3/√3 + 2/√3

= 7/√3

Rationalizing is unnecessary unless a particular output form is required.

Numerically:

7/√3 ≈ 4.04

Directional Derivative and Differentials

A directional derivative measures rate per unit distance, while differentials estimate the total change associated with a small displacement.

For:

f(x, y)

the total differential is:

df = fₓ dx + fᵧ dy

In vector form:

df = ∇f · dr

If a displacement has the form:

dr = u ds

where u is a unit direction vector and ds is a small distance, then:

df = ∇f · u ds

Therefore:

df = Dᵤf ds

This directly connects directional rate with approximate change.

Directional Derivative and Linear Approximation

For a small displacement:

Δr

a differentiable function satisfies approximately:

Δf ≈ ∇f · Δr

If:

Δr = u Δs

then:

Δf ≈ Dᵤf Δs

This is the multivariable version of local linear approximation.

The directional derivative supplies the slope, while Δs supplies the small distance traveled.

Example: Estimate a Small Change

Suppose at a point:

Dᵤf = 5

and we move approximately:

Δs = 0.02

units in direction u.

Then:

Δf ≈ Dᵤf Δs

≈ 5(0.02)

≈ 0.10

The output is expected to increase by approximately 0.10.

Directional Derivative and Level Curves

A level curve consists of points satisfying:

f(x, y) = c

for constant c.

At a regular point where the gradient is nonzero, ∇f is perpendicular to the level curve.

A tangent direction t along the level curve therefore satisfies:

∇f · t = 0

Hence:

Dₜf = 0

This makes geometric sense: moving tangentially along a level curve does not change the function value to first order.

Directional Derivative and Optimization

At an unconstrained differentiable local maximum or minimum inside the domain, the gradient is often:

∇f = 0

When this occurs:

Dᵤf = 0

for every unit direction u.

This makes directional derivatives closely related to multivariable optimization.

However, a zero gradient alone does not prove a maximum or minimum. The point may also be a saddle point or another stationary point.

Directional Derivative Versus Ordinary Derivative

An ordinary one-variable derivative has essentially one coordinate direction of motion, with positive and negative orientations along the same axis.

A directional derivative appears when the input has multiple dimensions.

For:

f(x)

the input lies on a line.

For:

f(x, y)

we can move away from a point in infinitely many directions in the plane.

The directional derivative answers how quickly f changes along one of those directions.

This is one reason multivariable calculus requires vector methods that are unnecessary in elementary one-variable differentiation.

Directional Derivative Versus Cross Product

The directional derivative uses a dot product:

Dᵤf = ∇f · u

because it measures the component of the gradient along a direction.

The cross product serves a different purpose: it produces a vector perpendicular to two three-dimensional vectors.

The dot product is therefore the natural operation for directional change, whereas the cross product is useful for normals, orientations, and areas.

Directional Derivatives and Differential Equations

A differential equation imposes relationships involving unknown functions and derivatives.

In equations involving several spatial variables, derivative information can depend on direction as well as position.

Directional derivatives are especially useful for interpreting how scalar fields vary along trajectories, flow directions, or specified spatial paths, although solving a differential equation is a broader task than evaluating a directional rate at a single point.

Directional Derivatives and Double Integrals

A double integral accumulates a quantity over a two-dimensional region, while a directional derivative measures local change at a point along a chosen direction.

The two operations answer different questions.

A directional derivative is local:

How fast is the function changing here in this direction?

A double integral is accumulative:

How much quantity is distributed over this entire region?

Both are central multivariable tools, but neither substitutes for the other.

Continuity and Directional Derivatives

The existence of directional derivatives in many or even all directions does not, by itself, guarantee full differentiability of a multivariable function.

This is a subtle difference from naive geometric intuition.

A function may have well-defined rates along every line through a point yet still fail to possess one consistent linear approximation there.

Full differentiability is stronger and implies continuity at the point.

This distinction becomes important in more advanced multivariable problems.

Chain Rule and Directional Change

Suppose a path is parameterized by:

r(t) = (x(t), y(t))

and define:

g(t) = f(x(t), y(t))

The multivariable chain rule gives:

dg/dt = fₓ dx/dt + fᵧ dy/dt

In vector form:

dg/dt = ∇f · r′(t)

If r′(t) is a unit vector at the point, this derivative is the directional derivative along the path’s instantaneous direction.

If the velocity is not unit length, the expression includes both directional change and the speed at which the path is being traversed.

Direction Vector Versus Unit Direction Vector

The phrase “in the direction of (a, b)” does not usually mean that (a, b) should be inserted directly into the standard directional derivative formula.

Instead, normalize it:

u = (a, b)/√(a² + b²)

Then compute:

Dᵤf = ∇f · u

Forgetting normalization is among the most frequent calculation errors.

Example: Direction From One Point Toward Another

Suppose we need the directional derivative of f at:

P = (1, 2)

in the direction from P toward:

Q = (4, 6)

First construct the direction vector:

v = Q − P

= (4 − 1, 6 − 2)

= (3, 4)

Its magnitude is:

|v| = 5

So:

u = (3/5, 4/5)

This unit vector can then be used in:

Dᵤf(P) = ∇f(P) · u

The important step is forming Q − P rather than using Q itself as the direction.

Bounds on a Directional Derivative

Because:

Dᵤf = |∇f| cos θ

and:

−1 ≤ cos θ ≤ 1

the directional derivative satisfies:

−|∇f| ≤ Dᵤf ≤ |∇f|

The largest possible directional rate is |∇f|, while the smallest is −|∇f|.

Any calculated value outside this interval signals an error if u is genuinely a unit vector.

This provides a useful numerical check.

Common Mistakes

The most common mistake is failing to normalize the direction vector. The standard formula expects a unit direction if the result is to mean change per unit distance.

Another error is evaluating the gradient at the wrong point. The partial derivatives should first be found symbolically and then evaluated at the specified coordinates.

Students may also reverse the direction. The direction from P to Q is:

Q − P

not:

P − Q

Reversing it negates the directional derivative.

Another mistake is confusing a directional derivative with the magnitude of the gradient. They are equal only when the chosen direction points along the gradient.

A zero directional derivative should not automatically be interpreted as a local maximum or minimum. It only means the first-order rate in that particular direction is zero.

Finally, the existence of directional derivatives along individual directions does not necessarily establish full differentiability in several variables.

Frequently Asked Questions

What is a directional derivative?

A directional derivative measures the instantaneous rate of change of a multivariable function at a point in a specified direction.

What is the directional derivative formula?

For a differentiable function f and unit vector u:

Dᵤf = ∇f · u

In two variables:

Dᵤf = fₓu₁ + fᵧu₂

Does the direction vector have to be a unit vector?

For the standard directional derivative interpreted as change per unit distance, yes. If the given vector is not a unit vector, normalize it first.

How do you normalize a vector?

For:

v = (a, b)

calculate:

|v| = √(a² + b²)

then:

u = v/|v|

What does a positive directional derivative mean?

It means the function increases locally as you move in the specified direction.

What does a negative directional derivative mean?

It means the function decreases locally in that direction.

What does a zero directional derivative mean?

It means there is no first-order change along that particular direction at the point.

What is the maximum directional derivative?

The maximum directional derivative is:

|∇f|

and it occurs in the direction of the gradient.

What is the direction of maximum decrease?

It is the direction opposite the gradient:

−∇f/|∇f|

Partial derivatives are directional derivatives along the coordinate axes.

What is the difference between a gradient and a directional derivative?

The gradient is a vector containing local partial-derivative information. A directional derivative is a scalar obtained by projecting the gradient onto a chosen unit direction.

Can all directional derivatives exist even if a function is not differentiable?

Yes. In multivariable calculus, directional derivatives can exist in every direction at a point while the function still fails to be fully differentiable there.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button