  We formulate the path integral for Jackiw-Teitelboim gravity in the second
order formalism working directly with the metric and the dilaton. We consider
the theory both in Anti-de Sitter(AdS) and de Sitter space(dS) and analyze the
path integral for the disk topology and the "double trumpet" topology with two
boundaries. We also consider its behavior in the presence of conformal matter.
In the dS case the path integral evaluates the wavefunction of the universe
which arises in the no-boundary proposal. In the asymptotic AdS or dS limit
without matter we get agreement with the first order formalism. More generally,
away from this limit, the path integral is more complicated due to the presence
of modes from the gravity-dilaton sector and also matter sector with short
wavelengths along the boundary that are smaller than the AdS or dS scales. In
the double trumpet case, for both AdS and dS, we find that bosonic matter gives
rise to a diverging contribution in the moduli space integral rendering the
path integral ill-defined. The divergence occurs when the size of the wormhole
neck vanishes and is related to the Casimir effect. For fermions this
divergence can be avoided by imposing suitable boundary conditions. In this
case, in dS space the resulting path integral gives a finite contribution for
two disconnected universes to be produced by quantum tunneling.
