Multivariable Calculus

Last updated: December 2024

Disclaimer: These are my personal notes compiled for my own reference and learning. They may contain errors, incomplete information, or personal interpretations. While I strive for accuracy, these notes are not peer-reviewed and should not be considered authoritative sources. Please consult official textbooks, research papers, or other reliable sources for academic or professional purposes.

1. Partial Derivatives

For a function $f(x, y)$, the partial derivative with respect to $x$ is:

$$\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h, y) - f(x, y)}{h}$$

Similarly for $y$:

$$\frac{\partial f}{\partial y} = \lim_{h \to 0} \frac{f(x, y+h) - f(x, y)}{h}$$

2. Higher Order Partial Derivatives

Second partial derivatives:

$$\frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right)$$ $$\frac{\partial^2 f}{\partial y^2} = \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial y}\right)$$ $$\frac{\partial^2 f}{\partial x \partial y} = \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)$$ $$\frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right)$$

3. Clairaut's Theorem

If $f$ has continuous second partial derivatives, then:

$$\frac{\partial^2 f}{\partial x \partial y} = \frac{\partial^2 f}{\partial y \partial x}$$

4. Gradient

The gradient of $f(x, y)$ is the vector of partial derivatives:

$$\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right)$$

For $f(x, y, z)$:

$$\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right)$$

5. Directional Derivative

The directional derivative of $f$ in the direction of unit vector $\mathbf{u}$ is:

$$D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u}$$

This gives the rate of change of $f$ in the direction of $\mathbf{u}$.

6. Chain Rule for Multivariable Functions

For $f(x(t), y(t))$:

$$\frac{df}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}$$

For $f(x(s,t), y(s,t))$:

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

7. Critical Points and Extrema

Critical points occur where $\nabla f = \mathbf{0}$ or partial derivatives don't exist.

7.1 Second Derivative Test

For a critical point $(a, b)$, let:

$$D = f_{xx}(a,b)f_{yy}(a,b) - [f_{xy}(a,b)]^2$$

8. Multiple Integrals

8.1 Double Integrals

For a region $R$ in the $xy$-plane:

$$\iint_R f(x,y) \, dA = \int_a^b \int_{g_1(x)}^{g_2(x)} f(x,y) \, dy \, dx$$

8.2 Triple Integrals

For a region $E$ in 3D space:

$$\iiint_E f(x,y,z) \, dV = \int_a^b \int_{g_1(x)}^{g_2(x)} \int_{h_1(x,y)}^{h_2(x,y)} f(x,y,z) \, dz \, dy \, dx$$

9. Change of Variables

For a transformation $T: (u,v) \mapsto (x,y)$:

$$\iint_R f(x,y) \, dA = \iint_S f(x(u,v), y(u,v)) |J| \, du \, dv$$

where $J$ is the Jacobian determinant:

$$J = \begin{vmatrix} \frac{\partial x}{\partial u} & \frac{\partial x}{\partial v} \\ \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v} \end{vmatrix}$$

10. Line Integrals

For a curve $C$ parameterized by $\mathbf{r}(t)$:

$$\int_C f(x,y) \, ds = \int_a^b f(\mathbf{r}(t)) \|\mathbf{r}'(t)\| \, dt$$

For vector fields:

$$\int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t) \, dt$$

11. Green's Theorem

For a simple closed curve $C$ bounding region $D$:

$$\oint_C \mathbf{F} \cdot d\mathbf{r} = \iint_D \left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right) \, dA$$

where $\mathbf{F} = P\mathbf{i} + Q\mathbf{j}$.

12. Divergence and Curl

For a vector field $\mathbf{F} = P\mathbf{i} + Q\mathbf{j} + R\mathbf{k}$:

$$\text{div } \mathbf{F} = \nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}$$
$$\text{curl } \mathbf{F} = \nabla \times \mathbf{F} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z} \\ P & Q & R \end{vmatrix}$$

13. Code Example

# Python code for multivariable calculus
import numpy as np
import sympy as sp
from scipy import optimize

# Define variables and function
x, y = sp.symbols('x y')
f = x**2 + y**2 - 2*x*y

# Partial derivatives
f_x = sp.diff(f, x)
f_y = sp.diff(f, y)
f_xx = sp.diff(f, x, 2)
f_yy = sp.diff(f, y, 2)
f_xy = sp.diff(f, x, y)

print(f"∂f/∂x = {f_x}")
print(f"∂f/∂y = {f_y}")
print(f"∂²f/∂x² = {f_xx}")
print(f"∂²f/∂y² = {f_yy}")
print(f"∂²f/∂x∂y = {f_xy}")

# Find critical points
critical_points = sp.solve([f_x, f_y], [x, y])
print(f"Critical points: {critical_points}")

# Numerical optimization
def func(x):
    return x[0]**2 + x[1]**2 - 2*x[0]*x[1]

result = optimize.minimize(func, [0, 0])
print(f"Minimum at: {result.x}")

14. References