Variational approach to various nonlinear problems in geometry and physics