the general solution is given by x(t) = Acos(ωt) + Bsin(ωt). Express the total energy in terms of A and B and notice how it is independent of time.(adsbygoogle = window.adsbygoogle || []).push({});

my book derives a formula earlier which says [tex]\frac{\partial{S_{cl}}}{\partial{t_f}} = -E[/tex] where [tex]S_{cl}[/tex] is the classical path defined by [tex]S_{cl} = \int L dt [/tex] where L is the lagrangian.

i know that the lagrangian for a harmonic oscillator is L = [tex]\frac{1}{2}m\dot{x}^2-\frac{1}{2}kx^2[/tex]

so i tried [tex]\frac{\partial{S}}{\partial{t}}[/tex] = [tex] \int (\frac{\partial{L}}{\partial{x}} \dot{x} dt + \frac{\partial{L}}{\partial{\dot{x}}}\frac{d\dot{x}}{dt} dt)[/tex]

and i have [tex]\dot{x} = -A\omega\sin(\omega t)+B\omega\cos(\omega t) [/tex] as well as [tex]\ddot{x} = -A\omega^2\cos(\omega t)-B\omega^2\sin(\omega t) [/tex]

so after substituting and taking the antiderivative, i get something very messy:

[tex]\frac{1}{2}(ma^2\omega^2 + kB^2\omega^3)(t - \frac{1}{2\omega}\sin{2\omega t})+\frac{1}{2}(mB^2\omega^2 + kA^2\omega^3)(t+\frac{1}{2\omega}\sin{2\omega t}) - \frac{1}{2\omega}(kAB\omega^3 - mAB\omega^2)\cos{2\omega t}[/tex]

i am supposed to get something only in terms of A and B but it seems like it will since nothing really cancels out. did i make a mistake? help on this will be greatly appreciated.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Calculating the energy of a harmonic oscillator

**Physics Forums | Science Articles, Homework Help, Discussion**