Mathematics / Calculus Multivariable & Vector Analysis 100% Free Open Access
Chapter 4 โ€ข Theory & Derivations

Unit 4: Multivariable Chain Rules, Directional Derivatives & Optimization

Gradient vectors, directional derivatives, steepest ascent, the second derivative Hessian classification test, saddle points, and constrained optimization via Lagrange multipliers.

ยง4.1 The Multivariable Chain Rule and Implicit Functions

1. The Multivariable Chain Rule

Let $z = f(x, y)$ be a differentiable function of $x$ and $y$.

1. Case 1 (Single Independent Variable $t$):

If $x = g(t)$ and $y = h(t)$ are differentiable functions of $t$, then $z$ is a differentiable function of $t$, and:

$$\mathbf{\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}}$$

2. Case 2 (Multiple Independent Variables $s, t$):

If $x = g(s, t)$ and $y = h(s, t)$ are differentiable functions of $s$ and $t$, then:

$$\mathbf{\frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s}}$$
$$\mathbf{\frac{\partial z}{\partial t} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial t}}$$

General Tree Diagram Rule: To evaluate the derivative of a dependent variable with respect to an independent variable, trace all paths from the dependent variable to the independent variable in the dependency tree. Form the product of partial derivatives along each branch, and sum across all paths.


2. Implicit Differentiation via Partial Derivatives

Let an equation $F(x, y) = 0$ define $y$ implicitly as a differentiable function of $x$. Differentiating both sides with respect to $x$ using the Chain Rule:

$$\frac{\partial F}{\partial x}\frac{dx}{dx} + \frac{\partial F}{\partial y}\frac{dy}{dx} = 0 \implies F_x + F_y \frac{dy}{dx} = 0$$

Assuming $F_y \neq 0$:

$$\mathbf{\frac{dy}{dx} = -\frac{F_x}{F_y}}$$

Similarly, if $F(x, y, z) = 0$ defines $z$ implicitly as a function of $x$ and $y$:

$$\mathbf{\frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \qquad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z}} \quad (F_z \neq 0)$$

ยง4.2 Directional Derivatives and the Gradient Vector

1. The Directional Derivative

Partial derivatives $f_x$ and $f_y$ measure rates of change along the directions of the coordinate axes $\hat{i}$ and $\hat{j}$. The directional derivative generalizes this to an arbitrary unit direction vector $\vec{u} = \langle a, b \rangle$ ($a^2 + b^2 = 1$).

Definition: The directional derivative of $f$ at $(x_0, y_0)$ in the direction of unit vector $\vec{u}$ is:

$$D_{\vec{u}} f(x_0, y_0) = \lim_{h \to 0} \frac{f(x_0 + ha, \; y_0 + hb) - f(x_0, y_0)}{h}$$

2. The Gradient Vector

Definition: If $f$ is a differentiable function of two variables, the gradient of $f$, denoted by $\nabla f$ (read "del $f$"), is the vector function:

$$\mathbf{\nabla f(x, y) = \left\langle \frac{\partial f}{\partial x}, \; \frac{\partial f}{\partial y} \right\rangle = f_x\hat{i} + f_y\hat{j}}$$

For a function of three variables $w = f(x, y, z)$:

$$\mathbf{\nabla f(x, y, z) = \langle f_x, \; f_y, \; f_z \rangle = f_x\hat{i} + f_y\hat{j} + f_z\hat{k}}$$

3. Computation Theorem for Directional Derivatives

Theorem: If $f$ is a differentiable function, then the directional derivative in the direction of unit vector $\vec{u}$ is given by the scalar dot product:

$$\mathbf{D_{\vec{u}} f(x, y) = \nabla f(x, y) \cdot \vec{u}}$$
Proof:

Define $g(h) = f(x_0 + ha, y_0 + hb)$. By definition, $D_{\vec{u}} f(x_0, y_0) = g'(0)$. By the Multivariable Chain Rule:

$$g'(h) = \frac{\partial f}{\partial x}\frac{d(x_0+ha)}{dh} + \frac{\partial f}{\partial y}\frac{d(y_0+hb)}{dh} = f_x(x_0+ha, y_0+hb) a + f_y(x_0+ha, y_0+hb) b$$

Setting $h = 0$:

$$g'(0) = f_x(x_0, y_0) a + f_y(x_0, y_0) b = \langle f_x, f_y \rangle \cdot \langle a, b \rangle = \nabla f(x_0, y_0) \cdot \vec{u} \quad \blacksquare$$

4. Fundamental Geometric Properties of the Gradient

Using the definition of the dot product:

$$D_{\vec{u}} f = \nabla f \cdot \vec{u} = |\nabla f| |\vec{u}| \cos\theta = |\nabla f| \cos\theta$$

