  We study the partition function of two versions of the continuum directed
polymer in 1+1 dimension. In the full-space version, the polymer starts at the
origin and is free to move transversally in the reals, and in the half-space
version, the polymer starts at the origin but is reflected at the origin and
stays in the negative reals. The partition functions solves the stochastic heat
equation in full-space or half-space with mixed boundary condition at the
origin; or equivalently the free energy satisfies the Kardar-Parisi-Zhang
equation.
  We derive exact formulas for the Laplace transforms of the partition
functions. In the full-space this is expressed as a Fredholm determinant while
in the half-space this is expressed as a Fredholm Pfaffian. Taking long-time
asymptotics we show that the limiting free energy fluctuations scale with
exponent 1/3 and are given by the GUE and GSE Tracy-Widom distributions. These
formulas come from summing divergent moment generating functions, hence are not
mathematically justified.
  The primary purpose of this work is to present a mathematical perspective on
the polymer replica method which is used to derive these results. In contrast
to other replica method work, we do not appeal directly to the Bethe ansatz for
the Lieb-Liniger model but rather utilize nested contour integral formulas for
moments as well as their residue expansions.
