The equations of motion for linear structures considered as continuous systems are generally non-homogeneous linear partial differential equations. Their solution is functions of time and spatial variables. The traditional analysis approach involves solving the eigenvalue problem. This yields the eigenvalues and eigenvectors, which can be used to construct the general solution of the differential equations. This approach has been widely used in mechanics and has proven effective in solving many engineering problems. In recent years, machine learning methods, particularly neural networks, have also been used to solve differential equations. These methods can learn the equation's solution directly from data without the need for explicit analytical expressions. This makes them particularly useful for complex problems that may need analytical solutions or for problems where obtaining analytical solutions takes time and effort. This paper compares the performance of these two approaches for a specific problem of the vibration of the Euler-Bernoulli beam on a Winkler-type elastic foundation subjected to a moving load. The machine learning approach learns the solution directly from data generated by solving the differential equation using a Neural Architecture Search (NAS) with Automatic Differentiation (AD) method (NASAD). The paper provides insights into the relative strengths and weaknesses of each method and highlights the potential of machine learning to solve complex problems with high accuracy and low computational sources.