Evaluate $\int_{-\pi}^{\pi}\frac {\sin nx}{(1+2^x) \sin x} $ 
Evaluate $$\int_{-\pi}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx \:\:\:  n \in  \mathbb{N}$$


$$\int_{-\pi}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx = \int_{0}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx + \int_{-\pi}^{0}\frac {\sin nx}{(1+2^x)\sin x}dx$$
Set $y = - x$ in the second integral.
$$\int_{-\pi}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx = \int_{0}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx + \int_{0}^{\pi}\frac {\sin ny}{(1+2^{-y})\sin y}dy$$
$$\int_{-\pi}^{\pi}\frac {\sin nx}{(1+2^x)\sin x}dx = \int_{0}^{\pi}\frac {(1+2^x)\sin nx}{(1+2^x)\sin x}dx = \int_{0}^{\pi}\frac {\sin nx}{\sin x}dx$$
Can anyone give me a hint on how i should continue?
Thanks.
 A: HINT: Use the property that $$I=\int_a^b f(x) dx =\int_a^b f(a+b-x) dx  $$
And then you will get that $$2I=\int_{-\pi}^\pi \frac{\sin nx}{\sin x}dx$$
P.S. You may have to use the property that  $\sin x$ is an odd function.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\left.\vphantom{\large A}I\,\right\vert_{\ n\ \in\ \mathbb{N}} & = \int_{0}^{\pi}{\sin\pars{nx} \over \sin\pars{x}}\,\dd x =
\int_{-\pi/2}^{\pi/2}{\sin\pars{nx}\cos\pars{n\pi/2} + \cos\pars{nx}\sin\pars{n\pi/2} \over \cos\pars{x}}\,\dd x
\\[5mm] & =
2\sin\pars{n\,{\pi \over 2}}
\int_{0}^{\pi/2}{\cos\pars{nx} \over \cos\pars{x}}\,\dd x\label{1}\tag{1}
\end{align}

Note that
  $\ds{\left.\vphantom{\large A}I\,\right\vert_{\ n\ \in\ \mathbb{N}} = 0}$ for
  $\ds{\underline{even}\ n}$.


For $\ds{\underline{odd}\ n}$: 
\begin{align}
\left.\int_{0}^{\pi/2}{\cos\pars{nx} \over \cos\pars{x}}\,\dd x
\,\right\vert_{\ \mrm{odd}\ n} & =
\Re\int_{0}^{\pi/2}{\expo{\ic nx} - \expo{\ic n\pi/2}\over \cos\pars{x}}\,\dd x =
\left.\Re\int_{0}^{\pi/2}{z^{n} - \expo{\ic n\pi/2} \over
\pars{z^{2} + 1}/\pars{2z}}\,{\dd z \over \ic z}
\right\vert_{\ z\ \equiv\ \expo{\ic x}}
\\[5mm] & =
\left.2\,\Im\int_{0}^{\pi/2}
{z^{n} - \expo{\ic n\pi/2} \over z^{2} + 1}\,\dd z\,
\right\vert_{\ z\ \equiv\ \exp\pars{\ic x}}
\\[5mm] & =
-2\,\Im\int_{1}^{0}
{y^{n}\expo{\ic n\pi/2} - \expo{\ic n\pi/2} \over -y^{2} + 1}\,\ic\,\dd y -
2\,\Im\int_{0}^{1}
{x^{n} - \expo{\ic n\pi/2} \over x^{2} + 1}\,\dd x
\\[5mm] & =
-2\ \overbrace{\cos\pars{n\,{\pi \over 2}}}
^{\ds{=\ 0\,,\ n\ \mrm{odd}}}\
\int_{1}^{0}{y^{n} - 1 \over -y^{2} + 1}\,\dd y +
2\sin\pars{n\,{\pi \over 2}}\int_{0}^{1}{\dd x \over x^{2} + 1}
\\[5mm] & =
{1 \over 2}\,\pi\sin\pars{n\,{\pi \over 2}}\,,\qquad
\forall\ \underline{odd}\ n\label{2}\tag{2}
\end{align}

With \eqref{1} and \eqref{2}
$\ds{\pars{~\mbox{note that}\
\left.\sin^{2}\pars{n\,{\pi \over 2}}\right\vert_{\ n\ \mrm{odd}} = 1~}}$:
$$\bbox[#ffe,15px,border:1px dotted navy]{\ds{%
\left.\vphantom{\large A}\mrm{I}_{n}\,\right\vert_{\ n\ \in\  \mathbb{N}} \equiv
\int_{-\pi}^{\pi}{\sin\pars{nx} \over \pars{1 + 2^{x}}\sin\pars{x}}\,\dd x =
\left\{\begin{array}{lcl}
\ds{0} & \mbox{if} & n\ \mbox{is}\,\,\, \underline{even}
\\
\ds{\pi} & \mbox{if} & n\ \mbox{is}\,\,\, \underline{odd}
\end{array}\right.}}
$$
