Physlib

Physlib.ClassicalMechanics.HarmonicOscillator.Basic

The Classical Harmonic Oscillator

i. Overview

The classical harmonic oscillator is a classical mechanical system corresponding to a mass `m` under a force `- k x` where `k` is the spring constant and `x` is the position.

In this file, a coordinate system is assumed where position and velocity both have type `EuclideanSpace ℝ (Fin 1)`. This is a simpler model often used for pedagogical purpose, but only works because both the configuration space (position) and its tangent space (velocity) are isomorphic to Euclidean Space. A proper formalisation should include the geometric properties of the state space via manifolds and tangent bundles.

ii. Key results

The key results in the study of the classical harmonic oscillator are the follows:

In the `Basic` module: - `HarmonicOscillator` contains the input data to the problem. - `EquationOfMotion` defines the equation of motion for the harmonic oscillator. - `energy_conservation_of_equationOfMotion` proves that a trajectory satisfying the equation of motion conserves energy. - `equationOfMotion_tfae` proves that the equation of motion of motion is equivalent to - Newton's second law, - Hamilton's equations, - the variational principal for the action, - the Hamilton variation principal.

In the `Solution` module: - `InitialConditions` is a structure for the initial conditions for the harmonic oscillator. - `trajectories` is the trajectories to the harmonic oscillator for given initial conditions. - `trajectories_equationOfMotion` proves that the solution satisfies the equation of motion.

iii. Table of contents

- A. The input data - B. The angular frequency - C. The energies - C.1. The definitions of the energies - C.2. Simple equalities for the energies - C.3. Differentiability of the energies - C.4. Time derivatives of the energies - D. Lagrangian and the equation of motion - D.1. The Lagrangian - D.1.1. Equalities for the lagrangian - D.1.2. Smoothness of the lagrangian - D.1.3. Gradients of the lagrangian - D.2. The variational derivative of the action - D.2.1. Equality for the variational derivative - D.3. The equation of motion - D.3.1. Equation of motion if and only if variational-gradient of Lagrangian is zero - E. Newton's second law - E.1. The force - E.1.1. The force is equal to `- k x` - E.2. Variational derivative of lagrangian and force - E.3. Equation of motion if and only if Newton's second law - F. Energy conservation - F.1. Energy conservation in terms of time derivatives - F.2. Energy conservation in terms of constant energy - G. Hamiltonian formulation - G.1. The canonical momentum - G.1.1. Equality for the canonical momentum - G.2. The Hamiltonian - G.2.1. Equality for the Hamiltonian - G.2.2. Smoothness of the Hamiltonian - G.2.3. Gradients of the Hamiltonian - G.3. Relation between Hamiltonian and energy - G.4. Hamilton equation operator - G.5. Equation of motion if and only if Hamilton's equations - H. Equivalences between the different formulations of the equations of motion

iv. References

References for the classical harmonic oscillator include: - Landau & Lifshitz, Mechanics, page 58, section 21.

A. The input data

We start by defining a structure containing the input data of the harmonic oscillator, and proving basic properties thereof. The input data consists of the mass `m` of the particle and the spring constant `k`.

B. The angular frequency

From the input data, it is possible to define the angular frequency `ω` of the harmonic oscillator, as `√(k/m)`.

The angular frequency appears in the solutions to the equations of motion of the harmonic oscillator.

Here we both define and proof properties related to the angular frequency.

C. The energies

The harmonic oscillator has a kinetic energy determined by it's velocity and a potential energy determined by it's position. These combine to give the total energy of the harmonic oscillator.

Here we state and prove a number of properties of these energies.

C.1. The definitions of the energies

We define the three energies, it is these energies which will control the dynamics of the harmonic oscillator, through the lagrangian.

C.2. Simple equalities for the energies

C.3. Differentiability of the energies

On smooth trajectories the energies are differentiable.

C.4. Time derivatives of the energies

For a general smooth trajectory (which may not satisfy the equations of motion) we can compute the time derivatives of the energies.

D. Lagrangian and the equation of motion

We state the lagrangian, and derive from that the equation of motion for the harmonic oscillator.

D.1. The Lagrangian

We define the lagrangian of the harmonic oscillator, as a function of phase-space. It is given by

L(t,x,v):=12mv212kx2L(t, x, v) := \frac{1}{2} m ‖v‖^2 - \frac{1}{2} k ‖x‖^2

In theory this definition is the kinetic energy minus the potential energy, however to make the lagrangian a function on phase-space we reserve this result for a lemma.

#### D.1.1. Equalities for the lagrangian

