I derived equation of sum from the following problem,
$\int_{a}^{b}\sum_{n=0}^{\infty} cos^n(x)dx$.
Using the following definitions,
$cos(x)=\frac{e^{ix}+e^{-ix}}{2}$ and $(a+b)^n=\sum_{m=0}^{n}\binom {n}m a^{n-m}b^m$,
my solution to the above is,
$\sum_{n=0}^{\infty}\sum_{m=0}^{n} \binom {n}m (-i)\frac{e^{i(n-2m)}}{n-2m} $.
However, Mathematica cannot evaluate this summation because of singularities. Either my derivation is incorrect although steps are valid or I must add conditionals to this summation evaluation (if it is valid way to do). If my derivation is correct, how do I evaluate this summation,
Sum[Sum[-I*Binomial[n,m]*Exp[I*(n-2*m)/(n-2*m)),{m,0,n}],{n,0,100}]
Is there a way to avoid singularities? Like $n \neq 2m$
x
and easily summable. I would compute that and then integrate. $\endgroup$Sum[Cos[x]^n, {n, 0, \[Infinity]}, Assumptions -> x \[Element] Reals]
produces1/(1 - Cos[x])
. If $\cos(x)=\pm1$, the series diverges. $\endgroup$