JustToThePoint English Website Version
JustToThePoint en español
Colaborate with us

Directional derivatives

It ain’t about how hard you can hit. Its about how hard you can get hit, and how much you can take, and keep moving forward, Rocky Balboa.

And yet despite the look on my face, you’re still talking and thinking that I care, Anonymous.

Recall

Definition. A vector $\vec{AB}$ is a geometric object or quantity that has both magnitude (or length) and direction. Vectors in an n-dimensional Euclidean space can be represented as coordinates vectors in a Cartesian coordinate system.

Definition. The magnitude of the vector $\vec{A}$, also known as length or norm, is given by the square root of the sum of its components squared, $|\vec{A}|~ or~ ||\vec{A}|| = \sqrt{a_1^2+a_2^2+a_3^2}$, e.g., $||< 3, 2, 1 >|| = \sqrt{3^2+2^2+1^2}=\sqrt{14}$, $||< 3, -4, 5 >|| = \sqrt{3^2+(-4)^2+5^2}=\sqrt{50}=5\sqrt{2}$, or $||< 1, 0, 0 >|| = \sqrt{1^2+0^2+0^2}=\sqrt{1}=1$.

Geometrically, the partial derivative $\frac{\partial f}{\partial x}(x_0, y_0)$ at a point (x0, y0) can be interpreted as the slope of the tangent line to the curve formed by the intersection of the surface defined by f(x,y) and the plane y = y0. Similarly, $\frac{\partial f}{\partial y}(x_0, y_0)$ represents the slope of the tangent line to the curve formed by the intersection of the surface defined by f(x,y) and the plane x = x0

The gradient vector is defined as follows: ∇w = ⟨wx, wy, wz⟩ = $⟨\frac{\partial w}{\partial x}, \frac{\partial w}{\partial y}, \frac{\partial w}{\partial z}⟩$. It is a vector that points in the direction of the steepest increase or ascent of a function at a given point.

Theorem. The gradient vector is perpendicular to the level surfaces of the function.

Directional derivatives

A directional derivative represents how a function w = w(x, y) changes as you move in a specific direction from a point in its domain.

In single-variable calculus, the derivative measures the rate of change of a function with respect to one variable. For a function of two variables, $\frac{\partial w}{\partial x}, \frac{\partial w}{\partial y}$ represent the derivate of f in the directions of the x-axis and y-axis, respectively.

However, in many situations, we are interested in how the function changes in an arbitrary direction, not just along the coordinate axes.

Given a function f: ℝn → ℝ and a point P (x0, y0) in its domain, the directional derivate of f at P in the direction of a unit vector $\vec{u}$ = ⟨a, b⟩ (a vector in ℝn that has a length of 1) can be found as follows.

Steps to Compute the Directional Derivative

  1. Suppose we want to move linearly in the direction of $\vec{u}$. If $\vec{u}$ = ⟨a, b⟩, then we can describe the movement in the direction of $\vec{u}$ using the position vector $\vec{r}(s) = ⟨x_0 +sa, y_0 + sb⟩$, where s is a parameter representing how far we move in that direction.
  2. Gradient of the function. The gradient of w, denoted by ∇w, is a vector that contains all the partial derivatives of w. For a function w(x, y), it is given by: $∇w = (\frac{∂w}{∂x}, \frac{∂w}{∂y})$.
  3. Directional Derivative Formula. The directional derivative in the direction of $\vec{u}$ is given by the dot product of the gradient ∇w and the unit vector $\vec{u}$: $\frac{dw}{ds}\bigg|_{\vec{u}}$ = ∇w·$\vec{u}$, that is, the component of gradient ∇w in the direction of $\vec{u}$.

    $∇w·\hat{\mathbf{i}} = f_x$ represents the rate of change of the function f(x, y) as we vary x and hold y fixed. $∇w·\hat{\mathbf{j}} = f_y$ represents the rate of change of the function f(x, y) as we vary y and hold x fixed. This enables us to calculate the directional derivative in an arbitrary direction, by taking the dot product of ∇f with a unit vector, $\vec{u}$, in the desired direction.

