2.2 Variation of a function

Consider a function, \(y=f(x)\), and a new function, \(\bar{f}(x)\):

\begin{align} \bar{f}(x)=f(x)+\epsilon \phi(x) \tag{2.1}\end{align}

where \(\epsilon\) is a number that we can make arbitrarily small, and \(\phi(x)\) is a function that is continuous and differentiable in some interval \(x=a\dots b\) over which \(f(x)\) is defined, continuous and differentiable. We define the variation of a function as:

\begin{align} \delta y \equiv \bar{f}(x) -f(x) = \epsilon \phi(x) \tag{2.2}\end{align}

The change in \(f(x)\) is infinitesimal and “virtual”, meaning that we can choose any arbitrary well behaved \(\phi(x)\). Thus \(\delta y\) does not represent a “real” change in the function from a change in its dependent variables. Again, note the difference between \(\delta y\) and \(dy\); \(dy\) is the (familiar) change in \(f(x)\) from a corresponding change in \(x\) by \(dx\), while \(\delta y\) is a change in \(f(x)\) without a change in \(x\), and is a new function. This is illustrated in Figure 2.1.

Virtual Displacement

Figure 2.1A function \(y=f(x)\) showing a differential change \(dx\) which corresponds to a change in \(x\) of \(dx\). The variation of the function at a point, \(\delta y\), is also shown, which is independent of a change in \(x\) and leads to a different function, \(\bar{f}(x)\).

For the calculus of variations, we only consider changes in the dependent variables, thus:

\begin{align} \delta x = 0 \tag{2.3}\end{align}

Properties of the \(\delta\) operator

Commutation with differentiation

Consider the “derivative of the variation”:

\begin{align} \frac{d}{dx}\delta y =\frac{d}{dx} \left[\bar{f}(x)-f(x) \right]=\frac{d}{dx} \epsilon \phi(x)=\epsilon \phi'(x) \tag{2.4}\end{align}

where we have used an apostrophe (’) to designate derivatives with respect to \(x\). Now consider the “variation of the derivative”:

\begin{align} \delta \left(\frac{d}{dx}f(x)\right) \equiv \frac{d\bar{f}}{dx}-\frac{df}{dx} = \frac{d}{dx} (f(x)+\epsilon \phi(x)) - \frac{df}{dx} = \epsilon \phi'(x) \tag{2.5}\end{align}

We thus find that \(\delta\) is commutative with \(\frac{d}{dx}\):

\begin{align} \therefore \delta \left(\frac{dy}{dx}\right) = \frac{d}{dx}\left(\delta y\right) \tag{2.6}\end{align}

Commutation with integration

Next, consider the variation of a definite integral:

\begin{align} \delta \int_a^b f(x) dx &\equiv \int_a^b \bar{f}(x) dx - \int_a^b f(x) dx = \int_a^b (\bar{f}(x)-f(x)) dx\\ \therefore \delta \int_a^b f(x) dx &= \int_a^b \delta f(x) dx \tag{2.7}\end{align}

The delta operator also commutes with respect to integration.

Chain Rule

If \(y\) is a function of \(x\), the variation of a function, \(F(y)\), is given by:

\begin{align} \delta F(y) &= F(y+\delta y)-F(y) \tag{2.8}\end{align}

We can expand \(F(y+\delta y)\) using a Taylor series, where \(\delta y\) is small:

\begin{align} F(y+\delta y)=F(y)+\frac{dF}{dy}\delta y + \frac{1}{2!}\frac{d^2F}{dy^2}(\delta y)^2+\dots \tag{2.9}\end{align}

Given that \(\delta y\) are small, we can ignore the terms in powers higher than 2:

\begin{align} F(y+\delta y)&=F(y)+\frac{dF}{dy}\delta y\\ \therefore \delta F(y)&=\frac{dF}{dy}\delta y \tag{2.10}\end{align}

which is (like) the Chain Rule.

Example 2-1

Determine \(\delta(\cos{\theta})\)

Using the Chain Rule:

\begin{align*} \delta(\cos{\theta})=-\sin{\theta}\delta\theta \end{align*}

If the function \(F\) is a function of multiple functions, \(y(x), z(x), \dots\), we proceed the same way, but using partial derivatives:

\begin{align} \delta F(y,z,\dots) &= F(y+\delta y, z+\delta z, \dots)-F(y,z,\dots)\\ &=\frac{\partial F}{\partial y}\delta y +\frac{\partial F}{\partial z}\delta z+\dots+ \frac{1}{2!}\left(\frac{\partial^2F}{\partial y}\delta^2y+\frac{\partial^2F}{\partial z}\delta^2z+2\frac{\partial^2 F}{\partial y\partial z}\delta y \delta z+\dots \right) +\dots \tag{2.11}\end{align}

where again, we will neglect the terms in \(\delta^2\) and higher.

Example 2-2

Compare the differential displacement and virtual displacement of a position vector \(\vec{r}=\vec{r}(q_1,q_2,\dots,q_n,t)\) that is a function of generalized coordinates, \(q\).

When considering the position of a particle as a function of the generalized coordinates:

\begin{align*} \vec{r}=\vec{r}(q_1,q_2,\dots,q_n,t) \end{align*}

the differential displacement (also the “true” displacement):

\begin{align*} d\vec{r}=\frac{\partial\vec{r}}{\partial q_1}dq_1+\dots+\frac{\partial\vec{r}}{\partial q_n}dq_n+\frac{\partial\vec{r}}{\partial t}dt \end{align*}

whereas the virtual displacement does not have a time differential in it:

\begin{align*} \delta\vec{r}=\frac{\partial\vec{r}}{\partial q_1}\delta q_1+\dots+\frac{\partial\vec{r}}{\partial q_{n}}\delta q_{n} \end{align*}