This paper investigates the dynamic response of a clamped-clamped non-uniform Bernoulli-Euler beam resting on a Pasternak elastic foundation to variable magnitude moving distributed masses. The predicament is dictated by a partial differential equation of fourth order, which features coefficients that are both variable and singular. The primary aim is to derive an analytical solution for this category of a dynamic problem. To achieve this, we employ the method of Galerkin with a series representation of the Heaviside function to reduce the equation to second-order ordinary differential equations with variable coefficients. We simplify these transformed equations using (i) the Laplace transformation technique in conjunction with convolution theory for solving moving force problems, and (ii) finite element analysis in conjunction with the Newmark method for solving analytically unsolvable moving mass problems due to their harmonic nature. We first solve the moving force problem using the finite element method and compare it against analytical solutions as validation for its accuracy in solving analytically unsolvable moving mass problems. The numerical solution obtained from the finite element method is shown to be comparable favorably against analytical solutions of our moving force problem. Lastly, we calculate displacement response curves for both moving distributed force and mass models at various time t for our dynamical problem presentation purposes.