In other words, we are asking what is going on if we move linearly in the direction of $\vec{u}$ (Figures A and B), say a position vector $\vec{r(s)}$ where $\frac{d\vec{r}}{ds}=\vec{u}$, that is, $\frac{dw}{ds}\bigg|_{\vec{u}}$. This is the directional derivative in the direction of ${\vec{u}}$, the rate of change of the function w as we move in the direction of $\vec{u}$, the slope of a slice (blue) of the graph by a vertical plane parallel to ${\vec{u}}$

Image

Geometrically, $\frac{dw}{ds}\bigg|_{\vec{u}} = ∇w·\vec{u} = |∇w|·|\vec{u}|cos(θ) = |∇w|·cos(θ)$ where θ is the angle between the gradient and the given unit vector.

The gradient is the direction in which the function increases fastest (the direction of the steepest ascent) at a given point, and |∇w| = $\frac{dw}{ds}\bigg|_{\vec{u}=dir(∇w)}$.

Futhermore, $\frac{dw}{ds}\bigg|_{\vec{u}} = 0$,the function w does not change. In other words, we are moving along a surface level or contour line of w ↭ cos(θ) = 0 ↭ θ = 90° ↭ $\vec{u}$ ⊥ ∇w, that is, the direction of movement ($\vec{u}$) is perpendicular to the direction of maximum change (∇w).

Formal Definition

Definition. Suppose z = f(x, y) is a function of two variables with a domain D. Let (a, b) ∈ D and define the unit vector $\vec{u} = cos(θ)\hat{\mathbf{i}}+sin(θ)\hat{\mathbf{j}}$. The directional derivate of f in the direction of $\vec{u}$ is given by $D_{\vec{u}}f(a, b) = \lim_{h \to 0} \frac{f(a + hcos(θ), b + hsin(θ)-f(a, b))}{h}$ provided the limit exists. Source: Calculus (OpenStack) by Gilbert Strang & Edwin “Jed” Herman.

A similar definition is given by YouTube’s Dr. Trefor Bazett, Calculus III: Multivariable Calculus.

Alternative Definition. Suppose z = f(x, y) is a function of two variables with a domain D and define the unit vector $\vec{u} = ⟨u_1, u_2⟩, where ||\vec{u}|| = 1$. The directional derivate of f in the direction of $\vec{u}$ is given by or defined as $D_{\vec{u}}f(x_0, y_0) = \lim_{s \to 0} \frac{f(x_0 + su_1, y_0 + su_2)-f(x_0, y_0)}{s}$ provided the limit exists.

image info

To compute the directional derivative using the chain rule, consider:

$x(s) = x_0 + su_1, y(s)= y_0+su_2.$

Thus, $D_{\vec{u}}f(x_0, y_0) = \lim_{s \to 0} \frac{f(x_0 + su_1, y_0 + su_2)-f(x_0, y_0)}{s} = \frac{d}{ds}[f(x(s),y(s))]\bigg|_{s=0}$

Applying the Multi-variable Chain Rule: $D_{\vec{u}}f(x_0, y_0) = (\left.\frac{∂f}{∂x}\right|_{(x_0, y_0)}\frac{dx}{ds})+$

$(\frac{∂f}{∂y}\Bigg|_{(x_0, y_0)}\frac{dy}{ds}) = $ [Since x(s)=x0+su1]

$(\frac{∂f}{∂x}\bigg|_{(x_0, y_0)}u_1)$ + [Since y(s)=y0+su2]

$(\frac{∂f}{∂y}\bigg|_{(x_0, y_0)}u_2)$. Let ∇f = $⟨\frac{∂f}{∂x},\frac{∂f}{∂y}⟩$ be the gradient of f, then we can conclude that:

$D_{\vec{u}}f(x_0, y_0) = ∇f\bigg|_{(x_0,y_0)}·\vec{u}$.

Theorem. Let z = f(x,y) be a function of two variables x and y, and assume that the partial derivatives fx and fy exists. Then, the directional derivative of f in the direction of $\vec{u} = cos(θ)\hat{\mathbf{i}}+sin(θ)\hat{\mathbf{j}}$ is given by $D_{\vec{u}}f(a, b)=f_x(x, y)cos(θ) + f_y(x, y)sin(θ)$.

Source: Calculus (OpenStack) by Gilbert Strang & Edwin “Jed” Herman.

Proof.

