  We study bosons in a one-dimensional hard-wall box potential. In the case of
contact interaction, the system is exactly solvable by the Bethe ansatz, as
first shown by Gaudin in 1971. Although contained in the exact solution, the
boundary energy in the thermodynamic limit for this problem is only
approximately calculated by Gaudin, who found the leading order result at weak
repulsion. Here we derive an exact integral equation that enables one to
calculate the boundary energy in the thermodynamic limit at an arbitrary
interaction. We then solve such an equation and find the asymptotic results for
the boundary energy at weak and strong interactions. The analytical results
obtained from the Bethe ansatz are in agreement with the ones found by other
complementary methods, including quantum Monte Carlo simulations. We study the
universality of the boundary energy in the regime of a small gas parameter by
making a comparison with the exact solution for the hard rod gas.