Equalities for the lagrangian. We prove some simple equalities for the lagrangian, in particular that when applied to a trajectory it is the kinetic energy minus the potential energy.

#### D.1.2. Smoothness of the lagrangian

The lagrangian is smooth in all its arguments.

#### D.1.3. Gradients of the lagrangian

We now show results related to the gradients of the lagrangian with respect to the position and velocity.

D.2. The variational derivative of the action

We now write down the variational derivative for the harmonic oscillator, for a trajectory x(t)x(t) this is equal to

tL(t,x˙(t),q)qq=x(t)ddtL(t,v,x(t))vv=x˙(t)t\mapsto \left.\frac{\partial L(t, \dot x (t), q)}{\partial q}\right|_{q = x(t)} - \frac{d}{dt} \left.\frac{\partial L(t, v, x(t))}{\partial v}\right|_{v = \dot x (t)}

Setting this equal to zero corresponds to the Euler-Lagrange equations, and thereby the equation of motion.

#### D.2.1. Equality for the variational derivative

Basic equalities for the variational derivative of the action.

D.3. The equation of motion

The equation of motion for the harmonic oscillator is given by setting the variational derivative of the action equal to zero.

#### D.3.1. Equation of motion if and only if variational-gradient of Lagrangian is zero

We write a simple iff statement for the definition of the equation of motions.

E. Newton's second law

We define the force of the harmonic oscillator, and show that the equation of motion is equivalent to Newton's second law.

E.1. The force

We define the force of the harmonic oscillator as the negative gradient of the potential energy, and show that this is equal to `- k x`.

#### E.1.1. The force is equal to `- k x`

We now show that the force is equal to `- k x`.

E.2. Variational derivative of lagrangian and force

We relate the variational derivative of lagrangian to the force, and show the relation to Newton's second law.

E.3. Equation of motion if and only if Newton's second law

We show that the equation of motion is equivalent to Newton's second law.

F. Energy conservation

In this section we show that any trajectory satisfying the equation of motion conserves energy. This result simply follows from the definition of the energies, and their derivatives, as well as the statement that the equations of motion are equivalent to Newton's second law.

F.1. Energy conservation in terms of time derivatives

We prove that the time derivative of the energy is zero for any trajectory satisfying the equation of motion.

F.2. Energy conservation in terms of constant energy

We prove that the energy is constant for any trajectory satisfying the equation of motion.

G. Hamiltonian formulation

We now turn to the Hamiltonian formulation of the harmonic oscillator. We define the canonical momentum, the Hamiltonian, and show that the equations of motion are equivalent to Hamilton's equations.

G.1. The canonical momentum

We define the canonical momentum as the gradient of the lagrangian with respect to the velocity.

#### G.1.1. Equality for the canonical momentum

An simple equality for the canonical momentum.

G.2. The Hamiltonian

The hamiltonian is defined as a function of time, canonical momentum and position, as ``` H = ⟪p, v⟫ - L(t, x, v) ``` where `v` is a function of `p` and `x` through the canonical momentum.

#### G.2.1. Equality for the Hamiltonian

We prove a simple equality for the Hamiltonian, to help in computations.

#### G.2.2. Smoothness of the Hamiltonian

We show that the Hamiltonian is smooth in all its arguments.

#### G.2.3. Gradients of the Hamiltonian

We now write down the gradients of the Hamiltonian with respect to the momentum and position.

G.3. Relation between Hamiltonian and energy

We show that the Hamiltonian, when evaluated on any trajectory, is equal to the energy. This is independent of whether the trajectory satisfies the equations of motion or not.

G.4. Hamilton equation operator

We define the operator on momentum-position phase-space whose vanishing is equivalent to Hamilton's equations.

G.5. Equation of motion if and only if Hamilton's equations

We show that the equation of motion is equivalent to Hamilton's equations, that is to the vanishing of the Hamilton equation operator.

H. Equivalences between the different formulations of the equations of motion

We show that the following are equivalent statements for a smooth trajectory `xₜ`: - The equation of motion holds. (aka the Euler-Lagrange equations hold.) - Newton's second law holds. - Hamilton's equations hold. - The variational principle for the action holds. - The Hamilton variational principle holds.

49 declarations

theorem

k0k \neq 0

The spring constant kk of a classical harmonic oscillator is non-zero, that is, k0k \neq 0.

theorem

m0m \neq 0

The mass mm of a classical harmonic oscillator is non-zero, that is, m0m \neq 0.

definition

Angular frequency ω=k/m\omega = \sqrt{k/m}