By definition, the directional derivate of f in the direction of $\vec{u} = cos(θ)\hat{\mathbf{i}}+sin(θ)\hat{\mathbf{j}}$ at a point (x0, y0) is given by: $D_{\vec{u}}f(x_0, y_0) = \lim_{t \to 0} \frac{f(x_0 + tcos(θ), y_0 + tsin(θ)-f(x_0, y_0))}{t}$ 🚀

Parameterization: Let x = x0 + tcos(θ), y = y0 + tsin(θ). Thus, $\frac{dx}{dt} = cos(θ), \frac{dy}{dt} = sin(θ)$ (*).

Define an intermediate function: Define a new function g(t) = f(x(t), y(t)) where x(t) = x0 + tcos(θ), y(t) = y0 + tsin(θ).

Apply the Chain Rule: Since, by assumption, we assume that fx and fy exists, we can use the chain rule to calculate g’(t):

$g’(t)= \frac{∂f}{∂x}\frac{dx}{dt} + \frac{∂f}{∂y}\frac{dy}{dt} =[*] f_x(x, y)cos(θ)+f_y(x, y)sin(θ)$

Evaluate at t = 0: At t = 0, we have x = x0, y = y0, and g’(0) = $f_x(x_0, y_0)cos(θ)+f_y(x_0, y_0)sin(θ)$ 🚀

By definition of the derivative g’(0): g’(0) = $\lim_{t \to 0} \frac{g(t)-g(0)}{t} = \lim_{t \to 0} \frac{f(x_0+tcos(θ), y_0+tsin(θ))-f(x_0, y_0)}{t}$ 🚀

Combining results, the directional derivative $D_{\vec{u}}f(x_0, y_0) = \lim_{t \to 0} \frac{f(x_0 + tcos(θ), y_0 + tsin(θ)-f(x_0, y_0))}{t} = f_x(x_0, y_0)cos(θ)+f_y(x_0, y_0)sin(θ)$.

Since the point (x0, y0) is an arbitrary point within the domain of f where the partials fx and fy exist, the result holds true for all points in the domain of f.∎

Solved exercises

First, find the gradient ∇f: $∇f = ⟨\frac{∂f}{∂x}, \frac{∂f}{∂y}⟩ = ⟨-2x, -2y⟩$.

At $(\frac{1}{2}, \frac{-1}{2}), D_{\vec{u}}f(x_0, y_0) = ⟨-2x, -2y⟩\bigg|_{(\frac{1}{2}, \frac{-1}{2})}·⟨\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}⟩ = $

$⟨-1, 1⟩·⟨\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}⟩ = -\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}} = 0$.

This result 0 indicates that at the point $(\frac{1}{2}, \frac{-1}{2})$, the function does not change as we move in the direction of $\vec{u}$. this implies there is an horizontal tangent line in this direction.

First, we normalize $\vec{v}$ to get a unit vector $\vec{u}.$ $||\vec{v}|| = \sqrt{(-1)^2+0^2+3^2} = \sqrt{10} ≠ 1$

$\vec{u} = \frac{1}{\sqrt{10}}⟨-1, 0, 3⟩$

Now, find the gradient ∇f: $∇f = ⟨\frac{∂f}{∂x}, \frac{∂f}{∂y}, \frac{∂f}{∂z}⟩ = ⟨2xz-yz, 3y^2z^2-xz, x^2+2y^3z -xy⟩$.

The directional derivative is: $\frac{dw}{ds}\bigg|_{\frac{1}{\sqrt{10}}⟨-1, 0, 3⟩⟩} = ∇w·\frac{1}{\sqrt{10}}⟨-1, 0, 3⟩ = ⟨\frac{\partial w}{\partial x}, \frac{\partial w}{\partial y}, \frac{\partial w}{\partial z}⟩·\frac{1}{\sqrt{10}}⟨-1, 0, 3⟩ = \frac{1}{\sqrt{10}}⟨2xz-yz, 3y^2z^2-xz, x^2+2y^3z -xy⟩·⟨-1, 0, 3⟩ = \frac{1}{\sqrt{10}}(-2xz +yz + 3x^2+6y^3z-3xy)$. This expression gives the rate of change of w in the direction of $\vec{u}$.

