Not sure where I've gone wrong in the following:
Consider the integral $$ \int_0^\infty e^{-2x}\:dx = \frac{1}{2} $$ Via some simple manipulation we find: \begin{align} \int_0^\infty e^{-2x}\:dx &= \int_0^\infty e^{-x} e^{-x} \:dx = \int_0^\infty e^{-x} \left[ \sum_{n = 0}^\infty (-1)^n\frac{x^n}{n!} \right] \:dx \\ &= \int_0^\infty \sum_{n = 0}^\infty \frac{(-1)^n}{n!} x^ne^{-x} = \sum_{n = 0}^\infty \frac{(-1)^n}{n!} \int_0^\infty x^ne^{-x} \:dx \\ &= \sum_{n = 0}^\infty \frac{(-1)^n}{n!} \Gamma(n + 1) = \sum_{n = 0}^\infty \frac{(-1)^n}{n!} n! = \sum_{n = 0}^\infty (-1)^n \end{align} And so, $$ \sum_{n = 0}^\infty (-1)^n = \frac{1}{2} $$ This is the famous Grandi's Series which is divergent.
My question: Where have I gone wrong here? What rule/axiom/etc have I violated in my work in achieving this 'result'?
This is a great question and illustrates the subtleties in manipulating infinite sums. This interchange of limit and integration has violated Fubini's/Tonelli's theorem [Link] . In particular
$$ \sum_{n=0}^\infty |(-1)^n| = \sum_{n=0}^\infty 1 $$
is divergent, as is
$$ \int_0^\infty \sum_{n=0}^\infty\left|\frac{1}{n!}x^ne^{-x}\right|\,dx = \int_0^\infty \sum_{n=0}^\infty\frac{1}{n!}x^ne^{-x}\,dx $$ Therefore we cannot apply Fubini's/Tonelli's and would need to find some other justification of the interchange. Since we have proved that a divergent series converges, we will not be able to find a theorem justifiying the interchange.