Functional and Variational Methods