The directional derivative of f at a point (x, y) in the direction of a unit vector $\vec{u} = cos(θ)\hat{\mathbf{i}}+sin(θ)\hat{\mathbf{j}}$ is given by $D_{\vec{u}}f(a, b)=f_x(x, y)cos(θ) + f_y(x, y)sin(θ)$. Here, fx and fy are the partial derivatives of f with respect to x and y, respectively.

Wwe need to find the partial derivatives fx and fy: $f_x = 6xy-4y^3-4, f_y = 3x^2-12xy^2+6y.$

$D_{\vec{u}}f(3, 4)= (6xy-4y^3-4)cos(\frac{π}{3})+(3x^2-12xy^2+6y)sin(\frac{π}{3}) = \frac{1}{2}·(6xy-4y^3-4) + \frac{\sqrt{3}}{2}(3x^2-12xy^2+6y)=[\text{Substituting the values}]\frac{1}{2}·(6·3·4-4·4^3-4) + \frac{\sqrt{3}}{2}(3·3^2-12·3·4^2+6·4) = \frac{1}{2}·(72-256-4)+ \frac{\sqrt{3}}{2}(27-576+24)=-94-\frac{525\sqrt{3}}{2}$.

The unit vector $\vec{u}$ given the direction of θ = $\frac{2π}{3}$ is $\vec{u} = ⟨cos(\frac{2π}{3}), sin(\frac{2π}{3})⟩ = ⟨\frac{-1}{2}, \frac{\sqrt{3}}{2}⟩$

The directional derivative of f at a point (x, y) in the direction of a unit vector $\vec{u} = cos(θ)\hat{\mathbf{i}}+sin(θ)\hat{\mathbf{j}}$ is given by $D_{\vec{u}}f(a, b)=f_x(x, y)cos(θ) + f_y(x, y)sin(θ)$. Here, fx and fy are the partial derivatives of f with respect to x and y, respectively.

Wwe need to find the partial derivatives fx and fy: $f_x = e^{xy} +xye^{xy}, f_y = x^2e^{xy}+1.$

Evaluate the Partial Derivatives at the Point (2, 0) and calculate the directional derivative:

$D_{\vec{u}}f(2, 0)= (e^{xy} +xye^{xy})cos(\frac{2π}{3})+(4+1)sin(\frac{2π}{3}) = \frac{-1}{2}·(1+0) + 5\frac{\sqrt{3}}{2}⟩=[\text{Substituting the values}]\frac{-1}{2}= \frac{5\sqrt{3}-1}{2}$.

To find the directional derivative, we start by defining a new function g(z) that captures how f(x,y) changes as we move in the direction of $\vec{u}$: g(z) = f(x0 + az, y0 + bz). Here (x0, y0) is the point from which we start moving, and $\vec{u} = ⟨a, b⟩$ is the direction of movement.

Next, we need to find the derivative of g(z): $g’(z) = \lim_{h \to 0}\frac{g(z+h)-g(z)}{h}, g’(0) = \lim_{h \to 0}\frac{g(h)-g(0)}{h} = \lim_{h \to 0}\frac{f(x_0 + ah, y_0 + bh)-f(x_0, y_0)}{h} = D_{\vec{u}}f(x_0, y_0)$. This limit gives the directional derivative $D_{\vec{u}}f(x_0, y_0)$.

Let’s rewrite g(z) as follows g(z) = f(x, y) where x = x0 + az, and y = y0 + bz. g’(z) = [Differentiating g(z) with respect to z using the chain rule, we get:] $\frac{dg}{dz} = \frac{∂f}{∂x}\frac{dx}{dz} + \frac{∂f}{∂y}\frac{dy}{dz}$ =[Since x = x0 +az, y = y0 + bz] $f_x(x, y)a + f_y(x, y)b$ ⇒[Evaluating at z = 0, which corresponds to the original point x = x0, y = y0] $g’(0) = f_x(x_0, y_0)a + f_y(x_0, y_0)b$.

Combining both results, we find that the directional derivative $D_{\vec{u}}f(x_0, y_0) = g’(0) = f_x(x_0, y_0)a + f_y(x_0, y_0)b$. In general, $D_{\vec{u}}f(x, y) = f_x(x, y)a + f_y(x, y)b$.

First, We need to normalize the vector, $\vec{u} = ⟨\frac{2}{\sqrt{5}}, \frac{1}{\sqrt{5}}⟩$.

