Lagrange’s theory of analytical functions and his ideal of purity of method