Why $ \int^{+\infty}_{-\infty} x \, dx \neq 0 $

This is a good question. My answers differ from the other answers because this deals very closely with convergence issues from higher mathematics.

It boils down to what it means for an improper integral to converge, in a sense. It is (almost always) the case that we say

$$ \int_{-\infty}^\infty f(x) \mathrm{d}x$$

converges iff

$$\lim_{a \to -\infty}\lim_{b \to \infty}\int_a^bf(x)\mathrm{d}x$$

converges, which is what Frank Lu says in his answer. You seem to want it to be defined as $$\lim_{a \to \infty}\int_{-a}^a f(x)\mathrm{d}x,$$

which happens to converge in the Cauchy Principal Value sense (in fact, that is the Cauchy Principal Value of this integral). Cauchy Principal Values are common in higher math, especially in complex analysis and residue calculus..

You might ask Why don't we define improper integration to align with Cauchy Principal Values? That is also a good question, and I think it depends on what you one wants from their integrals. A big problem with Cauchy Principal Values is that they are very dependent on coordinates. If you "shifted the center" to be $1$ instead of $0$, you would get a different answer for the integral (it would diverge), i.e.

$$\lim_{a \to \infty} \int_{1-a}^{1+a}f(x)\mathrm{d}x \neq \lim_{a \to \infty}\int_{-a}^a f(x)\mathrm{d}x,$$

which violates our intuitive understanding of integrals and our desire to have well-defined answers. Cauchy Principal Values depart from Riemann sums - so getting this "extra convergence" has a price. Conversely, we demand stricter convergence from Riemann (or Lebesgue) integrals to have them better line up with our intuition. (Usually! Sometimes, CPVs are very useful!)


Is your stance that $\infty+(-\infty)=0$? That kind of thinking would be problematic. Presumably, $1+\infty=\infty$. So then you would have $1+\infty+(-\infty)=0$, which I guess would make $1=0$.


Remember, $\infty$ is not a number. So it makes no sense to have something that is not a number in the upper and lower limits of the integral. So how do we avoid this issue? Well, that's the entire idea of Calculus (making infinitesimals something we can work with)

So what is the idea of Calculus? Well, we look at limits. So though $\infty$ is not a number, we can look at what happens when this integral has upper and lower limits that approach infinity. So what we want is this $$ \lim_{b \to \infty} \int_{-b}^b x \; dx $$ Well, the integral is easy to calculate, it's $x^2/2+C$, now we evaluate it using the upper and lower limits, $$ \frac{b^2}{2}-\frac{(-b)^2}{2}=0 $$ then we have $$ \lim_{b \to \infty} 0=0 $$ So in that sense the integral is $0$ (what we have done above is called the improper integral). However, one still needs to be careful when talking about infinities. Why? Well, isn't original integral the same as... $$ \int_{-\infty}^\infty x\;dx= \int_{-\infty}^bx\;dx + \int_{b}^\infty x\;dx $$ where $b$ is any real number. Notice neither of those integrals on the right converge, so neither can the integral on the left converge! Because on the right we have infinities. If we 'forced' those to converge, many of the properties of the reals could be forced to break down. So we just contradicted the fact that the integral converges!

What's the lesson here? It's that one can just throw around infinities without being clear what is mean. Infinity is not a number, it's a limit. When we treat it like a number, 'bad' things happen. As you can see, it's not enough to say that the 'areas' cancel out. That's an intuitive way to think about things. But remember, the integral is a concept independent of areas. It's something much bigger. So the interpretation may work in one direction, that is an integral can represent an area, but not the other way around. Especially not when dealing with infinite areas, because what would that even mean!? This is what makes talking about anything involving infinities difficult and why we often use limits instead, where one can be very clear about what one means when one says things like 'infinity' (often referring to a limit of some sort, and limits have a rigorous definition). This may be tedious, but it makes things clear and is why Mathematics can be so interesting. All of this you will cover in a Real Analysis course, as your professor said. This gives you something to look forward to!