Source: MATH 163 Abridged Class Notes, University of Washington
Difficulty: Intermediate | Prerequisites: Partial derivatives (Sections 14.1 to 14.4), dot product of vectors
Partial derivatives tell you the rate of change along the coordinate axes, but most directions in space are not along an axis. Directional derivatives generalise the idea: they measure how fast a function changes as you move in any direction you choose. The gradient vector collects the partial derivatives into a single object that not only lets you compute directional derivatives via a dot product, but also points in the direction of steepest increase. This section bridges partial derivatives (14.3, 14.4) and the optimisation tools that follow in 14.7 and 14.8.
The directional derivative tells you the rate of change of f(x, y) in any direction, not just along x or y. You compute it by taking the dot product of the gradient vector (the vector of all partial derivatives) with a unit vector pointing in your chosen direction. The gradient itself always points in the direction where f increases fastest.
Directional derivative
The rate of change of a function f(x, y) at a point, measured in the direction of a unit vector u = (u_x, u_y). Formally: D_u f(x, y) = u_x · f_x + u_y · f_y. Think of it as asking "how steep is the surface if I walk in this particular direction?"
Unit vector
A vector with magnitude 1. To convert any direction vector v = (a, b) into a unit vector, divide by its magnitude: u = (a, b) / sqrt(a² + b²). The directional derivative formula requires a unit vector, so you must normalise first if you are given a non-unit direction.
Gradient vector (∇f, "del f", "nabla f")
The vector whose components are the partial derivatives of f: ∇f = (f_x, f_y). For functions of three variables, ∇f = (f_x, f_y, f_z). In simple terms, the gradient packages all the partial derivatives into one vector. It points in the direction of steepest ascent, and its magnitude equals the maximum rate of change at that point.
Dot product (as used here)
The directional derivative equals the dot product of the gradient with the unit direction vector: D_u f = ∇f · u. This is the key connection between the gradient and directional derivatives.
For f(x, y) and a unit vector u = (u_x, u_y):
D_u f(x, y) = u_x · f_x + u_y · f_y
This formula gives the instantaneous rate of change of f at a point as you move in the direction of u.
Find the partial derivatives f_x and f_y.
Evaluate them at the given point.
If the direction is given as a non-unit vector, normalise it by dividing by its magnitude.
Compute the dot product of the gradient at that point with the unit vector.
Worked example. f(x, y) = ye^(-x), direction (4, 3), point (1, 2).
f_x = -ye^(-x), f_y = e^(-x)
At (1, 2): f_x = -2e^(-1), f_y = e^(-1)
Unit vector: (4, 3)/sqrt(16 + 9) = (4/5, 3/5)
D_u f(1, 2) = (4/5)(-2e^(-1)) + (3/5)(e^(-1)) = (-8e^(-1) + 3e^(-1))/5 = -5e^(-1)/5 = -e^(-1) ≈ -0.368
The negative value means f is decreasing in this direction at that point.
The gradient packages the partial derivatives into a vector:
For f(x, y): ∇f = (f_x, f_y)
For f(x, y, z): ∇f = (f_x, f_y, f_z)
The directional derivative becomes:
D_u f = ∇f · u
This is a dot product, which means the directional derivative depends on the angle between the gradient and the direction you are walking.
f(x, y) = arctan(xy).
f_x = y / (1 + x²y²), f_y = x / (1 + x²y²)
∇f = ( y/(1 + x²y²), x/(1 + x²y²) )
At (1, 2): ∇f(1, 2) = (2/5, 1/5)
Directional derivative in direction (5, 10) at (1, 2):
Unit vector: (5, 10)/sqrt(125) = (1/√5, 2/√5)
D_u f = (2/5)(1/√5) + (1/5)(2/√5) = 2/(5√5) + 2/(5√5) = 4/(5√5) ≈ 0.358
D_{\vec{u}} f(x,y) = u_x \cdot f_x + u_y \cdot f_y\nabla f = \langle f_x, f_y \rangleD_{\vec{u}} f = \nabla f \cdot \vec{u}Unit vector from direction vector (a, b):
\vec{u} = \frac{1}{\sqrt{a^2 + b^2}} \langle a, b \rangleThe gradient tells you the direction of steepest ascent on a surface, which is why gradient descent (walking in the opposite direction of the gradient) is the central algorithm for training machine learning models. In physics and engineering, the gradient of a temperature field tells you which way heat flows, and the gradient of a pressure field tells you the direction of the strongest force on a fluid element.
Students often forget to normalise the direction vector. The directional derivative formula requires a unit vector. If you plug in (4, 3) instead of (4/5, 3/5), your answer will be wrong.
Some students think f_x is the directional derivative in the x-direction. It is, but only because the unit vector in the x-direction is (1, 0), and ∇f · (1, 0) = f_x. This is a special case, not the definition.
A common error is confusing the gradient (a vector) with the directional derivative (a scalar). The gradient is a vector; the directional derivative in a given direction is a number you get by dotting the gradient with a unit vector.
Students sometimes assume the gradient points toward the nearest maximum. It points in the direction of steepest local increase at that point, which is not necessarily toward a global or even local maximum.
⚠️ The standard exam question gives you f(x, y), a direction vector, and a point, then asks for the directional derivative. Make sure you normalise the direction vector first.
⚠️ You will be asked to find the gradient vector, both as a general expression and evaluated at a specific point.
⚠️ Know the relationship D_u f = ∇f · u cold. It connects everything in this section.
⚠️ Later sections build on the gradient for finding tangent planes to level curves and surfaces, so a solid understanding here saves time later.
True or false: you can compute a directional derivative using any direction vector, without normalising it first. False. The formula requires a unit vector.
Fill in the blank: the gradient vector ∇f = ______. (f_x, f_y), i.e. the vector of partial derivatives.
True or false: the directional derivative D_u f is a vector. False. It is a scalar (a single number).
Fill in the blank: D_u f = ∇f ______ u. · (dot product).
True or false: f_x equals the directional derivative in the direction of the unit vector (1, 0). True.
Q: Let f(x, y) = x²y + y³. Find the gradient vector at (2, 1).
A: f_x = 2xy, f_y = x² + 3y². At (2, 1): ∇f = (2·2·1, 4 + 3) = (4, 7).
Q: For the function above, find the directional derivative at (2, 1) in the direction (3, 4).
A: Unit vector: (3, 4)/5 = (3/5, 4/5). D_u f = (4)(3/5) + (7)(4/5) = 12/5 + 28/5 = 40/5 = 8.
Q: f(x, y) = ln(x² + y²). Find ∇f.
A: f_x = 2x/(x² + y²), f_y = 2y/(x² + y²). So ∇f = ( 2x/(x² + y²), 2y/(x² + y²) ).
Q: If ∇f(a, b) = (0, 0), what does that tell you about the directional derivative at (a, b)?
A: D_u f = ∇f · u = (0, 0) · u = 0 for every direction u. The function has zero rate of change in every direction at that point, which means (a, b) is a critical point.
Q: What is the maximum possible value of D_u f at a point where |∇f| = 5?
A: D_u f = ∇f · u = |∇f| cos(θ), which is maximised when θ = 0 (u points in the same direction as ∇f). The maximum directional derivative is |∇f| = 5, achieved in the gradient direction.
This section depends directly on partial derivatives (Sections 14.3, 14.4) and the generalized chain rule (Section 14.5). The gradient vector reappears immediately in Section 14.7 for finding tangent planes and normal lines to surfaces, and in Section 14.8 for locating maxima and minima using the properties of critical points (where ∇f = 0). The dot-product structure also connects to the work-energy theorem in physics, where the dot product of force and displacement gives work done.
Directional derivative, gradient vector, nabla, del operator, ∇f, steepest ascent, steepest descent, gradient descent, unit vector, normalising a direction vector, dot product directional derivative, rate of change in a direction, Calculus III, MATH 163, Section 14.6, partial derivatives as special directional derivatives, maximum rate of change