I am trying to calculate $c_m = \displaystyle{\int_0^1e^{-2\pi ixm} \sum_{n= -\infty}^\infty c_n e^{2\pi ixn} \, dx}$ for $m = 0$.
Here is my work:
$\displaystyle{\int_0^1e^{-2\pi ixm} \sum_{n= -\infty}^\infty c_n e^{2\pi ixn} \, dx = \int_0^1 \sum_{n = -\infty}^\infty c_n e^{-2\pi ixm} e^{2\pi ixn} \, dx = \sum_{n=-\infty}^\infty c_n \int_0^1 e^{-2\pi ixm} e^{2\pi ixn} \, dx}$
(I know that interchanging a sum and an integral is not always possible, but I am almost certain that through the Fubini-Tonelli Theorem it is justified here)
$\displaystyle{m = 0 \Rightarrow \sum_{n = -\infty}^\infty c_n \int_0^1 e^{0} e^{2\pi ixn} \, dx = \sum_{n = -\infty}^\infty c_n \int_0^1 e^{2\pi ixn} \, dx = \sum_{n = -\infty}^\infty c_n \frac{e^{2\pi ixn}}{2 \pi in} \biggr\rvert_0^1 = \sum_{n = -\infty}^\infty \frac{c_n}{2 \pi in} \left( e^{2 \pi in} - e^{0} \right) = \sum_{n = -\infty}^\infty \frac{c_n}{2 \pi in} \left( \left( \left( e^{\pi i} \right)^2 \right)^n - 1 \right) = \sum_{n = -\infty}^\infty \frac{c_n}{2 \pi in} \left( \left( \left( -1 \right)^2 \right)^n - 1 \right) = \sum_{n = -\infty}^\infty \frac{c_n}{2 \pi in} \left( \left( 1 \right)^n - 1 \right) = \sum_{n = -\infty}^\infty \frac{c_n}{2 \pi in} \left(1 - 1 \right) = 0}$
My source says that the answer is $\frac{1}{6}$. Where did I go wrong?
Edit: I feel like it's confusing that $m$ and $n$ look so alike, so I would like to reiterate: It is given that $m = 0$, not $n = 0$
You haven't actually told us what the function is other than it has a Fourier expansion $\sum c_ne^{2\pi inx}$, so there is no way for us to tell you how to get $c_0=\frac16$. But let's assume you can calculate the integrals $\int_0^1 e^{2\pi imx}f(x)\,\mathrm{d}x$ in some way.
You made a mistake with the integration of the $n=0$ term. Specifically, when $n=0$, you can't have "divide by $n$". Instead, $$ e^{2\pi ix0}=1\quad\forall x $$ so $$ \int_0^1 e^{2\pi ix0}\,\mathrm{d}x=1,\text{ not }\left.\dfrac{e^{2\pi i0x}-1}{2\pi i0}\right\rvert_0^1.$$