Laplace Method and Applications to Optimization Problems