# Finding the Fourier series of a sum

I have recently started to learn about Fourier series, which have been defined by the complex exponential. So a Fourier series is on the form: $$\sum_{n=-\infty}^{\infty} c_ne^{inx}$$

Where the Fourier coefficient $$c_n$$ is defined as: $$c_n = \frac{1}{2\pi} \int_{-\pi}^{\pi}f(y)e^{-iny}dy$$

If I am suppose to find the Fourier series of the sum:

$$\sum_{n=0}^{\infty}\frac {\cos(nx)}{n!}$$

how am I suppose to do it with this definition? Hope somebody can give a hint or explain a method to find the Fourier series.

Remember that $e^{it} = \cos(t)+i\sin(t)$.

We have, for $n\in\mathbb{Z}\setminus\{0\}$, \begin{equation*} \begin{split} 2\pi c_n & =\int_{-\pi}^{\pi} \sum_{k=0}^{\infty} \frac{\cos(ky)}{k!}e^{-iny}\, {\rm d}y \\ & = \sum_{k=0}^{\infty} \frac{1}{k!} \int_{-\pi}^{\pi} \cos(ky)e^{-iny} \, {\rm d}y \\ \end{split} \end{equation*}

But \begin{equation*} \begin{split} \int_{-\pi}^{\pi} \cos(ky)e^{-iny} \, {\rm d}y & = \int_{-\pi}^{\pi} \cos(ky)(\cos(-ny)+i\sin(-ny)) \, {\rm d}y \\ & = \int_{-\pi}^{\pi} \cos(ky)\cos(-ny) \, {\rm d}y + i\overbrace{\int_{-\pi}^{\pi} \cos(ky)\sin(-ny)\, {\rm d}y}^0 \\ & = \int_{-\pi}^{\pi} \cos(ky)\cos(-ny)\,{\rm d}y, \\ \end{split} \end{equation*} which is zero, if $k\ne|n|$, and $\pi$, otherwise.

Thus, $2\pi c_n = \frac{\pi}{|n|!}$ and therefore $c_n = \frac{1}{2(|n|!)}.$ (for $n\ne0$)

Edit: For the $c_0$ term, we have \begin{equation*} \begin{split} 2\pi c_0 & = \sum_{k=0}^{\infty}\frac{1}{k!} \int_{-\pi}^{\pi} \cos(ky) \, {\rm d}y \end{split} \end{equation*} and $\int_{-\pi}^{\pi} \cos(ky)\, {\rm d}y$ equals $2\pi$, if $k=0$, and $0$, otherwise. So $c_0 = 1$.

We conclude that the Fourier serie of $\sum_{k=0}^{\infty}\frac{\cos(ky)}{k!}$ is $$\frac12+\sum_{n=-\infty}^{\infty} \frac{e^{inx}}{2(|n|!)}.$$

Notice that $\frac{e^{i\cdot0\cdot x}}{2(0!)} = \frac12$. Then \begin{equation*} \begin{split} \sum_{n=-\infty}^{\infty} c_n e^{inx} & = c_0+\sum_{n\ne0} c_n e^{inx} \\ & = 1+\sum_{n\ne0}\frac{e^{inx}}{2(|n|!)} \\ & = \frac12 + \frac{e^{i\cdot0\cdot x}}{2(0!)}+ \sum_{n\ne0}\frac{e^{inx}}{2(|n|!)} \\ & = \frac12 + \sum_{n=-\infty}^{\infty}\frac{e^{inx}}{2(|n|!)}. \end{split} \end{equation*}

• So the Fourier series of this sum would be: $\frac {1}{2(|n|!} \cdot e^{inx}$ but what about the $c_0$ term, shouldn't that be included as well? – Mads Jeppesen May 7 '18 at 7:34
• @MadsJeppesen I've edited my answer, hope it helps. – Rodrigo Dias May 7 '18 at 9:14
• It helps a lot, thank you! Just a minor question: if $c_0 = 1$ how do you get $\frac {1}{2}$ and is it possible to perform the same computation, but instead of having $2\pi c_n = ...$ just do it with $c_n = \frac {1}{2\pi} ...$ – Mads Jeppesen May 7 '18 at 11:11
• @MadsJeppesen It's just a nice/tricky way to write it. See my last edit. – Rodrigo Dias May 7 '18 at 11:39
• Sorry, I have one last question: when you evaluate $\int_{-\pi}^{\pi}cos(ky)$ and say that is is equal to $2\pi$ if $k=0$ how is that true? Because when I take the integral of $cos(ky)$ i get $\frac{sin(ky)}{k}$ which is undefined when $k=0$ – Mads Jeppesen May 7 '18 at 16:48

Observe by definition, we have \begin{align} \cos(n x) = \frac{e^{inx}+e^{-inx}}{2} \end{align} then it follows \begin{align} \sum^\infty_{n=0}\frac{\cos(nx)}{n!} = \frac{1}{2}+\sum^\infty_{k=-\infty} \frac{e^{ikx}}{2(|k|!)}. \end{align}

• When you have that $$\sum^\infty_{n=0}\frac{\cos(nx)}{n!} = \frac{1}{2}+\sum^\infty_{k=-\infty} \frac{e^{ikx}}{2(|k|!)}$$ To you simply use that $cos(nx) = \frac {e^{inx}+e^{-inx}}{2}$, and if this is the case, then how do you get $\frac {1}{2}$ outside of the sum? – Mads Jeppesen May 7 '18 at 7:31