Substituting ω with ⁠ k / m ⁠, the kinetic energy K of the system at time t is K ( t ) = 1 2 m v 2 ( t ) = 1 2 m ω ω 2 A 2 sin 2 ⁡ ⁡ ( ω ω t − − φ φ ) = 1 2 k A 2 sin 2 ⁡ ⁡ ( ω ω t − − φ φ ) , and the potential energy is U ( t ) = 1 2 k x 2 ( t ) = 1 2 k A 2 cos 2 ⁡ ⁡ ( ω ω t − − φ φ ) . In the absence of friction and other energy loss, the total mechanical energy has a constant value E = K + U = 1 2 k A 2 .