For a classical harmonic oscillator with mass mm and spring constant kk, the angular frequency ω\omega is defined as the square root of the ratio of the spring constant to the mass: ω=km\omega = \sqrt{\frac{k}{m}}

theorem

ω>0\omega > 0

The angular frequency ω\omega of a classical harmonic oscillator is strictly positive, that is, ω>0\omega > 0.

theorem

ω2=km\omega^2 = \frac{k}{m}

For a classical harmonic oscillator with mass mm and spring constant kk, the square of the angular frequency ω\omega is equal to the ratio of the spring constant to the mass: ω2=km\omega^2 = \frac{k}{m}

theorem

ω0\omega \neq 0

For a classical harmonic oscillator, the angular frequency ω\omega is not equal to zero, i.e., ω0\omega \neq 0.

theorem

1ω2=mk\frac{1}{\omega^2} = \frac{m}{k}

For a classical harmonic oscillator with mass mm, spring constant kk, and angular frequency ω\omega, the inverse of the square of the angular frequency is equal to the ratio of the mass to the spring constant: 1ω2=mk\frac{1}{\omega^2} = \frac{m}{k}

definition

Kinetic energy T(t)=12mx˙(t)2T(t) = \frac{1}{2} m \|\dot{x}(t)\|^2

For a classical harmonic oscillator with mass mm, the kinetic energy of a trajectory x(t)x(t) in a 1-dimensional Euclidean space is a function of time tt defined by: 12mx˙(t),x˙(t)\frac{1}{2} m \langle \dot{x}(t), \dot{x}(t) \rangle where x˙(t)\dot{x}(t) denotes the time derivative of the position x(t)x(t) and ,\langle \cdot, \cdot \rangle is the real inner product. This is equivalent to the expression 12mx˙(t)2\frac{1}{2} m \|\dot{x}(t)\|^2.

definition

Potential energy V(x)=12kx,xV(x) = \frac{1}{2} k \langle x, x \rangle

The potential energy of a classical harmonic oscillator with spring constant kk at position xR1x \in \mathbb{R}^1 is defined as 12kx,x\frac{1}{2} k \langle x, x \rangle, where ,\langle \cdot, \cdot \rangle denotes the real inner product on the 1-dimensional Euclidean space.

definition

Total energy E(t)=T(t)+V(x(t))E(t) = T(t) + V(x(t))

For a classical harmonic oscillator SS and a trajectory x(t)x(t) in a 1-dimensional Euclidean space, the total energy E(t)E(t) at time tt is defined as the sum of the kinetic energy T(t)T(t) and the potential energy V(x(t))V(x(t)): E(t)=T(t)+V(x(t)) E(t) = T(t) + V(x(t)) where T(t)T(t) is the kinetic energy of the trajectory and V(x(t))V(x(t)) is the potential energy at position x(t)x(t).

theorem

Kinetic energy T(t)=12mx˙(t)2T(t) = \frac{1}{2} m \|\dot{x}(t)\|^2

For a classical harmonic oscillator with mass mm and a trajectory x(t)x(t) in a 1-dimensional Euclidean space, the kinetic energy at time tt is given by T(t)=12mx˙(t),x˙(t)T(t) = \frac{1}{2} m \langle \dot{x}(t), \dot{x}(t) \rangle where x˙(t)\dot{x}(t) denotes the time derivative of the position x(t)x(t) and ,\langle \cdot, \cdot \rangle represents the standard real inner product.

theorem

The potential energy V(x)V(x) is equal to 12kx,x\frac{1}{2} k \langle x, x \rangle

For a classical harmonic oscillator SS with spring constant kk, the potential energy at a position xR1x \in \mathbb{R}^1 is given by V(x)=12kx,xV(x) = \frac{1}{2} k \langle x, x \rangle, where ,\langle \cdot, \cdot \rangle denotes the standard real inner product on the 1-dimensional Euclidean space.

theorem

Total energy E(t)=T(t)+V(x(t))E(t) = T(t) + V(x(t))

For a classical harmonic oscillator SS and a trajectory x(t)x(t) in a 1-dimensional Euclidean space, the total energy E(t)E(t) at any time tt is the sum of the kinetic energy T(t)T(t) of the trajectory and the potential energy V(x(t))V(x(t)) at position x(t)x(t): E(t)=T(t)+V(x(t)) E(t) = T(t) + V(x(t))

theorem

Kinetic Energy T(t)T(t) is Differentiable for Smooth Trajectories x(t)x(t)

