# a question about the sum of $e^{ikx}$

I have a simple question. Let $S = \sum\limits_{k = 1}^n {e^{ikx} }$ using the typical trick , we also have $S\left( {e^{ix} - 1} \right) = e^{i\left( {n + 1} \right)x} - e^{ix}$ and if $\left( {e^{ix} - 1} \right) \ne 0$ we divide by it and we have: $S=\left( {1 - e^{inx} } \right)\frac{{e^{ix} }} {{1 - e^{ix} }}$ And I see that this limit if n goes to infinity does not exist, but Wolfram|Alpha says that it converges. The problem clearly is in the factor $\left( {1 - e^{inx} } \right)$ it goes to 0 :S? or something

• You have a geometric series with common factor $e^{ix}$. You also (should!) know that $|e^{ix}|=1$; would you happen to remember how the geometric series behaves at the boundary of the region where it converges? – J. M. is a poor mathematician Nov 17 '11 at 1:47
• You are saying that $\mathop {\lim }\limits_{n \to \infty } e^{ixn} = 0$ ? =S!! – Susuk Nov 17 '11 at 1:54
• I haven't said anything about convergence (yet). What do you remember about the behavior of the geometric series at the boundary? – J. M. is a poor mathematician Nov 17 '11 at 1:59
• the geometric series converges iff the norm of the term is less than 1. – Susuk Nov 17 '11 at 2:07
• Yes. But since $|e^{ix}|=1$ for all $x\in \mathbb R$, then... – J. M. is a poor mathematician Nov 17 '11 at 2:09

When evaluating the sum, Wolfram Alpha makes the necessary assumptions so that the series converges. For example Sum[x^k, {k, 0, Infinity}] evaluates to $1/(1-x)$. It is not mentioned that this is only valid for $|x| < 1$, but that doesn't mean $1 + 2 + 2^2 \ldots = -1$

Similarly, Sum[Exp[i x k], {k, 1, Infinity}] evaluates to $-1 + 1/(1 - e^{ix})$ under the assumption that $|e^{ix}| < 1$ or $\mbox{Imag}(x)>0$. If you want Mathematica to output the conditions necessary for convergence, you need the GenerateConditions flag, like this:

Sum[Exp[i x k], {k, 1, Infinity}, GenerateConditions -> True]


Unfortunately this doesn't work in Alpha. In Mathematica it evaluates to: $$\mbox{ConditionalExpression} \left[-\frac{e^{i x}}{-1 + e^{i x}}, e^{\mbox{Re}[i x]} < 1 \ \ \&\& \ \ e^{i x} \ne 1 \right]$$ Since you didn't specify that $x$ must be real, it is assumed to be possibly complex. Alternatively, one can specify that $x$ is real with a statement like this:

Assuming[ Element[x, Reals], Sum[Exp[I k x], {k, 1, Infinity}] ]


As expected, this gives the error Sum::div: Sum does not converge..

So, why doesn't Mathematica give the convergence conditions by default? Probably just because it results in a simpler output. (If one is really interested in finding the analytic continuation of a function, the convergence conditions don't matter.)

Assuming $x$ is real, Wolfram is wrong.