Learning Objectives
- Determine the directional derivative in a given direction for a function of two variables.
We start with the graph of a surface defined by the equation z=f(x,y)z=f(x,y). Given a point (a,b)(a,b) in the domain of ff, we choose a direction to travel from that point. We measure the direction using an angle θθ which is measured counterclockwise in the x,yx,y-plane, starting at zero from the positive xx-axis (Figure 1). The distance we travel is hh and the direction we travel is given by the unit vector u=(cosθ)i+(sinθ)ju=(cosθ)i+(sinθ)j. Therefore, the zz-coordinate of the second point on the graph is given by z=f(a+hcosθ,b+hsinθ)z=f(a+hcosθ,b+hsinθ).

Figure 1. Finding the directional derivative at a point on the graph of z=f(x,y)z=f(x,y). The slope of the black arrow on the graph indicates the value of the directional derivative at that point.
We can calculate the slope of the secant line by dividing the difference in zz-values by the length of the line segment connecting the two points in the domain. The length of the line segment is hh. Therefore, the slope of the secant line is
msec=f(a+hcosθ,b+hsinθ)−f(a,b)hmsec=f(a+hcosθ,b+hsinθ)−f(a,b)h
To find the slope of the tangent line in the same direction, we take the limit as hh approaches zero.
Definition
Suppose z=f(x,y)z=f(x,y) is a function of two variables with a domain of DD. Let (a,b)∈D(a,b)∈D and define u=(cosθ)i+(sinθ)ju=(cosθ)i+(sinθ)j. Then the directional derivative of ff in the direction of uu is given by
Duf(a,b)=limh→0f(a+hcosθ,b+hsinθ)−f(a,b)h,Duf(a,b)=limh→0f(a+hcosθ,b+hsinθ)−f(a,b)h,
provided the limit exists.
The directional derivative of ff in the direction of uu provides a formal definition of the directional derivative that can be used in many cases to calculate a directional derivative.
Example: finding the Directional derivative from the definition
Let θ=arccos(3/5)θ=arccos(3/5). Find the directional derivative Duf(x,y)Duf(x,y) of f(x,y)=x2−xy+3y2f(x,y)=x2−xy+3y2 in the direction of u=(cosθ)i+(sinθ)ju=(cosθ)i+(sinθ)j. What is Duf(−1,2)Duf(−1,2)?
Another approach to calculating a directional derivative involves partial derivatives, as outlined in the following theorem.
Theorem: Directional derivative of a function of two variables
Let z=f(x,y)z=f(x,y) be a function of two variables xx and yy, and assume that fxfx and fyfy exist. Then the directional derivative of ff in the direction of u=cosθi+sinθju=cosθi+sinθj is given by
Duf(x,y)=fx(x,y)cosθ+fy(x,y)sinθ.Duf(x,y)=fx(x,y)cosθ+fy(x,y)sinθ.
Proof
The directional derivative of ff in the direction of uu states that the directional derivative of ff in the direction of u=cosθi+sinθju=cosθi+sinθj is given by
Duf(a,b)=limh→0f(a+hcosθ,b+hsinθ)−f(a,b)hDuf(a,b)=limh→0f(a+hcosθ,b+hsinθ)−f(a,b)h
Let x=a+tcosθx=a+tcosθ and y=b+tsinθy=b+tsinθ, and define g(t)=f(x,y)g(t)=f(x,y). Since fxfx and fyfy both exist, and therefore ff is differentiable, we can use the chain rule for functions of two variables to calculate g′(t):
g′(t)=∂f∂xdxdt+∂f∂ydydt=fx(x,y)cosθ+fy(x,y)sinθ.
If t=0, then x=x0(=a) and y=y0(=b), so
g′(0)=fx(x0,y0)cosθ+fy(x0,y0)sinθ
By the definition of g′(t), it is also true that
g′(0)=limt→0g(t)−g(0)t=limt→0f(x0+tcosθ,y0+tsinθ)−f(x0,y0)t.
Therefore, Duf(x0,y0)=fx(x,y)cosθ+fy(x,y)sinθ.
Example: Finding a directional derivative: Alternative Method
Let θ=arccos(3/5). Find the directional derivative Duf(x,y) of f(x,y)=x2−xy+3y2 in the direction of u=(cosθ)i+(sinθ)j. What is Duf(−1,2)?
Try it
Find the directional derivative Duf(x,y) of f(x,y)=3x2y−4xy3+3y2−4x in the direction of u=(cosπ3)i+(sinπ3)j using the Directional Derivative of a Function of Two Variables. What is Duf(3,4)?
Watch the following video to see the worked solution to the above Try It
If the vector that is given for the direction of the derivative is not a unit vector, then it is only necessary to divide by the norm of the vector. For example, if we wished to find the directional derivative of the function in Example: Finding a Directional Derivative: Alternative Method in the direction of the vector ⟨−5,12⟩ we would first divide by its magnitude to get u. This gives us u=⟨−(5/13),12/13⟩. Then
Duf(x,y)=∇f(x,y)⋅u=−513(2x−y)+1213(−x+6y)=−2213x+1713y.
Candela Citations
- CP 4.28. Authored by: Ryan Melton. License: CC BY: Attribution
- Calculus Volume 3. Authored by: Gilbert Strang, Edwin (Jed) Herman. Provided by: OpenStax. Located at: https://openstax.org/books/calculus-volume-3/pages/1-introduction. License: CC BY-NC-SA: Attribution-NonCommercial-ShareAlike. License Terms: Access for free at https://openstax.org/books/calculus-volume-3/pages/1-introduction