For a classical harmonic oscillator SS with mass mm, if a trajectory x(t)x(t) in 1-dimensional Euclidean space R1\mathbb{R}^1 is a smooth (CC^\infty) function of time, then the kinetic energy T(t)=12mx˙(t),x˙(t)T(t) = \frac{1}{2} m \langle \dot{x}(t), \dot{x}(t) \rangle is differentiable with respect to tt.

theorem

Potential Energy V(x(t))V(x(t)) is Differentiable for Smooth Trajectories x(t)x(t)

Consider a classical harmonic oscillator SS with spring constant kk. Let x(t)R1x(t) \in \mathbb{R}^1 be a smooth (CC^\infty) trajectory. Then the potential energy as a function of time, V(x(t))=12kx(t),x(t)V(x(t)) = \frac{1}{2} k \langle x(t), x(t) \rangle, is differentiable with respect to tt.

theorem

Total Energy E(t)E(t) is Differentiable for Smooth Trajectories x(t)x(t)

Consider a classical harmonic oscillator SS. Let x(t)x(t) be a trajectory in 1-dimensional Euclidean space that is a smooth (CC^\infty) function of time. Then the total energy E(t)E(t), defined as the sum of the kinetic energy and the potential energy, is differentiable with respect to time tt.

theorem

ddtT(t)=x˙(t),mx¨(t)\frac{d}{dt} T(t) = \langle \dot{x}(t), m \ddot{x}(t) \rangle for Harmonic Oscillator

Consider a classical harmonic oscillator SS with mass mm. Let x(t)x(t) be a smooth (CC^\infty) trajectory in 1-dimensional Euclidean space. Then the time derivative of the kinetic energy T(t)T(t) is given by: ddtT(t)=x˙(t),mx¨(t)\frac{d}{dt} T(t) = \langle \dot{x}(t), m \ddot{x}(t) \rangle where x˙(t)\dot{x}(t) is the velocity (the first time derivative of x(t)x(t)), x¨(t)\ddot{x}(t) is the acceleration (the second time derivative of x(t)x(t)), and ,\langle \cdot, \cdot \rangle denotes the real inner product.

theorem

Time Derivative of Potential Energy for a Harmonic Oscillator

Let SS be a classical harmonic oscillator with spring constant kk. For a smooth (CC^\infty) trajectory x(t)x(t) in 1-dimensional Euclidean space, the time derivative of the potential energy V(x(t))V(x(t)) is given by: ddtV(x(t))=x˙(t),kx(t) \frac{d}{dt} V(x(t)) = \langle \dot{x}(t), k x(t) \rangle where x˙(t)\dot{x}(t) denotes the time derivative of the position (velocity) at time tt, and ,\langle \cdot, \cdot \rangle represents the standard inner product on the 1-dimensional Euclidean space.

theorem

Time Derivative of Total Energy ddtE(t)=x˙(t),mx¨(t)+kx(t)\frac{d}{dt} E(t) = \langle \dot{x}(t), m \ddot{x}(t) + k x(t) \rangle for the Harmonic Oscillator

Consider a classical harmonic oscillator SS with mass mm and spring constant kk. For any smooth (CC^\infty) trajectory x(t)x(t) in 1-dimensional Euclidean space, the time derivative of the total energy E(t)E(t) is given by: ddtE(t)=x˙(t),mx¨(t)+kx(t)\frac{d}{dt} E(t) = \langle \dot{x}(t), m \ddot{x}(t) + k x(t) \rangle where x˙(t)\dot{x}(t) and x¨(t)\ddot{x}(t) denote the first and second time derivatives of the position x(t)x(t) (velocity and acceleration respectively), and ,\langle \cdot, \cdot \rangle represents the standard real inner product.

definition

Lagrangian of the harmonic oscillator L(t,x,v)L(t, x, v)

For a classical harmonic oscillator with mass mm and spring constant kk, the Lagrangian L(t,x,v)L(t, x, v) is a real-valued function of time tt, position xR1x \in \mathbb{R}^1, and velocity vR1v \in \mathbb{R}^1. It is defined as the difference between the kinetic energy and the potential energy: L(t,x,v)=12mv,v12kx,x L(t, x, v) = \frac{1}{2} m \langle v, v \rangle - \frac{1}{2} k \langle x, x \rangle where ,\langle \cdot, \cdot \rangle denotes the standard inner product on the 1-dimensional Euclidean space.

theorem

Lagrangian of the harmonic oscillator L(t,x,v)=12mv,v12kx,xL(t, x, v) = \frac{1}{2} m \langle v, v \rangle - \frac{1}{2} k \langle x, x \rangle

