Fundamental Equations for Dynamic Analysis of Rod and Pipe String in Oil-Gas Wells and Application in Static Buckling Analysis