Next, find the partial derivatives of f: fx(x, y) = cos(y), fy(x, y) = -zsin(y).

Now, calculate the directional derivative $D_{\vec{u}}f(x, y) = f_x(x, y)a + f_y(x, y)b =[\text{Substitute the partial derivatives}] cos(y)\frac{2}{\sqrt{5}} - xsin(y)\frac{1}{\sqrt{5}} = \frac{1}{\sqrt{5}}(2cos(y)-xin(y)).$

  1. Find the rate of change in temperature at the point P(2, -1, 2) in the direction towards the point Q(3, -3, 3).
  2. Calculate in which direction the temperature increase fastest at P? What is this rate of increase?
  3. Determine if there is a direction at point P where the rate of change in temperature is −5∘ C/m. If so, find the direction; if not, explain why.

First, we calculate the vector from point P to point Q: $\vec{PQ} = ⟨3−2,−3−(−1),3−2⟩ = ⟨1, -2, 1⟩$.

To find the direction vector $\vec{u}$, we need to normalize the vector, $\vec{PQ}, \vec{u} = \frac{1}{\sqrt{6}}⟨1, -2, 1⟩$.

Next, we find the gradient of the temperature function ∇T: $∇T = ⟨\frac{∂T}{∂x}, \frac{∂T}{∂y}, \frac{∂T}{∂z}⟩ = ⟨2y, 2x -z, -y⟩$.

Evaluate the Gradient at P$(2, -1, 2), ∇T(2, −1, 2)= ⟨2(−1), 2(2)−2, −(−1)⟩ = ⟨−2, 4−2, 1⟩ = ⟨−2, 2, 1⟩

$D_{\vec{u}}f(2, -1, 2) = ⟨2y, 2x -z, -y⟩\bigg|_{(2, -1, 2)}·\frac{1}{\sqrt{6}}⟨1, -2, 1⟩$

The directional derivative at P in the direction of $\vec{u}$ is given by: $D_{\vec{u}}f(2, -1, 2) = ⟨-2, 2, 1⟩·\frac{1}{\sqrt{6}}⟨1, -2, 1⟩ = \frac{1}{\sqrt{6}}(-2-4+1) = \frac{-5}{\sqrt{6}}$. So, the rate of temperature at P(2, -1, 2) in the direction towards the point Q(3, -3, 3) is $\frac{-5}{\sqrt{6}}\frac{°C}{m}$.

The temperature increases fastest when the unit vector is parallel to the gradient vector. In other words, it changes most rapidly in the direction of the gradient vector $∇T(2, -1, 2) = ⟨2y, 2x -z, -y⟩\bigg|_{(2, -1, 2)} = ⟨-2, 2, 1⟩$.

The rate of increase is the magnitude of the gradient: |∇T(2, -1, 2)| = |⟨-2, 2, 1⟩| = $\sqrt{4 + 4 + 1} = 3°C/m$. This means the maximum rate of temperature increase is 3 °C/m

This also means that the maximum rate of temperature decrease is -3°C/m, and this is the case when the unit vector is in the opposite direction of the gradient. Since the maximum possible rate of decrease is −3 °C/m, it is impossible to have a rate of change of −5 °C/m.

Bibliography

This content is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License and is based on MIT OpenCourseWare [18.01 Single Variable Calculus, Fall 2007].
  1. NPTEL-NOC IITM, Introduction to Galois Theory.
  2. Algebra, Second Edition, by Michael Artin.
  3. LibreTexts, Calculus and Calculus 3e (Apex). Abstract and Geometric Algebra, Abstract Algebra: Theory and Applications (Judson).
  4. Field and Galois Theory, by Patrick Morandi. Springer.
  5. Michael Penn, and MathMajor.
  6. Contemporary Abstract Algebra, Joseph, A. Gallian.
  7. YouTube’s Andrew Misseldine: Calculus. College Algebra and Abstract Algebra.
  8. MIT OpenCourseWare 18.01 Single Variable Calculus, Fall 2007 and 18.02 Multivariable Calculus, Fall 2007.
  9. Calculus Early Transcendentals: Differential & Multi-Variable Calculus for Social Sciences.
Bitcoin donation

JustToThePoint Copyright © 2011 - 2025 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.