For a classical harmonic oscillator SS with mass mm and spring constant kk, the Lagrangian L(t,x,v)L(t, x, v) is the function of time tt, position xx, and velocity vv defined by: L(t,x,v)=12mv,v12kx,x L(t, x, v) = \frac{1}{2} m \langle v, v \rangle - \frac{1}{2} k \langle x, x \rangle where x,vR1x, v \in \mathbb{R}^1 and ,\langle \cdot, \cdot \rangle denotes the standard real inner product.

theorem

The Lagrangian of the Harmonic Oscillator is L=TVL = T - V

For a classical harmonic oscillator with mass mm and spring constant kk, let x(t)x(t) be a trajectory in 1-dimensional Euclidean space and x˙(t)\dot{x}(t) be its time derivative. At any time tt, the Lagrangian LL evaluated at position x(t)x(t) and velocity x˙(t)\dot{x}(t) is equal to the kinetic energy TT of the trajectory minus the potential energy VV of the position: L(t,x(t),x˙(t))=T(t)V(x(t))L(t, x(t), \dot{x}(t)) = T(t) - V(x(t))

theorem

The Lagrangian of the harmonic oscillator is CC^\infty

For any nN{}n \in \mathbb{N} \cup \{\infty\}, the Lagrangian L(t,x,v)L(t, x, v) of the classical harmonic oscillator is nn-times continuously differentiable (CnC^n) with respect to its arguments: time tTimet \in \text{Time}, position xR1x \in \mathbb{R}^1, and velocity vR1v \in \mathbb{R}^1. This implies that the Lagrangian is a smooth (CC^\infty) function of (t,x,v)(t, x, v).

theorem

The inverse Riesz representation of x,\langle x, \cdot \rangle is xx

In the 1-dimensional real Euclidean space R1\mathbb{R}^1 equipped with the standard inner product ,\langle \cdot, \cdot \rangle, let Φ:R1(R1)\Phi: \mathbb{R}^1 \to (\mathbb{R}^1)^* be the Riesz representation isomorphism (the `toDual` map) which identifies a vector vv with the continuous linear functional wv,ww \mapsto \langle v, w \rangle. For any vector xR1x \in \mathbb{R}^1, let fxf_x be the continuous linear functional defined by fx(y)=x,yf_x(y) = \langle x, y \rangle. Then the inverse of the Riesz isomorphism applied to fxf_x returns the original vector xx: Φ1(fx)=x\Phi^{-1}(f_x) = x

theorem

The gradient of x,x\langle x, x \rangle is 2x2x

For any vector xx in the 1-dimensional real Euclidean space R1\mathbb{R}^1 (represented as `EuclideanSpace ℝ (Fin 1)`), the gradient of the function yy,yy \mapsto \langle y, y \rangle (the squared L2L_2 norm) evaluated at xx is equal to 2x2x.

theorem

(cx,x)=(2c)x\nabla (c \langle x, x \rangle) = (2c)x in 1D Euclidean Space

Let cc be a real constant and xx be a vector in the 1-dimensional real Euclidean space R1\mathbb{R}^1. The gradient of the function f(y)=cy,yf(y) = c \langle y, y \rangle evaluated at xx is equal to (2c)x(2c)x, where ,\langle \cdot, \cdot \rangle denotes the standard inner product on R1\mathbb{R}^1.

theorem

xL(t,x,v)=kx\nabla_x L(t, x, v) = -kx for the Harmonic Oscillator

For a classical harmonic oscillator with spring constant kk, let L(t,x,v)L(t, x, v) be the Lagrangian defined as the difference between kinetic and potential energy. For any time tt, position xR1x \in \mathbb{R}^1, and velocity vR1v \in \mathbb{R}^1, the gradient of the Lagrangian with respect to the position xx is equal to kx-kx: xL(t,x,v)=kx \nabla_x L(t, x, v) = -k x where R1\mathbb{R}^1 denotes the 1-dimensional real Euclidean space.

theorem

vL=mv\nabla_v L = m v for the Harmonic Oscillator

For a classical harmonic oscillator with mass mm and spring constant kk, the gradient of the Lagrangian L(t,x,v)=12mv,v12kx,xL(t, x, v) = \frac{1}{2} m \langle v, v \rangle - \frac{1}{2} k \langle x, x \rangle with respect to the velocity vv is equal to mvm v. Here, tt denotes time, xx denotes the position in 1-dimensional Euclidean space R1\mathbb{R}^1, and ,\langle \cdot, \cdot \rangle is the standard inner product.

definition

Variational gradient of the action δSδx\frac{\delta S}{\delta x} for a harmonic oscillator