where $\theta$ is the angle between $\nabla f$ and $\vec{u}$.

1. Direction of Maximum Increase (Steepest Ascent):

$\cos\theta = 1 \implies \theta = 0$. The maximum value of the directional derivative is $|\nabla f|$, and it occurs in the exact direction of the gradient vector $\nabla f$.

2. Direction of Maximum Decrease (Steepest Descent):

$\cos\theta = -1 \implies \theta = \pi$. The minimum value is $-|\nabla f|$, occurring in direction $-\nabla f$.

3. Orthogonality to Level Sets:

$\cos\theta = 0 \implies \theta = \pi/2$. The directional derivative is zero in directions orthogonal to $\nabla f$. Therefore, the gradient vector $\nabla f(x_0, y_0)$ is strictly perpendicular to the level curve $f(x, y) = c$ at $(x_0, y_0)$.

For a level surface $F(x, y, z) = c$, the gradient $\nabla F(x_0, y_0, z_0)$ is the normal vector to the tangent plane.

ยง4.3 Extrema, Saddle Points, and Lagrange Multipliers

1. Critical Points and Extrema

A function $z = f(x, y)$ has a local maximum (or minimum) at $(a, b)$ if $f(x, y) \le f(a, b)$ (or $f(x, y) \ge f(a, b)$) for all $(x, y)$ in some open disk around $(a, b)$.

Fermat's Theorem for Multivariable Functions: If $f$ has a local extremum at $(a, b)$ and the first partial derivatives exist, then:

$$\nabla f(a, b) = \vec{0} \iff f_x(a, b) = 0 \quad \text{and} \quad f_y(a, b) = 0$$

A point $(a, b)$ where $\nabla f(a, b) = \vec{0}$ or where either partial derivative fails to exist is called a critical point.


2. The Second Derivative Test (Hessian Discriminant)

Let $(a, b)$ be a critical point of $f(x, y)$, and assume the second partial derivatives are continuous on a disk containing $(a, b)$. Define the Hessian determinant:

