We study the fate of algebraic decay of correlations in a harmonically trapped two-dimensional degenerate Bose gas. The analysis is inspired by recent experiments on ultracold atoms where power-law correlations have been observed despite the presence of the external potential. We generalize the spin wave description of phase fluctuations to the trapped case and obtain an analytical expression for the one-body density matrix within this approximation. We show that algebraic decay of the central correlation function persists to lengths of about 20% of the Thomas-Fermi radius. We establish that the trap-averaged correlation function decays algebraically with a strictly larger exponent weakly changing with trap size and find indications that the recently observed enhanced scaling exponents receive significant contributions from the normal component of the gas. We discuss radial and angular correlations and propose a local correlation approximation which captures the correlations very well. Our analysis goes beyond the usual local density approximation and the developed summation techniques constitute a powerful tool to investigate correlations in inhomogeneous systems.PACS numbers: 05.70. Jk, 64.60.an, With the achievement of quantum degeneracy in ultracold atom gases a new experimental platform for studying fundamental questions related to phase transitions and critical phenomena has appeared. In particular, correlation functions can be measured through interference and time-of-flight techniques [1][2][3][4][5][6][7]. A crucial aspect of the experiments, however, consists in the absence of translation invariance due to the presence of the external trapping potential. Consequently, correlations between points r and r are not uniquely determined by the value of r − r . This effect should be unimportant for short-range correlations, and, in fact, thermodynamic properties of ultracold gases are often very well-captured by a local density approximation. The situation changes drastically for a system at a critical point, where the correlation length diverges and thus competes with the inhomogeneity of the trapping potential.Whereas the experimental preparation of critical systems typically requires a highly fine-tuned setup, they are rather effortlessly realized in two-dimensional (2D) systems whose low-energy excitations can be mapped onto an XY model. Examples apart from 2D ultracold quantum gases [8][9][10][11][12] are given by thin Helium films [13], layered magnets [14,15], and 2D excitonpolariton condensates [16]. To quantify correlations in these systems we introduce the one-body density matrix ρ(r, r ) = Φ † (r)Φ(r ) , whereΦ † (r) is the creation operator for a particle at point r. For the spatially homogeneous case we then have ρ hom (r, r ) = f (|r − r |) with some function f (r) due to translation and rotation invariance. The Mermin-Wagner-Hohenberg theorem [17,18] forbids long-range order at any finite temperature such that lim r→∞ f (r) = 0. However, in the XY model an ordered low-temperature phase with inf...