Problem: I'm trying to find just the Fourier series of f(x) = 1 from 0 $\leq$ x $\leq$ $\pi$ using the exponential definition of the coefficients (f(x) = 0 from $-\pi \leq x < 0$). I'm running into a divide by $0$ problem.
So I know that: $$c_n=\frac{1}{2\pi}\int_{-\pi}^{\pi} f(x) e^{(-inx)} \,dx $$ $ f(x) = 1 $ and integral of $e^{-inx}$ is $\frac{-e^{-i*\pi*n}}{in}$
Integrating, I get $$\frac{1}{2\pi} (\frac{-e^{-i*\pi*n}}{in} + \frac{1}{in})$ = $\frac{1}{2\pi} (\frac{-(-1)^{-n}+1)}{in})$$
So this seems like it should be the formula for the $c_n$?
But I don't think it is. Because we have to take the sum $\sum_{n=-\infty}^{\infty} c_n e^{inx}$. But $c_0$ = $\infty$.
Also my understanding is that for Fourier Series, $\sum_{n=-\infty}^{\infty} c_n e^{inx} = f(x)$ for all $x$. But Wolfram Alpha shows that's not the case here. So what am I doing wrong?