Ma · Mathematics

Are Directional Derivatives Scalars or Vectors?

Published By the 9to5Science editorial team

At a glance

  1. 1. Check the function

    For a scalar-valued function, the directional derivative is a scalar; for a vector-valued function, it is a vector.

  2. 2. Choose a direction

    The direction is an input vector. Use a unit vector when you want the rate of change per unit distance.

  3. 3. Apply the derivative

    For a scalar-valued function, take the gradient's dot product with the direction vector.

  4. 4. Interpret the result

    The output belongs to the function's codomain, not to the space of directions.

A directional derivative describes how a function changes as you move from a point in a specified direction. The direction is represented by a vector, which is why it is easy to confuse the input with the output. The type of the derivative depends on the type of the function: a scalar-valued function has a scalar directional derivative, while a vector-valued function generally has a vector directional derivative.

The standard scalar-valued case

Suppose f:Rn→Rf: \mathbb{R}^n \to \mathbb{R}, so each input is a vector but each function value is a real number. At a point a\mathbf{a}, the directional derivative in the direction of a vector u\mathbf{u} is defined, when the limit exists, by

Duf(a)=lim⁡h→0f(a+hu)−f(a)h.D_{\mathbf{u}}f(\mathbf{a}) = \lim_{h \to 0} \frac{f(\mathbf{a}+h\mathbf{u})-f(\mathbf{a})}{h}.

The numerator is a difference of real numbers, so the limit is a real number. Thus, the directional derivative is a scalar in this common setting. The vector u\mathbf{u} tells you which way to move; it is not the answer.

If ff is differentiable, its gradient gives a convenient formula:

Duf(a)=∇f(a)⋅u.D_{\mathbf{u}}f(\mathbf{a}) = \nabla f(\mathbf{a}) \cdot \mathbf{u}.

This is a dot product, and therefore produces a scalar. If u\mathbf{u} is a unit vector, that scalar is the instantaneous rate of change per unit distance in that direction. If the vector is not a unit vector, the formula still applies, but its magnitude scales the result.

A worked example

Let

f(x,y)=x2y+sin⁡yf(x,y)=x^2y+\sin y

and find the directional derivative at (1,0)(1,0) in the direction of (3,4)(3,4).

First, convert the direction into a unit vector:

u=(3,4)32+42=(35,45).\mathbf{u}=\frac{(3,4)}{\sqrt{3^2+4^2}}=\left(\frac35,\frac45\right).

Next, calculate the gradient:

∇f(x,y)=(2xy, x2+cos⁡y).\nabla f(x,y)=\left(2xy,\ x^2+\cos y\right).

At (1,0)(1,0), this is ∇f(1,0)=(0,2)\nabla f(1,0)=(0,2). Take its dot product with the unit direction:

Duf(1,0)=(0,2)⋅(35,45)=85.D_{\mathbf{u}}f(1,0)=(0,2)\cdot\left(\frac35,\frac45\right)=\frac85.

The answer 85\frac85 is a scalar. It says that, at the given point, the function increases at an instantaneous rate of 85\frac85 per unit distance when you move in the direction (3,4)(3,4).

If you instead use (3,4)(3,4) directly in the gradient formula, you get (0,2)⋅(3,4)=8(0,2)\cdot(3,4)=8. That is the directional derivative with respect to the parameter hh in the path (1,0)+h(3,4)(1,0)+h(3,4); it is not the rate per unit distance. Normalizing the direction divides that rate by the length 55.

What changes for a vector-valued function?

Now let F:Rn→RmF: \mathbb{R}^n \to \mathbb{R}^m. Its values are vectors in Rm\mathbb{R}^m, so the difference quotient

F(a+hu)−F(a)h\frac{F(\mathbf{a}+h\mathbf{u})-F(\mathbf{a})}{h}

is vector-valued. When its limit exists, the directional derivative is therefore a vector in Rm\mathbb{R}^m.

For example, take F(x,y)=(x2+y,xy)F(x,y)=(x^2+y,xy) and evaluate at (1,2)(1,2) in the direction (1,0)(1,0). Moving in that direction changes xx while keeping yy fixed. The derivative is

D(1,0)F(1,2)=(2x, y)∣(1,2)=(2,2).D_{(1,0)}F(1,2)=\left(2x,\ y\right)\bigg|_{(1,2)}=(2,2).

Here the result is a vector because FF itself returns a two-component vector. More generally, the derivative of FF at a point is a linear map, often represented by its Jacobian matrix; applying that map to the direction vector gives the directional derivative vector.

A useful way to keep the terms straight

For a differentiable function F:Rn→RmF: \mathbb{R}^n \to \mathbb{R}^m, the derivative at a\mathbf{a} is a linear map

DF(a):Rn→Rm.DF(\mathbf{a}):\mathbb{R}^n \to \mathbb{R}^m.

The direction u\mathbf{u} is an input to that map, and DF(a)[u]DF(\mathbf{a})[\mathbf{u}] is its output. For a scalar-valued function, m=1m=1, so that output is a scalar. For a vector-valued function, mm can be greater than one, so the output is a vector. In multivariable calculus, the term “directional derivative” often refers specifically to the scalar-valued case, but the same derivative-map idea applies to vector-valued functions too.

Common mistakes

  • Calling the direction the derivative: The direction is an input vector. The derivative is the resulting rate or change, whose type depends on the function’s codomain.
  • Assuming every directional derivative is a scalar: That is true for real-valued functions, but not for vector-valued ones.
  • Forgetting to normalize: If a question asks for change per unit distance, use a unit direction vector. If it gives a non-unit vector, check whether the intended derivative is with respect to that parameterized displacement or per unit distance.
  • Confusing the gradient with the directional derivative: For a scalar-valued function, the gradient is a vector, while its dot product with a direction gives the scalar directional derivative.

References

  1. Calculus, Volume 3 — OpenStax
  2. Calculus: Early Transcendentals — James Stewart

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.