What are the advantages of using calculus of variations