# Complex Fourier series calculations

Consider a function $f:\mathbb{R}\rightarrow\mathbb{C}$. Recall  $f$ is periodic (with period  $1$) iff  $\forall x$$f(x+1)=f(x)$. For example,  $e_{k}=e_{k}(x)=e^{2\pi ikx}$ is periodic:

$e_{k}\left(x+1\right)=e^{2\pi ikx}e^{2\pi ik}=e^{2\pi ikx}\cdot1=e_{k}\left(x\right)$

recalling that $e^{iy}=\cos y+i\sin y$ for $y\in\mathbb{R}$. Assume  $f$ is periodic and continuous. Define, for  $k\in\mathbb{Z}$,

${\displaystyle c_{k}=c_{k}(f)=\int_{0}^{1}f(x)\overline{e_{k}}dx=\int_{0}^{1}f(x)e^{-2\pi ikx}dx}$

The $c_{k}$ are called the Fourier coefficients of  $f$, while the Fourier series is

${\displaystyle \sum_{k=-\infty}^{\infty}c_{k}e_{k}}$

Let’s try an example. Take $f\left(x\right)=x$. Of course, this isn’t periodic. However implicity it is meant that $\left.f\right|_{\left[0,1\right]}\left(x\right)=x$, and $f$ is the periodic extension of this mapping, i.e. $\left.f\right|_{[1,2]}=x-1$$\left.f\right|_{[-1,0]}=x+1$, etc. For $k\neq0$,

$\begin{array}{ccc} c_{k} & = & {\displaystyle \int_{0}^{1}xe^{-2\pi ikx}}\\ \\ & = & {\displaystyle \int_{0}^{1}x\left(\cos\left(2\pi kx\right)-i\sin\left(2\pi kx\right)\right)}\\ \\ & = & {\displaystyle \int_{0}^{1}x\cos\left(2\pi kx\right)-i\int_{0}^{1}x\sin\left(2\pi kx\right)}\end{array}$

Evaluating these (real) integrals individually, it is found that

${\displaystyle c_{k}=0-i\left(-\frac{1}{2\pi k}\right)=\frac{i}{2\pi k}}$

Also $c_{0}=\int_{0}^{1}x=1/2$. Hence the Fourier series of $f$ is

${\displaystyle \sum_{k=-\infty}^{\infty}\frac{i}{2\pi k}e^{2\pi ikx}}$

implicitly having the $c_{0}$-th term to be $1/2$, not $i/\left(2\pi\cdot0\right)$. However, immediately this a bit difficult to deal with, say if pointwise convergence were in question!

To deal with this, we derive an equivalent representation of the Fourier series. Notice that in general,

${\displaystyle \sum_{k=-n}^{n}c_{k}e_{k}=c_{0}+\sum_{k=1}^{n}(c_{-k}e_{-k}+c_{k}e_{k})}$

Continuing, for $k\ne0$, $\overline{e_{k}}=e^{-2\pi kx}=e_{-k}$. Similarly,

$\begin{array}{ccc}c_{-k} & = & {\displaystyle \int_{0}^{1}f(x)e^{-2\pi i(-k)x}}\\ \\ & = & {\displaystyle \int_{0}^{1}f(x)e_{k}}\\ \\ & = & {\displaystyle \int_{0}^{1}f(x)\cos\left(2\pi kx\right)+i\int_{0}^{1}f(x)\sin\left(2\pi kx\right)}\end{array}$

The same work shows

${\displaystyle c_{k}=\int_{0}^{1}f(x)\cos\left(2\pi kx\right)-i\int_{0}^{1}f(x)\sin\left(2\pi kx\right)}$

It is then immediate that  $c_{-k}=\overline{c_{k}}$. Hence

$c_{-k}e_{-k}+c_{k}e_{k}=\overline{c_{k}e_{k}}+c_{k}e_{k}=2\mathrm{Re}(c_{k}e_{k})$

recalling that  $\forall z\in\mathbb{C}$, $\overline{z}+z=2\mathrm{Re}(z)$. Consequently the equivalent expression

${\displaystyle c_{0}+\sum_{k=-n}^{n}2\mathrm{Re}(c_{k}e_{k})}$

for the partials sums is obtained, thereby obtaining the equivalent expression

${\displaystyle c_{0}+\sum_{k=1}^{\infty}2\mathrm{Re}(c_{k}e_{k})}$

for the Fourier series of $f$. This is much easier to work with for calculations. For example the recently calculated Fourier series can now be written as

${\displaystyle \sum_{k=1}^{\infty}2\mathrm{Re}\left(\frac{1}{2\pi k}\left(i\cos\left(2\pi kx\right)+i^{2}\sin\left(2\pi kx\right)\right)\right)=\sum_{k=1}^{\infty}-\frac{1}{\pi k}\sin\left(2\pi kx\right)}$

Since $1/k\rightarrow0$ and are decreasing, for pointwise convergence it is sufficient to show that

${\displaystyle \sum_{k=1}^{n}\sin\left(2\pi kx\right)}$

are bounded. But this is true, and a common proof is due to Dirichlet (e.g. as explained in this post–easier to show $\sum_{k=1}^{n}\sin\left(ky\right)$ is bounded and substitute $y=2\pi x$). But more than pointwise convergence is true: Uniform convergence of the Fourier series of $f\left(x\right)=x$ is guaranteed, and in fact to $f$. This by a theorem since $f$ is continuous, periodic, and piecewise continuously differentiable.