TITLE: Compute $\int_0^{\pi/2}\frac{\sin 2013x }{\sin x} \ dx\space$
QUESTION [9 upvotes]: How would you approach
$$\int_0^{\pi/2}\frac{\sin 2013x }{\sin x} \ dx\space?$$
The way I see here involves Dirichlet kernel. I wonder what else can we do, maybe some easy/elementary approaching ways. Thanks !

REPLY [4 votes]: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{\int_{0}^{\pi/2}{\sin\pars{2013 x} \over \sin\pars{x}}\,\dd x:\ {\large ?}}$

We'll consider $\ds{\pars{~\mbox{with}\ \color{#c00000}{\large n=\ {\tt 2013}}~}}$:
  \begin{align}
&\color{#c00000}{\int_{0}^{\pi/2}{\sin\pars{nx} \over \sin\pars{x}}\,\dd x}=
\half\int_{-\pi/2}^{\pi/2}{\sin\pars{nx} \over \sin\pars{x}}\,\dd x
=
\half\int_{0}^{\pi}{-\cos\pars{nx} \over -\cos\pars{x}}\,\dd x
=
{1 \over 4}\int_{-\pi}^{\pi}{\cos\pars{nx} \over \cos\pars{x}}\,\dd x
\\[3mm]&={1 \over 4}\Re
\oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}\verts{{\rm Arg}\pars{z}}\ <\ \pi}}
{z^{n} \over \pars{z^{2} + 1}/\pars{2z}}\,{\dd z \over \ic z}
\end{align}

$$
\color{#c00000}{\int_{0}^{\pi/2}{\sin\pars{nx} \over \sin\pars{x}}\,\dd x}
=\half\Im
\oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}\verts{{\rm Arg}\pars{z}}\ <\ \pi}}
{z^{n} \over z^{2} + 1}\,\dd z\tag{1}
$$

The only contribution to the integration arises from two 'small' semicircles around
  $\ds{\pm\ic}$:
  \begin{align}
&\color{#c00000}{\int_{0}^{\pi/2}{\sin\pars{nx} \over \sin\pars{x}}\,\dd x}
\\[3mm]&=\half\Im\lim_{\epsilon \to 0^{+}}\bracks{%
-\int_{2\pi}^{\pi}{\pars{\ic + \epsilon\expo{\ic\theta}}^{n} \over
\pars{\ic + \epsilon\expo{\ic\theta}}^{2} + 1}\,
\epsilon\expo{\ic\theta}\ic\,\dd\theta
-\int_{\pi}^{0}{\pars{-\ic + \epsilon\expo{\ic\theta}}^{n} \over
\pars{-\ic + \epsilon\expo{\ic\theta}}^{2} + 1}\,
\epsilon\expo{\ic\theta}\ic\,\dd\theta}
\\[3mm]&=\half\pars{{\pi \over 2} + {\pi \over 2}}.\qquad\qquad
\mbox{Note that}\quad \pars{\pm \ic}^{2013} = \pm\ic.
\end{align}

$$
\color{#00f}{\Large\int_{0}^{\pi/2}{\sin\pars{2013 x} \over \sin\pars{x}}\,\dd x
={\pi \over 2}}
$$