# Calculus of Variations

## Single-Integral

Extremize over $f$ : $S = \int_{\mathcal{X}} \mathcal{L}\big(x, f(x), \nabla f(x)\big) {~\rm d}{x}$ Specifically, we wish to solve for this extremization in terms of the functional derivative $\frac{\delta S}{\delta f} = \frac{\rm d}{{\rm d}\epsilon} S(f + \epsilon v) \big \rvert_{\epsilon{=}0}= 0$ where the function $v(x)$ is arbitrary up being zero on the boundary of $\mathcal{X}$ and differentiable. $\forall x \in \partial \mathcal{X}, \quad v(x) = 0$ Let us expand the induced perturbation ${\rm d}S$ to first order in ${\rm d}\epsilon$ about $\epsilon=0$ :

\begin{align} {\rm d}S &= \int_{\mathcal{X}} \bigg[ \frac{\partial \mathcal{L}}{\partial f} {\rm d} f + \sum_{i} \frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}} {\rm d} f^{\prime}_{i} \bigg] {~\rm d}{x} \quad ; \quad f^{\prime}_{i} = \frac{\partial f}{\partial x_{i}} \\ &= {\rm d}\epsilon \int_{\mathcal{X}} \bigg[ \frac{\partial \mathcal{L}}{\partial f} v + \sum_{i} \frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}} \frac{\partial v}{\partial x_{i}} \bigg] {~\rm d}{x} + \mathcal{O}({\rm d}\epsilon^{2}) \end{align}

Integrating by parts,

\begin{align} \frac{{\rm d} S}{{\rm d} \epsilon} = \int_{\partial \mathcal{X}} \frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}} \underbrace{v(x)}_{=0} {~\rm d}{x} + \int_{\mathcal{X}} v(x) \bigg[ \frac{\partial \mathcal{L}}{\partial f} - \sum_{i} \frac{\partial }{\partial x_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}}\bigg) \bigg] {~\rm d}{x} \end{align}

The only way to guarantee that this derivative is zero for all permissible $v$ is for the Euler-Lagrange equation to hold: $\frac{\partial \mathcal{L}}{\partial f} - \sum_{i} \frac{\partial }{\partial x_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}}\bigg) =0 \quad ; \quad f^{\prime}_{i} = \frac{\partial f}{\partial x_{i}}$

## Multiple-Integral

Consider now $S = \int_{\mathcal{X}} \int_{\mathcal{Y}} \mathcal{L}\big(x, y, f(x), f(y), \nabla f(x), \nabla f(y) \big) {~\rm d}{y}{\rm d}{x}$ where $\mathcal{X} = \mathcal{Y}$ . Using the same prescription to vary $f$ as above, ${\rm d} f = v {\rm d}\epsilon$ For extremal $S$ , we obtain

\begin{align*} \frac{{\rm d} S}{{\rm d} \epsilon} = \int_{\mathcal{X}} \int_{\mathcal{Y}} v(x) &\bigg[ \frac{\partial \mathcal{L}}{\partial f(x)} - \sum_{i} \frac{\partial }{\partial x_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}(x)}\bigg) \bigg] \\ \quad + v(y) &\bigg[ \frac{\partial \mathcal{L}}{\partial f(y)} - \sum_{i} \frac{\partial }{\partial y_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}(y)}\bigg) \bigg] {\rm d}y {\rm d}x = 0 \end{align*}

Since $v$ is arbitrary up to boundary conditions, we may treat the values of $v$ at $x$ and $y$ as independent when $x \neq y$ , but we may not do so when $x = y$ . When the event $x = y$ has measure 0, we arrive at the independent equations:

\begin{align} \int_{\mathcal{Y}} \bigg[ \frac{\partial \mathcal{L}}{\partial f(x)} - \sum_{i} \frac{\partial }{\partial x_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}(x)}\bigg) \bigg] {\rm d}y = 0 \\ \int_{\mathcal{X}} \bigg[ \frac{\partial \mathcal{L}}{\partial f(y)} - \sum_{i} \frac{\partial }{\partial y_{i}} \bigg(\frac{\partial \mathcal{L}}{\partial f^{\prime}_{i}(y)}\bigg) \bigg] {\rm d}x = 0 \end{align}