When Lagrange wrote his masterpiece Mecanique Analytique, the foundations of analysis were not completely understood: to erect the great building of Analytical Mechanics upon solid foundations, the Piedmontese mathematician tried to lay the foundations of differential calculus in a purely algebraic way, using power series instead of functions, regardless about convergence and uniqueness issues. While this foundation was unsatisfactory as shown by Cauchy some decades later, it can shed light on how Lagrange considered the analytical objects (curves, energies, etc.) he dealt with in Mechanics. In this paper, we review these Lagrangian foundations of analysis, and we try to adopt its obvious modern counterpart, i.e., formal power series, to ex...