An analytical approach to the dynamics of rotating shafts