## 515 – Plotting Féjer’s kernels

Féjer’s kernels are the functions that play the role of “approximations to the Dirac delta” in the computations we will use to obtain Weierstrass approximation theorem. The $n$th approximation is given by $\displaystyle K_n(s)= \frac1{n+1}\left(\frac{\sin\frac{(n+1)s}2}{\sin\frac s2}\right)^2$ for $s\ne0$, $K_n(0)=n+1$.

I preemptively apologize for the roughness of my code. Using the following program in Sage gives the diagram shown below, displaying the kernels $K_0,K_1,K_2,K_4,K_8,K_{15},K_N$ for $N=100.$ Additional details can be made more prominent by varying the size of the parameter ${\tt eps}$, or by using additional features of the ${\tt plot}$ function. In this example, ${\tt eps}=\pi$. To extend the graph to all values of $s$, simply reflect about the line $s=\pi$, and extend periodically with period $2\pi$. ${\tt var('s')}$ ${\tt N=100}$ ${\tt eps=pi}$ ${\tt def\ K(n,s):}$ $\hspace{1in}$ ${\tt return\ (sin((n+1)*s/2)/sin(s/2))^2/(n+1)}$ ${\tt P0=plot(K(0,s),\ -eps,\ eps,\ color='red')}$ ${\tt P1=plot(K(1,s),\ -eps,\ eps,\ color='brown')}$ ${\tt P2=plot(K(2,s),\ -eps,\ eps,\ color='blue')}$ ${\tt P4=plot(K(4,s),\ -eps,\ eps,\ color='black')}$ ${\tt P8=plot(K(8,s),\ -eps,\ eps,\ color='purple')}$ ${\tt P15=plot(K(15,s),\ -eps,\ eps,\ color='orange')}$ ${\tt pN=plot(K(N,s),\ -eps,\ eps,\ color='cyan')}$ ${\tt P=P0+P1+P2+P4+P8+P15+pN}$ ${\tt P}$

Here is the corresponding outcome (click to enlarge): 