In this paper, a simulation method called the differential transform method (DTM) is employed to predict the vibration of an Euler-Bernoulli and Timoshenko beam (pipeline) resting on an elastic soil. The DTM is introduced briefly. DTM can easily be applied to linear or nonlinear problems and reduces the required computational effort. With this method exact solutions may be obtained without any need for cumbersome calculations and it is a useful tool for analytical and numerical solutions. To clarify and illustrate the features and capabilities of the presented method, various problems have been solved by using the technique and solutions have been compared with those obtained in the literature.