Given a trajectory x:TimeR1x: \text{Time} \to \mathbb{R}^1, this definition computes the variational gradient of the action functional S[x]=L(t,x(t),x˙(t))dtS[x] = \int L(t, x(t), \dot{x}(t)) \, dt, where LL is the Lagrangian of the harmonic oscillator. This result is a function of time representing the Euler-Lagrange operator evaluated along the trajectory: tLxddt(Lx˙) t \mapsto \frac{\partial L}{\partial x} - \frac{d}{dt} \left( \frac{\partial L}{\partial \dot{x}} \right) where the derivatives of the Lagrangian are evaluated at position x(t)x(t) and velocity x˙(t)\dot{x}(t).

theorem

Variational Gradient of Action equals Euler-Lagrange Operator for Harmonic Oscillators

For a classical harmonic oscillator SS and a smooth (CC^\infty) trajectory x:TimeR1x: \text{Time} \to \mathbb{R}^1, the variational gradient of the action functional δSδx\frac{\delta S}{\delta x} is equal to the Euler-Lagrange operator applied to the Lagrangian LL of the harmonic oscillator. That is, δSδx(t)=Lx(t,x(t),x˙(t))ddt(Lx˙(t,x(t),x˙(t))) \frac{\delta S}{\delta x}(t) = \frac{\partial L}{\partial x}(t, x(t), \dot{x}(t)) - \frac{d}{dt} \left( \frac{\partial L}{\partial \dot{x}}(t, x(t), \dot{x}(t)) \right) where LL is the Lagrangian L(t,x,v)=12mv212kx2L(t, x, v) = \frac{1}{2} m \|v\|^2 - \frac{1}{2} k \|x\|^2, and x˙(t)\dot{x}(t) denotes the time derivative of the trajectory.

definition

Equation of motion δSδx=0\frac{\delta S}{\delta x} = 0 for a harmonic oscillator

For a trajectory x:TimeR1x: \text{Time} \to \mathbb{R}^1 of a classical harmonic oscillator, the property `EquationOfMotion` is satisfied if the variational gradient of the action (the Euler-Lagrange operator) is zero for all tt. This corresponds to the Euler-Lagrange equation: δSδx=Lxddt(Lx˙)=0 \frac{\delta S}{\delta x} = \frac{\partial L}{\partial x} - \frac{d}{dt} \left( \frac{\partial L}{\partial \dot{x}} \right) = 0 where LL is the Lagrangian of the harmonic oscillator, and the derivatives are evaluated along the trajectory x(t)x(t).

theorem

Equation of Motion     δSδx=0\iff \frac{\delta S}{\delta x} = 0 for a Harmonic Oscillator

For a classical harmonic oscillator SS and a trajectory x:TimeR1x: \text{Time} \to \mathbb{R}^1, the property that xx satisfies the equation of motion is equivalent to the condition that the variational gradient of the action δSδx\frac{\delta S}{\delta x} is identically zero for all tt. Here, the variational gradient (the Euler-Lagrange operator) is defined as: δSδx=Lxddt(Lx˙) \frac{\delta S}{\delta x} = \frac{\partial L}{\partial x} - \frac{d}{dt} \left( \frac{\partial L}{\partial \dot{x}} \right) where LL is the Lagrangian of the harmonic oscillator.

definition

Force F(x)=U(x)F(x) = -\nabla U(x) of a harmonic oscillator

For a classical harmonic oscillator SS, the force at a position xR1x \in \mathbb{R}^1 is defined as the negative gradient of the potential energy U(x)U(x), denoted as U(x)-\nabla U(x).

theorem

Force of a Harmonic Oscillator equals kx-k x

For a classical harmonic oscillator SS with spring constant kk, the force at a position xx in the 1-dimensional Euclidean space R1\mathbb{R}^1 is given by F(x)=kxF(x) = -k x.

theorem

δSδx=Fmx¨\frac{\delta S}{\delta x} = F - m \ddot{x} for the Harmonic Oscillator

For a classical harmonic oscillator SS with mass mm, and a smooth (CC^\infty) trajectory x:TimeR1x: \text{Time} \to \mathbb{R}^1, the variational gradient of the action δSδx\frac{\delta S}{\delta x} (also known as the Euler-Lagrange operator) at any time tt is equal to the force F(x(t))F(x(t)) minus the product of the mass mm and the second time derivative of the trajectory x¨(t)\ddot{x}(t): δSδx(t)=F(x(t))mx¨(t) \frac{\delta S}{\delta x}(t) = F(x(t)) - m \ddot{x}(t) where F(x)=kxF(x) = -kx is the restoring force of the oscillator and x¨(t)\ddot{x}(t) denotes the acceleration d2xdt2\frac{d^2 x}{dt^2}.

