Solve the parabolic PDE $$ \pa_tu=\tfrac12\pa_\theta^2u,\quad \forall\theta\neq\pm\pi:\quad u(0,x)=1,\quad \forall t > 0:\quad u(t,\pm\pi)=0~. $$ by Fourier analysis methods.
The normalized eigen functions of $\tfrac12\pa_\theta^2$ on $(-\pi,\pi)$ satisfying the boundary condition $f(\pm\pi)=0$ are $$ f_n(\theta)\colon=\frac1{\sqrt{\pi}}\cos((n+\tfrac12)\theta), g_n(\theta)\colon=\frac1{\sqrt{\pi}}\sin(n\theta) \quad n=0,1,2,\ldots~. $$ Since the constant function is orthogonal to all $g_n$ and the eigen value for $f_n$ is $\l_n\colon=-\tfrac12(n+\tfrac12)^2$, we conclude that $$ u(t,\theta)=\sum_{n=0}^\infty c_nf_n(\theta)e^{\l_nt} \quad\mbox{where}\quad c_n=\frac1{\sqrt{\pi}}\int_{-\pi}^{\pi}f_n(\theta)\,d\theta =\frac{2(-1)^n}{\sqrt{\pi}(n+\frac12)}~. $$ Hence $$ u(t,\theta) =\frac2{\pi}\sum_{n=0}^\infty(-1)^n\frac{\cos((n+\tfrac12)\theta)}{n+\tfrac12} e^{-\frac12(n+\frac12)^2t}~. $$