If the frequency is constant, the solution is simply given by x = A cos ⁡ ⁡ ( ω ω t + ϕ ϕ ) . But if the frequency is allowed to vary slowly with time ω ω = ω ω ( t ) , or precisely, if the characteristic time scale for the frequency variation is much smaller than the time period of oscillation, i.e., | 1 ω ω d ω ω d t | ≪ ≪ ω ω , then it can be shown that E ¯ ¯ ω ω = constant , where E ¯ ¯ is the average energy averaged over an oscillation. Since the frequency is changing with time due to external action, conservation of energy no longer holds and the energy over a single oscillation is not constant. During an oscillation, the frequency changes (however slowly), so does its energy. Therefore, to describe the system, one defines the average energy per unit mass for a given potential V ( x ; ω ω ) as follows E ¯ ¯ = ∮ ∮ d t [ 1 2 ( x ˙ ˙ ) 2 + V ( x ( t ) ; ω ω ( t ) ) ] ∮ ∮ d t where the closed integral denotes that it is taken over a complete oscillation. Defined this way, it can be seen that the averaging is done, weighting each element of the orbit by the fraction of time that the pendulum spends in that element. For simple harmonic oscillator, it reduces to E ¯ ¯ = 1 2 A 2 ω ω 2 where both the amplitude and frequency are now functions of time.