theorem

Equation of Motion     \iff Newton's Second Law for the Harmonic Oscillator

For a classical harmonic oscillator SS with mass mm, let x:TimeR1x: \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory. The trajectory satisfies the equation of motion (defined by the vanishing of the variational gradient of the action, or the Euler-Lagrange equation) if and only if it satisfies Newton's second law for all times tt: mx¨(t)=F(x(t)) m \ddot{x}(t) = F(x(t)) where x¨(t)\ddot{x}(t) is the second time derivative of the position and F(x(t))F(x(t)) is the force acting on the oscillator at position x(t)x(t).

theorem

Equation of Motion Implies ddtE(t)=0\frac{d}{dt} E(t) = 0 for the Harmonic Oscillator

For a classical harmonic oscillator SS, let x:TimeR1x: \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory. If x(t)x(t) satisfies the equation of motion for the system, then the time derivative of the total energy E(t)E(t) is zero for all tt: ddtE(t)=0\frac{d}{dt} E(t) = 0

theorem

Equation of Motion Implies E(t)=E(0)E(t) = E(0) for the Harmonic Oscillator

For a classical harmonic oscillator SS, let x:TimeR1x: \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory. If x(t)x(t) satisfies the equation of motion for the system, then for any time tt, the total energy E(t)E(t) is equal to the initial energy at time 00: E(t)=E(0) E(t) = E(0) where E(t)E(t) is the sum of the kinetic and potential energies of the oscillator at time tt.

definition

Linear equivalence between velocity vv and canonical momentum pp

Given a classical harmonic oscillator with mass mm, at a specific time tt and position xR1x \in \mathbb{R}^1, this definition establishes a linear isomorphism between the velocity space and the canonical momentum space (both modeled as R1\mathbb{R}^1). The mapping is defined by the gradient of the Lagrangian with respect to velocity, vvL(t,x,v)v \mapsto \nabla_v L(t, x, v), which for this system is p=mvp = m v. The inverse mapping is p1mpp \mapsto \frac{1}{m} p.

theorem

Canonical Momentum p=mvp = mv for the Harmonic Oscillator

For a classical harmonic oscillator with mass mm and spring constant kk, the canonical momentum pp at time tt and position xR1x \in \mathbb{R}^1 corresponding to a velocity vR1v \in \mathbb{R}^1 is given by the product of the mass and the velocity: p=mv p = mv where p,v,xR1p, v, x \in \mathbb{R}^1.

definition

Hamiltonian of the harmonic oscillator H(t,p,x)H(t, p, x)

For a classical harmonic oscillator with mass mm and spring constant kk, the Hamiltonian H(t,p,x)H(t, p, x) is a real-valued function of time tt, momentum pR1p \in \mathbb{R}^1, and position xR1x \in \mathbb{R}^1. It is defined via the Legendre transformation of the Lagrangian LL as: H(t,p,x)=p,vL(t,x,v) H(t, p, x) = \langle p, v \rangle - L(t, x, v) where ,\langle \cdot, \cdot \rangle denotes the standard inner product on the 1-dimensional Euclidean space, and the velocity vv is expressed as a function of momentum pp using the inverse of the canonical momentum mapping v=toCanonicalMomentum1(p)v = \text{toCanonicalMomentum}^{-1}(p).

theorem

H(t,p,x)=12mp,p+12kx,xH(t, p, x) = \frac{1}{2m} \langle p, p \rangle + \frac{1}{2} k \langle x, x \rangle

For a classical harmonic oscillator SS with mass mm and spring constant kk, the Hamiltonian HH as a function of time tt, momentum pp, and position xx is given by: H(t,p,x)=12mp,p+12kx,x H(t, p, x) = \frac{1}{2m} \langle p, p \rangle + \frac{1}{2} k \langle x, x \rangle where p,xR1p, x \in \mathbb{R}^1 and ,\langle \cdot, \cdot \rangle denotes the standard real inner product.

theorem

The Hamiltonian of the Harmonic Oscillator is CnC^n

For a classical harmonic oscillator SS, the Hamiltonian function H(t,p,x)H(t, p, x), considered as a function of time tt, momentum pp, and position xx, is nn-times continuously differentiable over R\mathbb{R} for any nN{}n \in \mathbb{N} \cup \{\infty\}.

theorem

xH=kx\nabla_x H = k x for the Harmonic Oscillator

