Directional Derivative Calculator
This Directional Derivative Calculator finds how fast a function changes as you move in a chosen direction, and shows the working line by line. The gradient is built first, and the direction is rescaled to length one, because otherwise a longer arrow would fake a faster change. The dot product of the two is the rate. Following the same pattern every time keeps the direction normalised before it is used.
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the gradient.
- Evaluate the gradient at the point.
- Turn the direction into a unit vector.
- Dot the gradient with the unit vector.
Formula: Directional Derivative Formula
This formula gives the rate of change of f in the direction of v. Dot the gradient with the unit vector in that direction.
Useful Tips to Remember
Always turn the direction into a unit vector first, or the answer will be scaled by the length of v. The directional derivative is largest in the direction of the gradient and equals the length of the gradient there. It is 0 in any direction at right angles to the gradient. Evaluate the gradient at the point before taking the dot product.
Required knowledge
- How to find the gradient, covered in the Gradient Calculator.
- How to make a vector length one, covered in the Unit Vector Calculator.
- How to take the dot product, covered in the Dot Product Calculator.
Where Is the Directional Derivative Used?
The directional derivative tells you how fast a quantity changes if you move in a particular direction, not just along the axes. Hikers and engineers use it for the slope of a hill along a chosen path. In meteorology it gives how quickly temperature or pressure changes in the direction the wind blows. Robots and drones use it to judge how a sensor reading will change as they move, and optimisation methods use it to test search directions.
- Slope of a hill along a chosen path
- Temperature and pressure change along the wind
- Predicting sensor readings as a robot moves
- Testing search directions in optimisation
- Rates of change on surfaces in physics
Directional Derivative Practice Problems
Example 1 finds the rate of change of \(x^{2} y\) at \((1, 2)\) in the direction \(\langle 3, 4 \rangle\), and Example 2 uses \(x^{2} + y^{2}\) in the direction \(\langle 1, 1 \rangle\). Find the gradient, make the direction a unit vector and compare. For two more free worked examples, check out the Directional Derivative Notes.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the gradient.
- Evaluate the gradient at the point.
- Turn the direction into a unit vector.
- Dot the gradient with the unit vector.
Formula
Formula: Directional Derivative Formula
This formula gives the rate of change of f in the direction of v. Dot the gradient with the unit vector in that direction.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the rate of change of \(f(x, y) = x^{2} y\) at \(P = \left(1,\; 2\right)\) in the direction \(\vec{v} = \left\langle 3,\; 4 \right\rangle\).
Step 2
Step 2 - Write the formula.
In this problem: The directional derivative is the gradient dotted with a unit vector in the chosen direction. The direction must have length 1, so v is divided by its length first.
Step 3
Step 3 - Find the gradient.
In this problem: The gradient collects the partial derivatives, covered in the Gradient Calculator, which gives \(\nabla f = \left\langle 2 x y,\; x^{2} \right\rangle\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find each partial derivative.
- Collect the partial derivatives into the gradient.
Formula
Formula: Gradient Formula
This formula collects the partial derivatives into one vector. Each component is the partial derivative with respect to one variable.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the gradient of \(f(x, y) = x^{2} y\).
Step 2
Step 2 - Write the formula.
In this problem: The gradient is the vector of partial derivatives. It points in the direction in which f increases fastest.
Step 3
Step 3 - Find each partial derivative.
In this problem: Each partial derivative is found with the other variables held constant, as in the Partial Derivatives Calculator.
Step 3a
Step 3a - Find the partial derivative with respect to x.
In this problem: Holding \(y\) constant, differentiating \(x^{2} y\) with respect to \(x\), covered in the Power Rule Calculator, gives \(\frac{\partial f}{\partial x} = 2 x y\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- If there is a number in front, move it out with the constant multiple rule.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2} y\). This is a constant multiple of a power of \(x\). The coefficient is \(y\), the power part is \(x^{2}\), and the exponent is \(n = 2\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Move the number in front out with the constant multiple rule.
In this problem: \(y\) is a constant coefficient, so it moves in front of the derivative and the power rule only works on \(x^{2}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant multiple rule formula.
- Apply the constant multiple rule.
Step 1
Step 1 - Set up the coefficient and the variable part.
In this problem: We are given \(x^{2} y\). The constant coefficient is \(y\), and the variable part is \(x^{2}\).
Step 2
Step 2 - Write the constant multiple rule formula.
In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.
Step 3
Step 3 - Apply the constant multiple rule.
In this problem: Move the constant coefficient \(y\) outside the derivative and leave \(x^{2}\) inside the derivative.
Final Answer
Step 4
Step 4 - Substitute the exponent into the formula.
In this problem: Here, \(n = 2\). Substitute this exponent into the power rule, then keep the coefficient \(y\) outside.
Step 5
Step 5 - Solve and simplify.
In this problem: Apply the power rule to \(x^{2}\) and multiply by the constant \(y\). This gives \(2 y{x}^{1}\).
Final Answer
Step 3b
Step 3b - Find the partial derivative with respect to y.
In this problem: Holding \(x\) constant, differentiating \(x^{2} y\) with respect to \(y\), covered in the Power Rule Calculator, gives \(\frac{\partial f}{\partial y} = x^{2}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- If there is a number in front, move it out with the constant multiple rule.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2} y\). This is a constant multiple of a power of \(x\). The coefficient is \(x^{2}\), the power part is \(y\), and the exponent is \(n = 1\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Move the number in front out with the constant multiple rule.
In this problem: \(x^{2}\) is a constant coefficient, so it moves in front of the derivative and the power rule only works on \(y\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant multiple rule formula.
- Apply the constant multiple rule.
Step 1
Step 1 - Set up the coefficient and the variable part.
In this problem: We are given \(x^{2} y^{1}\). The constant coefficient is \(x^{2}\), and the variable part is \(y^{1}\).
Step 2
Step 2 - Write the constant multiple rule formula.
In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.
Step 3
Step 3 - Apply the constant multiple rule.
In this problem: Move the constant coefficient \(x^{2}\) outside the derivative and leave \(y^{1}\) inside the derivative.
Final Answer
Step 4
Step 4 - Substitute the exponent into the formula.
In this problem: Here, \(n = 1\). Substitute this exponent into the power rule, then keep the coefficient \(x^{2}\) outside.
Step 5
Step 5 - Solve and simplify.
In this problem: Apply the power rule to \(y\) and multiply by the constant \(x^{2}\). This gives \(x^{2}\).
Final Answer
Step 4
Step 4 - Collect the partial derivatives into the gradient.
In this problem: Placing the partial derivatives in order gives \(\nabla f = \left\langle 2 x y,\; x^{2} \right\rangle\).
Final Answer
Step 4
Step 4 - Evaluate the gradient at the point.
In this problem: Putting \(x = 1\) and \(y = 2\) into each component gives \(\nabla f\left(1,\; 2\right) = \left\langle 4,\; 1 \right\rangle\).
Step 5
Step 5 - Turn the direction into a unit vector.
In this problem: The length of v is \(|\vec{v}| = \sqrt{3^{2} + 4^{2}} = 5\), and dividing each component by it gives the unit vector, covered in the Unit Vector Calculator, \(\vec{u} = \left\langle \frac{3}{5},\; \frac{4}{5} \right\rangle\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the vector into the formula.
- Work out the magnitude.
- Work out the unit vector.
Formula
Formula: Unit Vector Formula
This formula keeps the direction of a vector and makes its length exactly one. Find the magnitude, then divide every component by it.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the unit vector in the direction of \(\vec{A} = \left\langle 3,\; 4 \right\rangle\).
Step 2
Step 2 - Write the formula.
In this problem: A unit vector has length 1 and points the same way as the vector, so the vector is divided by its own magnitude.
Step 3
Step 3 - Substitute the vector into the formula.
In this problem: Replacing \(\vec{A}\) in \(\hat{A} = \frac{\vec{A}}{|\vec{A}|}\) gives \(\hat{A} = \frac{\left\langle 3,\; 4 \right\rangle}{|\left\langle 3,\; 4 \right\rangle|}\).
Step 4
Step 4 - Work out the magnitude.
In this problem: The magnitude is worked out from the components, covered in the Magnitude of a Vector Calculator. Squaring the components gives \(3^{2} = 9\) and \(4^{2} = 16\). Adding the squares gives \(9 + 16 = 25\). Taking the square root gives \(\sqrt{25} = 5\).
Step 5
Step 5 - Work out the unit vector.
In this problem: Putting the magnitude back in gives \(\hat{A} = \frac{\left\langle 3,\; 4 \right\rangle}{5}\). Dividing each component by \(5\) gives \(3 \div 5 = \frac{3}{5}\) and \(4 \div 5 = \frac{4}{5}\).
Final Answer
Step 6
Step 6 - Dot the gradient with the unit vector.
In this problem: Taking the dot product, covered in the Dot Product Calculator, multiplies matching components and adds them, which gives \(4 \times \frac{3}{5} + 1 \times \frac{4}{5} = \frac{16}{5}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the components into the formula.
- Work out the dot product.
Formula
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the dot product of \(\vec{A} = \left\langle 4,\; 1 \right\rangle\) and \(\vec{B} = \left\langle \frac{3}{5},\; \frac{4}{5} \right\rangle\).
Step 2
Step 2 - Write the formula.
In this problem: The dot product multiplies the matching components of the two vectors and adds the two products, giving a single number.
Step 3
Step 3 - Substitute the components into the formula.
In this problem: Replacing each component in \(\vec{A} \cdot \vec{B} = a_{1}b_{1} + a_{2}b_{2}\) gives \(\vec{A} \cdot \vec{B} = 4 \times \frac{3}{5} + 1 \times \frac{4}{5}\).
Step 4
Step 4 - Work out the dot product.
In this problem: Multiplying the matching components gives \(4 \times \frac{3}{5} = \frac{12}{5}\) and \(1 \times \frac{4}{5} = \frac{4}{5}\). Adding the two products gives \(\frac{12}{5} + \frac{4}{5} = \frac{16}{5}\).
Final Answer
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the gradient.
- Evaluate the gradient at the point.
- Turn the direction into a unit vector.
- Dot the gradient with the unit vector.
Formula
Formula: Directional Derivative Formula
This formula gives the rate of change of f in the direction of v. Dot the gradient with the unit vector in that direction.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the rate of change of \(f(x, y) = x^{2} + y^{2}\) at \(P = \left(1,\; 2\right)\) in the direction \(\vec{v} = \left\langle 1,\; 1 \right\rangle\).
Step 2
Step 2 - Write the formula.
In this problem: The directional derivative is the gradient dotted with a unit vector in the chosen direction. The direction must have length 1, so v is divided by its length first.
Step 3
Step 3 - Find the gradient.
In this problem: The gradient collects the partial derivatives, covered in the Gradient Calculator, which gives \(\nabla f = \left\langle 2 x,\; 2 y \right\rangle\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find each partial derivative.
- Collect the partial derivatives into the gradient.
Formula
Formula: Gradient Formula
This formula collects the partial derivatives into one vector. Each component is the partial derivative with respect to one variable.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the gradient of \(f(x, y) = x^{2} + y^{2}\).
Step 2
Step 2 - Write the formula.
In this problem: The gradient is the vector of partial derivatives. It points in the direction in which f increases fastest.
Step 3
Step 3 - Find each partial derivative.
In this problem: Each partial derivative is found with the other variables held constant, as in the Partial Derivatives Calculator.
Step 3a
Step 3a - Find the partial derivative with respect to x.
In this problem: Holding \(y\) constant, differentiating \(x^{2} + y^{2}\) with respect to \(x\), covered in the Sum Rule Calculator, gives \(\frac{\partial f}{\partial x} = 2 x\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the sum rule formula.
- Split the derivative across the addition signs.
- Differentiate each separated term as Step 4a, Step 4b, Step 4c, and so on.
- Combine the term derivatives and simplify.
Step 1
Step 1 - Set up the terms in the sum.
In this problem: We are given a sum. The separate terms are \(x^{2}\), \(y^{2}\).
Step 2
Step 2 - Write the sum rule formula.
In this problem: The sum rule says the derivative of a sum is the sum of the derivatives.
Step 3
Step 3 - Split the derivative across the addition signs.
In this problem: Apply the derivative to each separated term.
Step 4a
Step 4a - Differentiate the separated term \(x^{2}\).
In this problem: The separated term is \(x^{2}\). Use the power rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2}\). This is a power of \(x\), so the exponent is \(n = 2\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Substitute the given power into the formula.
In this problem: Here, \(n = 2\). Substitute this exponent into the power rule, but do not simplify yet.
Step 4
Step 4 - Solve and simplify.
In this problem: Now subtract 1 from the exponent. This gives \(2{x}^{1}\).
Final Answer
Step 4b
Step 4b - Differentiate the separated term \(y^{2}\).
In this problem: The separated term is \(y^{2}\). Use the constant rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule formula.
- Apply the constant rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(y^{2}\). This expression does not contain \(x\), so it is a constant.
Step 2
Step 2 - Write the constant rule formula.
In this problem: The constant rule says the derivative of any constant is \(0\).
Step 3
Step 3 - Apply the constant rule.
In this problem: Since \(y^{2}\) is constant, its derivative is \(0\).
Final Answer
Step 5
Step 5 - Combine and simplify.
In this problem: Combine the derivative from each separated term, then simplify the result.
Final Answer
Step 3b
Step 3b - Find the partial derivative with respect to y.
In this problem: Holding \(x\) constant, differentiating \(x^{2} + y^{2}\) with respect to \(y\), covered in the Sum Rule Calculator, gives \(\frac{\partial f}{\partial y} = 2 y\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the sum rule formula.
- Split the derivative across the addition signs.
- Differentiate each separated term as Step 4a, Step 4b, Step 4c, and so on.
- Combine the term derivatives and simplify.
Step 1
Step 1 - Set up the terms in the sum.
In this problem: We are given a sum. The separate terms are \(x^{2}\), \(y^{2}\).
Step 2
Step 2 - Write the sum rule formula.
In this problem: The sum rule says the derivative of a sum is the sum of the derivatives.
Step 3
Step 3 - Split the derivative across the addition signs.
In this problem: Apply the derivative to each separated term.
Step 4a
Step 4a - Differentiate the separated term \(x^{2}\).
In this problem: The separated term is \(x^{2}\). Use the constant rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule formula.
- Apply the constant rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2}\). This expression does not contain \(y\), so it is a constant.
Step 2
Step 2 - Write the constant rule formula.
In this problem: The constant rule says the derivative of any constant is \(0\).
Step 3
Step 3 - Apply the constant rule.
In this problem: Since \(x^{2}\) is constant, its derivative is \(0\).
Final Answer
Step 4b
Step 4b - Differentiate the separated term \(y^{2}\).
In this problem: The separated term is \(y^{2}\). Use the power rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(y^{2}\). This is a power of \(x\), so the exponent is \(n = 2\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Substitute the given power into the formula.
In this problem: Here, \(n = 2\). Substitute this exponent into the power rule, but do not simplify yet.
Step 4
Step 4 - Solve and simplify.
In this problem: Now subtract 1 from the exponent. This gives \(2{y}^{1}\).
Final Answer
Step 5
Step 5 - Combine and simplify.
In this problem: Combine the derivative from each separated term, then simplify the result.
Final Answer
Step 4
Step 4 - Collect the partial derivatives into the gradient.
In this problem: Placing the partial derivatives in order gives \(\nabla f = \left\langle 2 x,\; 2 y \right\rangle\).
Final Answer
Step 4
Step 4 - Evaluate the gradient at the point.
In this problem: Putting \(x = 1\) and \(y = 2\) into each component gives \(\nabla f\left(1,\; 2\right) = \left\langle 2,\; 4 \right\rangle\).
Step 5
Step 5 - Turn the direction into a unit vector.
In this problem: The length of v is \(|\vec{v}| = \sqrt{1^{2} + 1^{2}} = \sqrt{2}\), and dividing each component by it gives the unit vector, covered in the Unit Vector Calculator, \(\vec{u} = \left\langle \frac{\sqrt{2}}{2},\; \frac{\sqrt{2}}{2} \right\rangle\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the vector into the formula.
- Work out the magnitude.
- Work out the unit vector.
Formula
Formula: Unit Vector Formula
This formula keeps the direction of a vector and makes its length exactly one. Find the magnitude, then divide every component by it.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the unit vector in the direction of \(\vec{A} = \left\langle 1,\; 1 \right\rangle\).
Step 2
Step 2 - Write the formula.
In this problem: A unit vector has length 1 and points the same way as the vector, so the vector is divided by its own magnitude.
Step 3
Step 3 - Substitute the vector into the formula.
In this problem: Replacing \(\vec{A}\) in \(\hat{A} = \frac{\vec{A}}{|\vec{A}|}\) gives \(\hat{A} = \frac{\left\langle 1,\; 1 \right\rangle}{|\left\langle 1,\; 1 \right\rangle|}\).
Step 4
Step 4 - Work out the magnitude.
In this problem: The magnitude is worked out from the components, covered in the Magnitude of a Vector Calculator. Squaring the components gives \(1^{2} = 1\) and \(1^{2} = 1\). Adding the squares gives \(1 + 1 = 2\). Taking the square root gives \(\sqrt{2} \approx 1.41\).
Step 5
Step 5 - Work out the unit vector.
In this problem: Putting the magnitude back in gives \(\hat{A} = \frac{\left\langle 1,\; 1 \right\rangle}{\sqrt{2}}\). Dividing each component by \(\sqrt{2}\) gives \(1 \div \sqrt{2} = \frac{\sqrt{2}}{2}\) and \(1 \div \sqrt{2} = \frac{\sqrt{2}}{2}\).
Final Answer
Step 6
Step 6 - Dot the gradient with the unit vector.
In this problem: Taking the dot product multiplies matching components and adds them, which gives \(2 \times \frac{\sqrt{2}}{2} + 4 \times \frac{\sqrt{2}}{2} = 3 \sqrt{2} \approx 4.24\).
Final Answer
Notes and Practice Mode
Want to understand the method more deeply? The Directional Derivative Notes go through the same pattern with extra worked examples and fuller explanations of the ideas behind each step, so you can see why every step works and not just what to do. When you are ready to test yourself, Directional Derivative Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode for this calculator is available on the Pro plan.
Login and upgrade to Pro to unlock the full step solution.
Example Problems
Click one to load it into the box and solve it.