Is the answer to $\int_{-2}^{2} \frac{(x^2+4)}{x} dx$ 0? My teacher is saying that the answer is 0, but some other sources online says the answer is "divergent". Which is it, and why is it the answer?
 A: This integral diverges ("does not exist" or "undefined" might be more appropriate). What is true however, is that 
$$
\int_{-2}^{-\epsilon} \frac{x^2+4}{x}dx+\int_\epsilon^{2} \frac{x^2+4}{x}dx=0
$$
for any $0<\epsilon\leq 2$.
A: There's a few interpretations. The most straightforward is to resort back to the definition of Riemann integrability (see Abbott, or any introductory real analysis textbook), in which we require $f:[a,b]\to\mathbb{R}$ to be bounded. With this criterion, we immediately see that $f$ cannot be (Riemann) integrable (where $f(x)=(x^2+4)/x$), since $f$ has a pole at $0$. Hence, via this definition of integrability, the integral "diverges", or more properly, just does not exist in the first place, as $f$ does not satisfy the requirements of the definition of integrability.
However, as Adam mentions, for any $\varepsilon$ such that $0<\varepsilon\leq2$, we have that the following holds:
$$\int_{-2}^{-\varepsilon}\frac{x^2+4}{x}dx+\int_\varepsilon^2\frac{x^2+4}{x}dx=0$$
Hence, the following limit holds as well:
$$\lim_{\varepsilon\to0^+}\int_{-2}^{-\varepsilon}\frac{x^2+4}{x}dx+\int_\varepsilon^2\frac{x^2+4}{x}dx=0$$
This follows from considering the symmetry of the integrand about $x=0$. This in some ways agrees with the intuitive idea of thinking about the "signed area under the curve" - since the enclosed area on the left is "the same" as the enclosed area on the right, with the opposite sign, the integral should vanish!
We call the value of the above limit (when it exists) the Cauchy principal value of the integral. It isn't really the value of the integral (at least with the usual Riemann integral definition), but it allows us to prescribe in an intuitive way what the value "should be".
So what is the answer? Formally, the integral doesn't exist by the definition of Riemann integrability. But we can still ascribe to the integral a value that at least makes sense in some way via the Cauchy principal value. Keep in mind that this is not really the value of the integral, but it agrees with intuition.
A: The integral is divergent this is because
$$ \int_{-2}^{2} \frac{(x^2+4)}{x} dx=\int_{-2}^2xdx+4\int_{-2}^2\frac1xdx $$
and the second integral has the primitive $\ln|x|$ which is undefined at $x=0$.
However, the principle value of the integral is $0$. In fact,
$$ P.V.\int_{-2}^{2} \frac{(x^2+4)}{x} dx=\lim_{\epsilon^+\to0}\bigg(\int_{-2}^{-\epsilon} \frac{(x^2+4)}{x} dx+\int_{\epsilon}^{2} \frac{(x^2+4)}{x} dx\bigg)=0.$$
