TITLE: Why is the Fejér Kernel always non-negative?
QUESTION [5 upvotes]: In one of the proofs in my notes the Fejér Kernel ($K_{n}$ below) is plucked out of an absolute value seemingly for free.  On the previous page it is remarked that this function is always non-negative.  I can't see why this would be automatic.  Why is this true?
We have $K_{n} = \sum\limits_{j=-n}^{n} D_{j}(t)$, where $D_{n} = \sum\limits_{j=-n}^{n}e^{ijt}$.
It is not automatic that $e^{ijt}$ is non-negative (or even real) for every value of $t\in [-\pi,\pi)$, $j\in\mathbb{Z}$.
This is what confuses me.

REPLY [5 votes]: Using the formula for the partial sum of a geometric series, the Dirichlet kernel is
$$
D_n(t)=\frac{e^{i(2n+1)t/2}-e^{-i(2n+1)t/2}}{e^{it/2}-e^{-it/2}}\tag{1}=\frac{\sin((2n+1)t/2)}{\sin(t/2)}
$$
We will sum the middle form, again using the formula for the partial sum of a geometric series, to get
$$\begin{align}
F_N(t)
&=\frac{1}{N}\sum_{n=0}^{N-1}D_n(t)\\
&=\frac{1}{N}\frac{e^{iNt}-2+e^{-iNt}}{(e^{it/2}-e^{-it/2})^2}\\
&=\frac{1}{2N}\frac{1-\cos(Nt)}{\sin^2(t/2)}\\
&=\frac{1}{N}\frac{\sin^2(Nt/2)}{\sin^2(t/2)}\tag{2}
\end{align}
$$
{"set_name": "stack_exchange", "score": 5, "question_id": 69324}