Directional Derivatives and Harmonic Functions
Directional Derivatives
In multivariable calculus, the directional derivative is a fundamental concept that extends the idea of a derivative to functions of more than one variable. While a partial derivative tells us how a function changes in the direction of one of the coordinate axes, the directional derivative tells us how the function changes in *any* specified direction.
Consider a scalar function of two variables, $f(x, y)$. We want to find the rate of change of $f$ at a point $(x_0, y_0)$ in the direction of a unit vector $\mathbf{u} = \langle a, b \rangle$.
Definition of Directional Derivative
The directional derivative of $f(x, y)$ at $(x_0, y_0)$ in the direction of a unit vector $\mathbf{u} = \langle a, b \rangle$ is given by:
$D_{\mathbf{u}}f(x_0, y_0) = \lim_{h \to 0} \frac{f(x_0 + ha, y_0 + hb) - f(x_0, y_0)}{h}$
provided this limit exists.
Geometric Interpretation
Imagine a surface defined by $z = f(x, y)$. At a point $(x_0, y_0, f(x_0, y_0))$ on this surface, the directional derivative $D_{\mathbf{u}}f(x_0, y_0)$ represents the slope of the tangent line to the curve formed by the intersection of the surface with the vertical plane containing the point $(x_0, y_0)$ and the direction vector $\mathbf{u}$.
Calculation using Gradient
If the function $f(x, y)$ is differentiable at $(x_0, y_0)$, and $\mathbf{u} = \langle a, b \rangle$ is a unit vector, then the directional derivative can be calculated more easily using the gradient of $f$. The gradient of $f$ is denoted by $\nabla f$ and is defined as:
$\nabla f(x, y) = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right\rangle$
The directional derivative is then the dot product of the gradient and the unit direction vector:
$D_{\mathbf{u}}f(x_0, y_0) = \nabla f(x_0, y_0) \cdot \mathbf{u}$
If $\mathbf{u} = \langle a, b \rangle$, then:
$D_{\mathbf{u}}f(x_0, y_0) = \frac{\partial f}{\partial x}(x_0, y_0) \cdot a + \frac{\partial f}{\partial y}(x_0, y_0) \cdot b$
This formula is incredibly useful because it simplifies the calculation significantly, avoiding the need for the limit definition.
Example Calculation
Let $f(x, y) = x^2y + 3xy^2$. Find the directional derivative of $f$ at the point $(1, 2)$ in the direction of the vector $\mathbf{v} = \langle 3, 4 \rangle$.
First, find the partial derivatives of $f$:
$\frac{\partial f}{\partial x} = 2xy + 3y^2$
$\frac{\partial f}{\partial y} = x^2 + 6xy$
Next, evaluate the partial derivatives at the point $(1, 2)$:
$\frac{\partial f}{\partial x}(1, 2) = 2(1)(2) + 3(2)^2 = 4 + 3(4) = 4 + 12 = 16$
$\frac{\partial f}{\partial y}(1, 2) = (1)^2 + 6(1)(2) = 1 + 12 = 13$
So, the gradient at $(1, 2)$ is $\nabla f(1, 2) = \langle 16, 13 \rangle$.
Now, we need a unit vector in the direction of $\mathbf{v} = \langle 3, 4 \rangle$. The magnitude of $\mathbf{v}$ is $|\mathbf{v}| = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5$.
The unit vector is $\mathbf{u} = \frac{\mathbf{v}}{|\mathbf{v}|} = \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle$.
Finally, calculate the directional derivative:
$D_{\mathbf{u}}f(1, 2) = \nabla f(1, 2) \cdot \mathbf{u} = \langle 16, 13 \rangle \cdot \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle$
$D_{\mathbf{u}}f(1, 2) = 16 \left(\frac{3}{5}\right) + 13 \left(\frac{4}{5}\right) = \frac{48}{5} + \frac{52}{5} = \frac{100}{5} = 20$
The directional derivative of $f$ at $(1, 2)$ in the direction of $\langle 3, 4 \rangle$ is 20. This means that if we move from $(1, 2)$ in the direction of $\langle 3, 4 \rangle$, the function $f$ increases at a rate of 20 units per unit distance.
Maximum and Minimum Rates of Change
The gradient vector $\nabla f$ points in the direction of the greatest rate of increase of the function $f$. The magnitude of the gradient, $|\nabla f|$, represents this maximum rate of increase.
$D_{\mathbf{u}}f = \nabla f \cdot \mathbf{u} = |\nabla f| |\mathbf{u}| \cos \theta = |\nabla f| \cos \theta$ (since $|\mathbf{u}| = 1$)
The maximum value of $D_{\mathbf{u}}f$ occurs when $\cos \theta = 1$, which means $\theta = 0$. This happens when $\mathbf{u}$ is in the same direction as $\nabla f$. The maximum rate of change is $|\nabla f|$.
The minimum value of $D_{\mathbf{u}}f$ occurs when $\cos \theta = -1$, which means $\theta = \pi$. This happens when $\mathbf{u}$ is in the opposite direction of $\nabla f$. The minimum rate of change is $-|\nabla f|$.
- The directional derivative measures the rate of change of a function in any direction.
- It can be calculated as the dot product of the gradient and the unit direction vector: $D_{\mathbf{u}}f = \nabla f \cdot \mathbf{u}$.
- The gradient $\nabla f$ points in the direction of the maximum rate of increase.
- The maximum rate of increase is $|\nabla f|$.
- The minimum rate of increase (maximum rate of decrease) is $-|\nabla f|$, occurring in the direction $-\nabla f$.
Directional Derivative for Functions of Three Variables
The concept extends directly to functions of three variables, $f(x, y, z)$. If $f$ is differentiable at a point $(x_0, y_0, z_0)$ and $\mathbf{u} = \langle a, b, c \rangle$ is a unit vector, then the directional derivative is:
$\nabla f(x, y, z) = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right\rangle$
$D_{\mathbf{u}}f(x_0, y_0, z_0) = \nabla f(x_0, y_0, z_0) \cdot \mathbf{u} = \frac{\partial f}{\partial x}(x_0, y_0, z_0) \cdot a + \frac{\partial f}{\partial y}(x_0, y_0, z_0) \cdot b + \frac{\partial f}{\partial z}(x_0, y_0, z_0) \cdot c$
Harmonic Functions
Harmonic functions are a special class of functions that appear frequently in physics and engineering, particularly in problems involving potential theory, fluid dynamics, and electromagnetism. They are defined by a specific partial differential equation known as Laplace's equation.
Definition of Harmonic Function
A function $f(x, y)$ is called harmonic in a domain $D$ if it has continuous second partial derivatives in $D$ and satisfies Laplace's equation:
$\nabla^2 f = \frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 0$
The operator $\nabla^2 = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}$ is called the Laplacian operator.
For functions of three variables, $f(x, y, z)$, a function is harmonic if it satisfies:
$\nabla^2 f = \frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} + \frac{\partial^2 f}{\partial z^2} = 0$
Properties of Harmonic Functions
Harmonic functions possess several remarkable properties:
- Mean Value Property: The average value of a harmonic function over a circle (or sphere) centered at a point $(x_0, y_0)$ is equal to the value of the function at the center.
- Maximum Modulus Principle: A non-constant harmonic function defined on a bounded connected domain attains its maximum and minimum values on the boundary of the domain. If the function is restricted to a closed and bounded domain, it attains its maximum and minimum values on the boundary.
- Analytic Functions and Harmonic Functions (for 2D): If $f(x, y)$ is a harmonic function, then its "harmonic conjugate" $g(x, y)$ exists such that the complex function $F(z) = f(x, y) + i g(x, y)$ is analytic (holomorphic). The real and imaginary parts of an analytic function are harmonic.
The Mean Value Property in Detail
For a harmonic function $f(x, y)$ in a domain containing a disk of radius $R$ centered at $(x_0, y_0)$, the average value of $f$ over the circle $C$ of radius $R$ is $f(x_0, y_0)$:
$f(x_0, y_0) = \frac{1}{2\pi R} \oint_C f(x, y) \, ds$
Similarly, for a harmonic function $f(x, y, z)$ in $\mathbb{R}^3$, the average value over a sphere $S$ of radius $R$ centered at $(x_0, y_0, z_0)$ is $f(x_0, y_0, z_0)$:
$f(x_0, y_0, z_0) = \frac{1}{4\pi R^2} \iint_S f(x, y, z) \, dS$
This property implies that a harmonic function cannot have a local maximum or minimum inside its domain unless it is constant. If it had a local maximum, the value at the maximum would be greater than the average value on the surrounding circle/sphere, contradicting the mean value property.
The Maximum Modulus Principle (or Maximum Principle)
Let $D$ be a bounded connected open set in $\mathbb{R}^n$, and let $f$ be a harmonic function on $D$ with continuous extensions to the boundary $\partial D$. If $f$ is not constant, then the maximum and minimum values of $f$ on the closure $\overline{D}$ are attained on the boundary $\partial D$.
This is a very powerful property. For example, if $f$ is harmonic on the unit disk and $f(x, y) = 0$ for all $(x, y)$ on the unit circle, then $f(x, y)$ must be $0$ everywhere inside the disk.
Example of a Harmonic Function
Consider the function $f(x, y) = e^x \cos y$. We need to check if it satisfies Laplace's equation.
First partial derivatives:
$\frac{\partial f}{\partial x} = e^x \cos y$
$\frac{\partial f}{\partial y} = -e^x \sin y$
Second partial derivatives:
$\frac{\partial^2 f}{\partial x^2} = e^x \cos y$
$\frac{\partial^2 f}{\partial y^2} = -e^x \cos y$
Now, sum the second partial derivatives:
$\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = (e^x \cos y) + (-e^x \cos y) = 0$
Since $\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 0$, the function $f(x, y) = e^x \cos y$ is harmonic everywhere.
Its harmonic conjugate is $g(x, y) = e^x \sin y$, because $F(z) = e^x \cos y + i e^x \sin y = e^x (\cos y + i \sin y) = e^x e^{iy} = e^{x+iy} = e^z$, which is an analytic function.
Connection between Directional Derivatives and Harmonic Functions
While directional derivatives describe the rate of change of a function, harmonic functions are characterized by the *absence* of change in a specific averaged sense (Laplace's equation implies that the change in one direction is perfectly balanced by the change in the perpendicular direction).
Consider a harmonic function $f$. At any point $(x_0, y_0)$, the gradient $\nabla f(x_0, y_0) = \langle f_x, f_y \rangle$ represents the direction and magnitude of the steepest ascent. If we move in a direction $\mathbf{u} = \langle a, b \rangle$, the rate of change is $D_{\mathbf{u}}f = af_x + bf_y$.
Laplace's equation $f_{xx} + f_{yy} = 0$ implies relationships between the partial derivatives. For instance, $f_{xx} = -f_{yy}$. This means that the second derivative in the x-direction is the negative of the second derivative in the y-direction. This condition ensures the function doesn't have "preferred" directions of change in a way that would lead to a net change over a region.
Consider the directional derivative in a direction $\mathbf{u}$ and its orthogonal direction $\mathbf{v}$. If $\mathbf{u} = \langle \cos \theta, \sin \theta \rangle$ and $\mathbf{v} = \langle -\sin \theta, \cos \theta \rangle$, then:
$D_{\mathbf{u}}f = f_x \cos \theta + f_y \sin \theta$
$D_{\mathbf{v}}f = -f_x \sin \theta + f_y \cos \theta$
Laplace's equation implies that the sum of the second directional derivatives in *any* two orthogonal directions is zero. For example, if we rotate the coordinate axes by an angle $\theta$, the new Laplacian is:
$\frac{\partial^2 f}{\partial x'^2} + \frac{\partial^2 f}{\partial y'^2} = \frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 0$
This invariance of Laplace's equation under rotation is a key property and connects to the idea that harmonic functions behave uniformly in all directions on a local level.
- Satisfy Laplace's equation: $\nabla^2 f = 0$.
- Continuous second partial derivatives required.
- Mean Value Property: Value at center = Average value over a circle/sphere.
- Maximum Principle: Max/Min values attained on the boundary.
- In 2D, real and imaginary parts of analytic functions are harmonic.
Applications
Harmonic functions are crucial in solving various boundary value problems in physics:
- Electrostatics: The electric potential in a charge-free region satisfies Laplace's equation.
- Gravitation: The gravitational potential in a region free of mass satisfies Laplace's equation.
- Steady-State Heat Conduction: The temperature distribution in a region with no heat sources or sinks satisfies Laplace's equation.
- Ideal Fluid Flow: The velocity potential for an irrotational, incompressible fluid flow satisfies Laplace's equation.
Directional derivatives, on the other hand, provide the tools to analyze how functions change along specific paths, which is essential for understanding gradients, optimization, and rates of change in physical systems described by these functions.