For small oscillations, the oscillation behaves like a spring, because the potential energy function can be approximated by a parabola at the equilibrium point. Now, the effective spring constant in these situations is equal to the second derivative of the potential energy function, and so the frequency w = sqrt(k/m), where k is the second derivative of the potential energy function. I'm confused by this. In particular, I don't understand when this actually works. For example, for a pendulum, the potential energy function is U(t) = mgL(1-cos(t)), where t is theta. In this case the effective spring constant is mgL, so w = sqrt(gL). Obviously this doesn't agree with the accepted formula (which is also for small angles only). So what's going on here?