Hopf-Lax Formula for the Quadratic Hamiltonian