We study conformations of the Gaussian polymer chains in d-dimensional space in the presence of an external field with the harmonic potential. We apply a path integral approach to derive an explicit expression for the probability distribution function of the gyration radius. We calculate this function using Monte Carlo simulations and show that our numerical and theoretical results are in a good agreement for different values of the external field.