MULTIVARIABLE CALCULUS

Directional Derivative Calculator

Find the rate of change of a multivariable function at a point in any direction, with a normalized direction vector and clear working.

MULTIVARIABLE CALCULUS

Enter a function, point, and direction

Enter a scalar field
Evaluate at the pointCoordinates
Direction vector uEnter any nonzero vector; it will be normalized

Use powers, fractions, parentheses, and supported functions such as sin(x), exp(y), and sqrt(z). Coordinates and vector entries accept values like pi/3 and sqrt(2).

Direction is normalized automatically
Try an example
DIRECTIONAL DERIVATIVE

Solution

Your input: Find the rate of change of

f=x2+y2+z2f={x}^{2} + {y}^{2} + {z}^{2}
at
(1,  2,  2)\left(1,\; 2,\; 2\right)
in the direction of
u=(1,  1,  0)\mathbf{u}=\left(1,\; 1,\; 0\right)
.

ANSWER
Duf(1,2,2)=4.2426407D_{\mathbf{u}}f(1,2,2)=4.2426407
Gradient at the point
∇f(1,2,2)=(2,  4,  4)\nabla f(1,2,2)=\left(2,\; 4,\; 4\right)
Unit direction and length
u^=(0.70710678,  0.70710678,  0),∥u∥=1.4142136\hat{\mathbf{u}}=\left(0.70710678,\; 0.70710678,\; 0\right),\qquad \lVert\mathbf{u}\rVert=1.4142136

Step-by-step solution

  1. 1
    Find the gradient of the function

    Differentiate f with respect to each coordinate, holding the other variables constant.

    fx=2⋅xf_x=2 \cdot x
    fy=2⋅yf_y=2 \cdot y
    fz=2⋅zf_z=2 \cdot z
  2. 2
    Evaluate the gradient at the chosen point

    Substitute the point coordinates into each partial derivative.

    ∇f(1,2,2)=(2,  4,  4)\nabla f(1,2,2)=\left(2,\; 4,\; 4\right)
  3. 3
    Normalize the direction vector

    Divide the entered vector by its Euclidean length, so the result measures change per unit distance.

    ∥u∥=(1)2+(1)2+(0)2=1.4142136,u^=(0.70710678,  0.70710678,  0)\lVert\mathbf{u}\rVert=\sqrt{(1)^2+(1)^2+(0)^2}=1.4142136,\qquad \hat{\mathbf{u}}=\left(0.70710678,\; 0.70710678,\; 0\right)
  4. 4
    Take the dot product

    The directional derivative is the gradient dotted with the unit direction.

    Duf=∇f⋅u^=(2,  4,  4)⋅(0.70710678,  0.70710678,  0)=4.2426407D_{\mathbf{u}}f=\nabla f\cdot\hat{\mathbf{u}}=\left(2,\; 4,\; 4\right)\cdot\left(0.70710678,\; 0.70710678,\; 0\right)=4.2426407

A positive value means the function increases in this direction; a negative value means it decreases. The value is the instantaneous rate per unit distance along the direction.

DIRECTIONAL CHANGE IN A SCALAR FIELD

What is a directional derivative?

A directional derivative measures the instantaneous rate at which a scalar-valued function changes as you move from a selected point in a specified direction. It extends the ordinary derivative to functions of several variables.

Duf(a)=∇f(a)⋅u∥u∥D_{\mathbf u}f(\mathbf a)=\nabla f(\mathbf a)\cdot\frac{\mathbf u}{\lVert\mathbf u\rVert}

First find the gradient, then evaluate it at the point. Normalize the direction vector and take the dot product. Normalization matters: a directional derivative is a rate per unit distance, independent of the length of the vector entered.

The function must be differentiable at the selected point, and the direction vector must be nonzero. This calculator supports real-valued expressions in x, y, and z using the project's supported elementary functions.

How to use the calculator

  1. Enter the scalar field f(x, y, z). For a two-variable function, leave the z terms out; the z partial derivative will be zero.
  2. Enter the coordinates of the point where you want to measure the rate. Coordinates may be numeric expressions such as pi/3 or sqrt(2).
  3. Enter any nonzero direction vector. The calculator divides it by its length to obtain a unit vector.
  4. Calculate to see the symbolic partial derivatives, gradient at the point, normalized direction, dot product, and final rate of change.

Worked example

Problem: Find the directional derivative of f(x, y, z) = xy + z² at a = (2, 3, 1), in the direction u = (2, 1, 2).

Working: ∇f = (y, x, 2z), so ∇f(2, 3, 1) = (3, 2, 2). The direction has length 3, so its unit vector is (2/3, 1/3, 2/3).

Result: Dᵤf(2, 3, 1) = (3, 2, 2) · (2/3, 1/3, 2/3) = 6/3 + 2/3 + 4/3 = 4.

At this point, the function increases at a rate of 4 units of function value per unit of distance in the direction (2, 1, 2).

Interpret the result

  • Positive value: The function increases locally when moving along the specified unit direction.
  • Negative value: The function decreases locally along the specified unit direction.
  • Zero value: There is no first-order change in that direction at the point; the function may still change at higher order.
  • A zero direction vector is invalid because it does not specify a direction and cannot be normalized.
  • If the function or a partial derivative is undefined at the selected point, the directional derivative is not returned as a finite value.
  • A directional derivative of zero does not, by itself, prove that the point is a maximum or minimum.

Common mistakes

  • Using the entered vector directly without dividing by its length. That computes a scaled dot product, not the rate per unit distance.
  • Confusing the gradient vector with the directional derivative, which is a scalar dot product.
  • Entering the point coordinates as the direction vector, or vice versa.
  • Assuming a zero directional derivative means the function is constant nearby.

Directional derivative FAQ

Does the direction vector need to have length 1?

No. Enter any nonzero vector in the desired direction. The calculator normalizes it before taking the dot product.

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

The gradient is a vector of partial derivatives. The directional derivative is a scalar rate of change in one chosen direction, calculated by dotting the gradient with a unit direction vector.

Can I calculate a directional derivative for f(x, y)?

Yes. Use the x and y coordinates and components. The z coordinate and direction component can remain zero; the z partial contributes zero for a function that does not contain z.

Why does the calculator reject the zero vector?

The zero vector has no direction and its length is zero, so the normalization formula would divide by zero.

What does a negative result mean?

The function decreases at that point when moving along the chosen direction. The magnitude gives the instantaneous rate per unit distance.

Further reading

Related calculus tools