From Partial Derivatives to a Directional Rate
A directional derivative combines familiar ingredients into one calculation: partial derivatives, a gradient evaluated at a point, and a unit vector specifying a direction. The main challenge is keeping these steps in the right order. In particular, a direction vector must have length one when it is used to calculate the rate of change per unit distance.
This workshop develops a consistent procedure and applies it to functions of two and three variables. Each answer will also be checked by differentiating the function along a parametrized line in the chosen direction.
Definition and Calculation Rule
Let \(f\) be differentiable at a point \(\mathbf{a}\) in two- or three-dimensional space. A direction is represented by a nonzero vector \(\mathbf{v}\). Its associated unit vector is \(\mathbf{u}=\mathbf{v}/\|\mathbf{v}\|\). The directional derivative is the rate of change of \(f\) at \(\mathbf{a}\) in the direction of \(\mathbf{u}\).
For \(f(x,y)\), the gradient is \(\nabla f=(f_x,f_y)\). For \(f(x,y,z)\), it is \(\nabla f=(f_x,f_y,f_z)\). The partial derivatives are first found as functions, then evaluated at the specified point. The dot product with the unit direction gives a single number: the instantaneous rate of change in that direction.
The formula using the gradient requires differentiability at the point. Without that assumption, partial derivatives alone need not determine a directional derivative, and a directional derivative need not be given by a gradient dot product. Here the worked problems use functions differentiable at the specified points.
Why the Gradient Formula Works
The formula follows from the meaning of differentiability. At a differentiability point \(\mathbf{a}\), the change in \(f\) for a small displacement \(\mathbf{h}\) is its linear approximation \(\nabla f(\mathbf{a})\cdot\mathbf{h}\), plus an error that becomes negligible compared with \(\|\mathbf{h}\|\). In the direction \(\mathbf{u}\), set \(\mathbf{h}=t\mathbf{u}\). Since \(\|\mathbf{u}\|=1\), the error divided by \(t\) tends to zero as \(t\to0\).
Subtract \(f(\mathbf{a})\), divide by \(t\), and take the limit. The linear term becomes \(\nabla f(\mathbf{a})\cdot\mathbf{u}\), while the error term tends to zero. This proves the directional-derivative formula. Normalization matters because a unit vector describes displacement per unit distance; a vector of another length also changes the speed at which the line is traversed.
A Reliable Calculation Sequence
Compute every required first partial derivative of \(f\).
Substitute the given point into the partial derivatives.
Divide the given nonzero direction vector by its length.
Multiply corresponding components and add them.
Parametrize a line with the unit direction and differentiate the resulting one-variable function at zero.
Worked Examples
Worked Example: A Polynomial in Two Variables
Find the directional derivative of \(f(x,y)=x^2y+3y^2\) at \((1,-1)\) in the direction of \(\mathbf{v}=(3,4)\). First compute the partial derivatives:
Evaluate them at the point:
Thus \(\nabla f(1,-1)=(-2,-5)\). The direction vector has length \(\sqrt{3^2+4^2}=5\), so its unit vector is \(\mathbf{u}=(3/5,4/5)\). The directional derivative is
To check, follow the line \((x(t),y(t))=(1+3t/5,-1+4t/5)\). Differentiating \(f(x(t),y(t))\) at \(t=0\) gives \(2x(0)x'(0)y(0)+x(0)^2y'(0)+6y(0)y'(0)\). Substitution gives \(2(1)(3/5)(-1)+1(4/5)+6(-1)(4/5)=(-6+4-24)/5=-26/5\), as required.
Worked Example: A Logarithm in Two Variables
Let \(f(x,y)=\ln(x^2+y^2)\). Find the rate at \((1,2)\) in the direction \(\mathbf{v}=(-1,2)\). The function is defined and differentiable wherever \(x^2+y^2>0\), which includes the given point. Its partial derivatives are
At \((1,2)\), the denominator is \(1^2+2^2=5\), so \(\nabla f(1,2)=(2/5,4/5)\). The direction has length \(\sqrt{(-1)^2+2^2}=\sqrt5\), giving \(\mathbf{u}=(-1/\sqrt5,2/\sqrt5)\). Therefore
For a check, use \(x(t)=1-t/\sqrt5\) and \(y(t)=2+2t/\sqrt5\). The derivative of \(\ln(x(t)^2+y(t)^2)\) at zero is \(\frac{2x(0)x'(0)+2y(0)y'(0)}{x(0)^2+y(0)^2}\). Its numerator is \(2(1)(-1/\sqrt5)+2(2)(2/\sqrt5)=6/\sqrt5\), and its denominator is \(5\). The result is again \(6/(5\sqrt5)\).
Worked Example: A Polynomial in Three Variables
Let \(f(x,y,z)=xyz+x^2-2yz\). Find the directional derivative at \((1,-1,2)\) in the direction \(\mathbf{v}=(2,-1,2)\). Differentiate with respect to each variable:
Evaluating at the point gives \(f_x=-2+2=0\), \(f_y=2-4=-2\), and \(f_z=-1+2=1\). Thus \(\nabla f(1,-1,2)=(0,-2,1)\). The direction vector has length \(\sqrt{2^2+(-1)^2+2^2}=3\), so \(\mathbf{u}=(2/3,-1/3,2/3)\). Hence
To verify, take \((x(t),y(t),z(t))=(1+2t/3,-1-t/3,2+2t/3)\). Differentiating \(xyz+x^2-2yz\) along this path at zero gives \(x'yz+xy'z+xyz'+2xx'-2(y'z+yz')\). At the point, the three terms from \(xyz\) sum to \((2/3)(-2)+(1)(-1/3)(2)+(1)(-1)(2/3)=-8/3\). The \(x^2\) term contributes \(2(1)(2/3)=4/3\), and the \(-2yz\) term contributes \(-2((-1/3)(2)+(-1)(2/3))=8/3\). The total is \(-8/3+4/3+8/3=4/3\).
A Common Error: Skipping Normalization
Suppose \(f(x,y)=x^2+y^2\), the point is \((1,0)\), and the direction is represented by \((3,4)\). A tempting but incorrect calculation is to use the vector as given:
The value \(6\) is not the directional rate per unit distance in that direction. The vector \((3,4)\) has length \(5\); the corresponding unit vector is \((3/5,4/5)\). The correct calculation is
The difference is not a matter of notation: using the unnormalized vector means moving five times as fast along the same line as when using its unit vector. Indeed, along \((1,0)+t(3,4)\), the derivative at zero is \(6\); along the unit-speed path \((1,0)+t(3/5,4/5)\), it is \(6/5\). The latter is the directional derivative under the unit-vector convention.
Keeping the Steps Distinct
Many calculation errors can be avoided by recording the gradient, the point, and the direction separately before taking the dot product. In three variables, check that all three partial derivatives are included. When a direction is given as a nonzero vector, calculate its length explicitly; do not assume it is already a unit vector. If the given direction is already a unit vector, its length is one and normalization leaves it unchanged.
A final line check is especially useful when the arithmetic is complicated. Build the path as \(\mathbf{a}+t\mathbf{u}\), substitute its coordinates into \(f\), and differentiate with respect to \(t\) at zero. The path must use the unit vector if the goal is to check the directional derivative per unit distance.
Check Your Understanding
For each question, keep partial differentiation, point evaluation, and direction normalization as separate steps.
- For \(f(x,y)=xy+y^2\), find the directional derivative at \((2,1)\) in the direction \((1,1)\).
- What is the unit vector in the direction \((-2,1,2)\)?
- For \(f(x,y,z)=x^2+y^2+z^2\), find the directional derivative at \((1,0,-1)\) in the direction \((0,3,4)\).
- For a differentiable function, why must a direction vector be normalized when computing the rate per unit distance?
- Describe the parametrized-line check for a directional derivative at \(\mathbf{a}\) in unit direction \(\mathbf{u}\).