= Solution
For an endpoint-fixed variation $\eta=\delta x$,
$$
\delta S=\int_0^T(\dot x\dot\eta-\omega^2x\eta)dt
=[\dot x\eta]_0^T-\int_0^T(\ddot x+\omega^2x)\eta\,dt.
$$
The boundary term vanishes. Thus every solution of the <harmonic oscillator equation> is stationary for this <action functional>. For $\sin\omega T\ne0$, the endpoint-matching solution is the linear combination
$$
x_c(t)=\frac{a\sin\omega(T-t)+b\sin\omega t}{\sin\omega T},
$$
which directly satisfies $x_c(0)=a$, $x_c(T)=b$ and $\ddot x_c=-\omega^2x_c$. This proves stationarity, rather than assuming the explicit path is a minimum.
On that path, $(x_c\dot x_c)'=\dot x_c^2-\omega^2x_c^2$, so <integration by parts> reduces the entire action to an endpoint term. The endpoint derivatives are
$$
\dot x_c(0)=\frac{\omega(b-a\cos\omega T)}{\sin\omega T},\qquad
\dot x_c(T)=\frac{\omega(b\cos\omega T-a)}{\sin\omega T}.
$$
Therefore the <fixed-endpoint harmonic-oscillator action> is
$$
\boxed{S[x_c]=\left[\frac12x_c\dot x_c\right]_0^T
=\frac{\omega}{2\sin\omega T}\bigl[(a^2+b^2)\cos\omega T-2ab\bigr].}
$$
The displayed formula assumes nonresonant endpoints. If $\omega\ne0$ and $\omega T=k\pi$, a solution exists only for $b=(-1)^ka$; then $x=a\cos\omega t+B\sin\omega t$ is a family and its action is zero. For $\omega=0$ the limiting stationary path is linear, with action $(b-a)^2/(2T)$.
Back to article page