$$\mathbf{D = D(a, b) = f_{xx}(a, b) f_{yy}(a, b) - [f_{xy}(a, b)]^2 = \begin{vmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{vmatrix}}$$

1. If $D > 0$ and $f_{xx}(a, b) > 0$: $f(a, b)$ is a Local Minimum.

2. If $D > 0$ and $f_{xx}(a, b) < 0$: $f(a, b)$ is a Local Maximum.

3. If $D < 0$: $(a, b)$ is a Saddle Point (the surface curves upwards in one direction and downwards in another, resembling a mountain pass).

4. If $D = 0$: The test is inconclusive (higher-order terms must be analyzed).


3. Constrained Optimization via Lagrange Multipliers

To maximize or minimize an objective function $f(x, y, z)$ subject to a constraint $g(x, y, z) = k$ (where $\nabla g \neq \vec{0}$):

Geometric Principle: At an extremum on the constraint surface, the level surface of $f$ must be tangent to the constraint surface $g = k$. Therefore, their normal vectors must be parallel:

$$\mathbf{\nabla f(x, y, z) = \lambda \nabla g(x, y, z)}$$

The scalar parameter $\lambda$ is called the Lagrange Multiplier.

Method of Lagrange Multipliers:

Solve the system of four simultaneous equations in four unknowns $(x, y, z, \lambda)$:

$$\begin{cases} f_x = \lambda g_x \\ f_y = \lambda g_y \\ f_z = \lambda g_z \\ g(x, y, z) = k \end{cases}$$
Dual Constraints:

To optimize $f(x, y, z)$ subject to two simultaneous constraints $g(x, y, z) = k$ and $h(x, y, z) = c$:

$$\mathbf{\nabla f = \lambda \nabla g + \mu \nabla h}$$
TIERED UNIVERSITY HONORS PROBLEMS

Step-by-Step Solved Examination Problems

Comprehensive analytical derivations, multi-tier solutions (Foundational, Intermediate Exam, and Honors/Proof Challenge) with complete line-by-line verification.

Solved Problem Example 4.1: Directional Derivative and Maximum Rate of Increase

Consider the scalar field:

$$f(x, y, z) = x^2 y z + x z^3$$

(a) Find the gradient vector $\nabla f(x, y, z)$ at the point $P(1, 2, -1)$. (b) Find the directional derivative $D_{\vec{u}} f(P)$ in the direction from $P(1, 2, -1)$ toward $Q(3, 1, 1)$. (c) Find the maximum rate of increase of $f$ at $P$, and the unit vector in which it occurs.

Part (a): Compute the Gradient Vector Compute partial derivatives:

$$f_x = \frac{\partial}{\partial x}(x^2 y z + x z^3) = 2x y z + z^3$$
$$f_y = \frac{\partial}{\partial y}(x^2 y z + x z^3) = x^2 z$$
$$f_z = \frac{\partial}{\partial z}(x^2 y z + x z^3) = x^2 y + 3x z^2$$

Evaluate at $P(1, 2, -1)$:

$$f_x(1, 2, -1) = 2(1)(2)(-1) + (-1)^3 = -4 - 1 = -5$$
$$f_y(1, 2, -1) = (1^2)(-1) = -1$$
$$f_z(1, 2, -1) = (1^2)(2) + 3(1)(-1)^2 = 2 + 3 = 5$$

Thus:

$$\mathbf{\nabla f(1, 2, -1) = \langle -5, \; -1, \; 5 \rangle}$$

Part (b): Directional Derivative toward $Q(3, 1, 1)$ The displacement vector from $P$ to $Q$ is:

$$\vec{v} = \vec{PQ} = \langle 3 - 1, \; 1 - 2, \; 1 - (-1) \rangle = \langle 2, \; -1, \; 2 \rangle$$

The magnitude is:

$$|\vec{v}| = \sqrt{2^2 + (-1)^2 + 2^2} = \sqrt{4 + 1 + 4} = \sqrt{9} = 3$$

The unit direction vector is:

$$\vec{u} = \frac{\vec{v}}{|\vec{v}|} = \left\langle \frac{2}{3}, \; -\frac{1}{3}, \; \frac{2}{3} \right\rangle$$

Now compute the directional derivative via dot product:

$$D_{\vec{u}} f(P) = \nabla f(P) \cdot \vec{u} = (-5)\left(\frac{2}{3}\right) + (-1)\left(-\frac{1}{3}\right) + (5)\left(\frac{2}{3}\right)$$
$$= -\frac{10}{3} + \frac{1}{3} + \frac{10}{3} = \mathbf{\frac{1}{3}}$$

Part (c): Maximum Rate of Increase The maximum rate of increase equals the magnitude of the gradient:

$$|\nabla f(P)| = \sqrt{(-5)^2 + (-1)^2 + 5^2} = \sqrt{25 + 1 + 25} = \mathbf{\sqrt{51}} \approx 7.141$$

It occurs in the unit direction of the gradient:

$$\hat{u}_{max} = \frac{\nabla f}{|\nabla f|} = \mathbf{\frac{1}{\sqrt{51}} \langle -5, \; -1, \; 5 \rangle}$$
Solved Problem Example 4.2: Critical Point Classification on a Cubic Surface

Find and classify all local extrema and saddle points of the cubic surface:

$$f(x, y) = x^3 + y^3 - 3xy$$

Step 1: Find Critical Points Set partial derivatives equal to zero:

$$f_x = 3x^2 - 3y = 0 \implies y = x^2 \quad \text{--- (1)}$$
$$f_y = 3y^2 - 3x = 0 \implies x = y^2 \quad \text{--- (2)}$$

Substitute (1) into (2):

$$x = (x^2)^2 = x^4 \implies x^4 - x = 0$$
$$x(x^3 - 1) = 0 \implies x(x - 1)(x^2 + x + 1) = 0$$

Real roots are $x = 0$ and $x = 1$.

  • If $x = 0$: $y = 0^2 = 0 \implies (0, 0)$.
  • If $x = 1$: $y = 1^2 = 1 \implies (1, 1)$.

The two critical points are $(0, 0)$ and $(1, 1)$.


Step 2: Compute Second Partial Derivatives and Hessian

$$f_{xx} = \frac{\partial}{\partial x}(3x^2 - 3y) = 6x$$
$$f_{yy} = \frac{\partial}{\partial y}(3y^2 - 3x) = 6y$$
$$f_{xy} = \frac{\partial}{\partial y}(3x^2 - 3y) = -3$$

The Hessian determinant is:

$$D(x, y) = f_{xx} f_{yy} - (f_{xy})^2 = (6x)(6y) - (-3)^2 = 36xy - 9$$

Step 3: Classify Each Critical Point

1. At $(0, 0)$:

$$D(0, 0) = 36(0)(0) - 9 = -9 < 0$$

Since $D < 0$, $(0, 0)$ is a Saddle Point. The surface value is $f(0, 0) = 0$.

2. At $(1, 1)$:

$$D(1, 1) = 36(1)(1) - 9 = 27 > 0$$
$$f_{xx}(1, 1) = 6(1) = 6 > 0$$

Since $D > 0$ and $f_{xx} > 0$, $(1, 1)$ is a Local Minimum. The local minimum value is $f(1, 1) = 1^3 + 1^3 - 3(1)(1) = 1 + 1 - 3 = -1$.

Solved Problem Example 4.3: Dual-Constraint Lagrange Optimization on Spatial Intersection

Find the points on the curve of intersection of the plane:

$$x + y + z = 1$$

and the circular cylinder:

$$x^2 + y^2 = 1$$

that are closest to and farthest from the origin. Find these extreme distances.

Step 1: Formulate the Objective and Constraint Functions We wish to optimize the squared distance from $(x, y, z)$ to $(0, 0, 0)$ (which shares the same extrema as distance):

$$f(x, y, z) = x^2 + y^2 + z^2$$

Subject to two simultaneous constraints:

$$g(x, y, z) = x + y + z = 1$$
$$h(x, y, z) = x^2 + y^2 = 1$$

Step 2: Set up the Dual-Constraint Lagrange System

$$\nabla f = \lambda \nabla g + \mu \nabla h$$
$$\langle 2x, \; 2y, \; 2z \rangle = \lambda \langle 1, \; 1, \; 1 \rangle + \mu \langle 2x, \; 2y, \; 0 \rangle$$

Equating components:

$$\begin{cases} 2x = \lambda + 2\mu x & \text{--- (1)} \ 2y = \lambda + 2\mu y & \text{--- (2)} \ 2z = \lambda & \text{--- (3)} \ x + y + z = 1 & \text{--- (4)} \ x^2 + y^2 = 1 & \text{--- (5)} \end{cases}$$

Step 3: Solve the Algebraic System From equation (3), $\lambda = 2z$. Subtract equation (2) from equation (1):

$$2(x - y) = 2\mu(x - y) \implies 2(x - y)(1 - \mu) = 0$$

This yields two possibilities: $\mu = 1$ or $x = y$.

Case A: $\mu = 1$ If $\mu = 1$, substituting into equation (1):

$$2x = \lambda + 2x \implies \lambda = 0$$

From equation (3), $\lambda = 2z \implies z = 0$. Substitute $z = 0$ into equation (4):

$$x + y + 0 = 1 \implies y = 1 - x$$

Substitute into equation (5):

$$x^2 + (1 - x)^2 = 1 \implies x^2 + 1 - 2x + x^2 = 1 \implies 2x^2 - 2x = 0$$
$$2x(x - 1) = 0 \implies x = 0 \quad \text{or} \quad x = 1$$
  • If $x = 0$: $y = 1, z = 0 \implies P_1(0, 1, 0)$.
  • If $x = 1$: $y = 0, z = 0 \implies P_2(1, 0, 0)$.

For both points: $f(0, 1, 0) = 1$ and $f(1, 0, 0) = 1$.

Case B: $x = y$ Substitute $x = y$ into equation (5):

$$x^2 + x^2 = 1 \implies 2x^2 = 1 \implies x = \pm \frac{1}{\sqrt{2}}$$
  • Subcase B1: $x = y = \frac{1}{\sqrt{2}}$.

From (4): $\frac{1}{\sqrt{2}} + \frac{1}{\sqrt{2}} + z = 1 \implies z = 1 - \sqrt{2}$. Point $P_3\left(\frac{1}{\sqrt{2}}, \; \frac{1}{\sqrt{2}}, \; 1 - \sqrt{2}\right)$.

$$f(P_3) = \left(\frac{1}{\sqrt{2}}\right)^2 + \left(\frac{1}{\sqrt{2}}\right)^2 + (1 - \sqrt{2})^2 = \frac{1}{2} + \frac{1}{2} + (1 - 2\sqrt{2} + 2) = 4 - 2\sqrt{2} \approx 1.1716$$
  • Subcase B2: $x = y = -\frac{1}{\sqrt{2}}$.

From (4): $-\frac{1}{\sqrt{2}} - \frac{1}{\sqrt{2}} + z = 1 \implies z = 1 + \sqrt{2}$. Point $P_4\left(-\frac{1}{\sqrt{2}}, \; -\frac{1}{\sqrt{2}}, \; 1 + \sqrt{2}\right)$.

$$f(P_4) = \frac{1}{2} + \frac{1}{2} + (1 + 2\sqrt{2} + 2) = 4 + 2\sqrt{2} \approx 6.8284$$

Step 4: Conclusion

  • Closest Points: $(1, 0, 0)$ and $(0, 1, 0)$ with minimum distance $d_{min} = \sqrt{1} = \mathbf{1}$.
  • Farthest Point: $\left(-\frac{1}{\sqrt{2}}, \; -\frac{1}{\sqrt{2}}, \; 1 + \sqrt{2}\right)$ with maximum distance:
$$d_{max} = \sqrt{4 + 2\sqrt{2}} \approx \mathbf{2.613}$$