  We diagonalize the second-quantized Hamiltonian of a one-dimensional Bose gas
with a nonpoint repulsive interatomic potential and zero boundary conditions.
At weak coupling the solutions for the ground-state energy $E_{0}$ and the
dispersion law $E(k)$ coincide with the Bogoliubov solutions for a periodic
system. In this case, the single-particle density matrix $F_{1}(x,x^{\prime})$
at $T=0$ is close to the solution for a periodic system and, at $T>0$, is
significantly different from it. We also obtain that the wave function $\langle
\hat{\psi}(x,t) \rangle$ of the effective condensate is close to a constant
$\sqrt{N_{0}/L}$ inside the system and vanishes on the boundaries (here,
$N_{0}$ is the number of atoms in the effective condensate, and $L$ is the size
of the system). We find the criterion of applicability of the method, according
to which the method works for a finite system at very low temperature and with
a weak coupling (a weak interaction or a large concentration).
