Dismiss Notice
Join Physics Forums Today!
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

  1. Aug 2, 2011 #1
    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.

    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.
  2. jcsd
  3. Aug 2, 2011 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    I don't think the units on some of your terms work out, so you apparently made a math error somewhere. Recheck your calculations.
  4. Aug 2, 2011 #3
    for harmonic oscillator V(x)=1/2kx^2

    try maximizing E= V(x)+kinetic energy

    KE = 1/2(m)(dx/dt)^2

    its a classical solution but i think it still applies
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook