A semiempirical method is proposed to describe the polarizability function for diatomic homonuclear molecules taking into account exchange interatomic interactions. The exchange interactions are described in the analytical form within the framework of the asymptotic method. The polarizability functions are represented in the form of piecewise-continuous functions, which have a physically true behavior at small and large internuclear separations and describe correctly the polarizability near the equilibrium position of molecular nuclei. The polarizability functions for the N2 and O2 molecules are calculated in the internuclear separation range from 0 to infinity.