For a classical harmonic oscillator with spring constant kk, the gradient of the Hamiltonian H(t,p,x)H(t, p, x) with respect to the position xx is equal to kxk x, where tt is the time and pp is the momentum. Here, xx and pp are vectors in the 1-dimensional real Euclidean space R1\mathbb{R}^1.

theorem

pH=1mp\nabla_p H = \frac{1}{m} p for the Harmonic Oscillator

For a classical harmonic oscillator with mass mm, the gradient of the Hamiltonian H(t,p,x)H(t, p, x) with respect to the momentum pp at a given time tt and position xR1x \in \mathbb{R}^1 is equal to the momentum divided by the mass: pH(t,p,x)=1mp \nabla_p H(t, p, x) = \frac{1}{m} p where pR1p \in \mathbb{R}^1 is the canonical momentum.

theorem

Hamiltonian Equals Total Energy for the Harmonic Oscillator

For a classical harmonic oscillator with mass mm and spring constant kk, and for any trajectory x(t)x(t) in a 1-dimensional Euclidean space R1\mathbb{R}^1, the Hamiltonian HH evaluated at time tt, position x(t)x(t), and the canonical momentum p(t)=mx˙(t)p(t) = m \dot{x}(t) is equal to the total energy E(t)E(t) of the system at that time. That is, H(t,p(t),x(t))=E(t) H(t, p(t), x(t)) = E(t) where p(t)p(t) is the canonical momentum corresponding to the velocity x˙(t)\dot{x}(t) and E(t)E(t) is the sum of the kinetic and potential energies.

definition

Hamilton equation operator for the harmonic oscillator

For a classical harmonic oscillator with Hamiltonian HH, the Hamilton equation operator maps a momentum trajectory p:TimeR1p: \text{Time} \to \mathbb{R}^1 and a position trajectory q:TimeR1q: \text{Time} \to \mathbb{R}^1 to a function of time tt defined by the pair: (q˙(t)pH(t,p(t),q(t)), p˙(t)qH(t,p(t),q(t))) \left( \dot{q}(t) - \nabla_p H(t, p(t), q(t)), \ -\dot{p}(t) - \nabla_q H(t, p(t), q(t)) \right) In this expression, q˙\dot{q} and p˙\dot{p} denote the time derivatives of the position and momentum trajectories, while pH\nabla_p H and qH\nabla_q H denote the gradients of the oscillator's Hamiltonian with respect to momentum and position, respectively. The vanishing of this operator for a given pair (p,q)(p, q) signifies that the trajectories satisfy the classical Hamilton's equations.

theorem

Equation of Motion     \iff Hamilton's Equations for the Harmonic Oscillator

For a classical harmonic oscillator SS, let x:TimeR1x: \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory. Let p(t)p(t) be the canonical momentum trajectory corresponding to the velocity x˙(t)\dot{x}(t) at position x(t)x(t), defined by p(t)=mx˙(t)p(t) = m \dot{x}(t). The trajectory xx satisfies the equation of motion (the Euler-Lagrange equation) if and only if the pair (p,x)(p, x) satisfies Hamilton's canonical equations, which is equivalent to the vanishing of the Hamilton equation operator: hamiltonEqOp(S,p,x)=0 \text{hamiltonEqOp}(S, p, x) = 0

theorem

Equivalence of Formulations of the Equations of Motion for the Harmonic Oscillator

For a classical harmonic oscillator SS with mass mm, let x:TimeR1x: \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory. The following statements are equivalent: 1. The trajectory xx satisfies the equation of motion (the Euler-Lagrange equation). 2. The trajectory xx satisfies Newton's second law for all tt: mx¨(t)=F(x(t))m \ddot{x}(t) = F(x(t)), where x¨\ddot{x} is the second time derivative of the position and FF is the force of the oscillator. 3. The phase-space trajectory (p,x)(p, x) satisfies Hamilton's equations (i.e., the Hamilton equation operator vanishes), where p(t)=mx˙(t)p(t) = m \dot{x}(t) is the canonical momentum. 4. The variational gradient of the action functional S[q]=L(t,q(t),q˙(t))dtS[q] = \int L(t, q(t), \dot{q}(t)) \, dt is zero at xx, where LL is the Lagrangian of the harmonic oscillator. 5. The variational gradient of the phase-space action functional S[p,q]=(p(t),q˙(t)H(t,p(t),q(t)))dtS[p, q] = \int \left( \langle p(t), \dot{q}(t) \rangle - H(t, p(t), q(t)) \right) dt is zero at the trajectory (p,x)(p, x), where HH is the Hamiltonian and ,\langle \cdot, \cdot \rangle is the standard inner product.