Why am I getting 2 different answers for Integral exp(ix) from 0 to Infinity Hi I was trying to solve this integral:
$\int_{0}^{\infty}e^{ix}dx$
When I integrate it normally and apply limits, I get an undefined answer as $e^{\infty}=\infty$
But if I take $i$ as $-\frac{1}{i}$, I get:
$\int_{0}^{\infty}e^{-\frac{1}{i}x}dx= \frac{1}{i}[e^{-\frac{1}{i}x}]_0^\infty = \frac{1}{i}[0-1]=i$
So, which one is the right answer ?
 A: If I am not mistaken, this integral does not converge.
\begin{align}
e^{ix}=i\sin(x)+\cos(x)
\end{align}
Starting here,
$$
\int_0^\infty e^{ix}\mathrm{d}x=\int_0^\infty (i\sin(x)+\cos(x))\mathrm{d}x.
$$
$$
\int_0^\infty e^{ix}\mathrm{d}x=\lim_{t\rightarrow\infty}\int_0^t (i\sin(x)+\cos(x))\mathrm{d}x.
$$
Both the real and imaginary limits do not exist. Therefore this integral does not converge.
I hope this helps.
PS: $\int_{-\infty}^\infty e^{ix}\mathrm{d}x$ can be computed as 0, but it still does not converge. I double checked from here.
A: The integral does not converge, the problem with your second approach (and also the first one in retrospective) is the simplification at the end when writing
$$
\frac{1}{i}\big[e^{-x/i}\big]_0^\infty = \frac{1}{i}[0 - 1]
$$
You have to be more careful, when evaluating at infinity when complex numbers are involved.
Using the definition of improper integral (to evaluate at "$\infty$") and the Euler identity to expand $e^{ix}$:
$$
\lim_{x\to\infty} e^{-x/i} = \lim_{x\to\infty} e^{ix} = \lim_{x\to\infty} \big( \cos(x) + i\cdot\sin(x)\big)
$$
and both the real and complex part of the limit diverges.
This show that $e^{ix} \not\to \infty$ as in fact the norm of $e^{ix}$ is always 1, i.e. $|e^{ix}| = 1$.
