Find the range of the function \(f(x) = \frac{x^2 + 14x + 9}{x^2 + 2x + 3},\) as \(x\) varies over all real numbers.
The range of the function is [-3,2].