We know that \int \frac{1}{x^2+a^2}dx = \frac{1}{a}tan^{-1}(\frac{x}{a})
In given question , the value of a is 3.
So we get \int_0^3 \frac{1}{x^2+3^2}dx = \frac{1}{3}tan^{-1}(\frac{x}{3}) = \frac{1}{3}(tan^{-1}(1) - tan^{-1}(0)) = \frac{1}{3}(\frac{\pi}{4}) = \frac{\pi}{12}