Constructive variational methods for differential equations