Today in class we learned that when you have an improper integral like this one:
$$\int_{-\infty}^\infty {f(x)} \: dx$$
you must split it before you do the limits (like so):
$$\lim_{a \to \infty} \int_{-a}^n {f(x)} \: dx + \lim_{a \to \infty} \int_{n}^a {f(x)} \: dx$$
I asked if this would work:
$$\lim_{a \to \infty} \int_{-a}^a {f(x)} \: dx$$
And my teacher said it wouldn't work, but he wouldn't explain why. Why wouldn't that work? An example of a function that doesn't work would be especially nice.
The problem is that limiting to both infinities at the same time can overlook divergence.
However, the value: $\lim\limits_{a \to \infty} \int_{-a}^a f(x)\,dx$ (if it exists) is important enough to have a name: the principal value.
So why can't you just do the limit like this? Consider $\int_{-\infty}^\infty x\,dx$
Notice that $\int_0^\infty x\,dx$ diverges to $\infty$ and $\int_{-\infty}^0 x\,dx$ diverges to $-\infty$. So we get (from either side) that our integral diverges.
However, $\lim\limits_{a \to \infty} \int_{-a}^a x\,dx = \lim\limits_{a \to\infty} a^2/2 - (-a)^2/2 = \lim\limits_{a \to \infty} 0 = 0$.
So the principal value of $\int_{-\infty}^\infty x\,dx$ is zero while the integral itself diverges.
In general, IF an improper integral converges, you can be very sloppy and get the right answer. On the other hand, if it actually diverges, sloppiness can miss this!
As I tell my students: You must approach ONE side of EACH bad spot by itself. Then put your answer together.
Addendum: Suppose $\int_{-\infty}^c f(x)\,dx$ and $\int_c^\infty f(x)\,dx$ exist.
Then $\int_{-\infty}^\infty f(x)\,dx = \lim\limits_{a \to -\infty} \int_a^c f(x)\,dx + \lim\limits_{b \to \infty} \int_c^b f(x)\,dx = \lim\limits_{b \to \infty} \int_{-b}^c f(x)\,dx + \lim\limits_{b \to \infty} \int_c^b f(x)\,dx$
Now because those two limits exist, we can combine them. So we get...
$=\lim\limits_{b \to \infty} \int_{-b}^c f(x)\,dx + \int_c^b f(x)\,dx =\lim\limits_{b \to \infty} \int_{-b}^b f(x)\,dx$
...which is the principal value. So the improper integral and principal value match when the integral actually converges.