En primer lugar observamos que como $x \to 0^{+}$ la función $$f(x) = \dfrac{1}{\sin\left(\dfrac{x}{2}\right)} - \frac{2}{x}$$ tends to a definite limit $0$ and hence can be assumed continuous in $[0, \pi]$. Therefore $f(x)$ is Riemann-integrable on interval $[0, \pi]$. It now follows by Riemann-Lebesgue Lemma (related to coefficients of Fourier series of $f(x)$, a proof is available in Tom M. Apostol's "Mathematical Analysis", 2nd Ed., Page 313) that $$\lim_{N \to \infty}\int_{0}^{\pi}f(x)\sin(Nx + b)\,dx = 0$$ This settles the hard part of the question. The limit of $f(x)$ as $x \to 0^{+}$ se calcula como sigue:
$\displaystyle \begin{aligned}\lim_{x \to 0^{+}}f(x) &= \lim_{x \to 0^{+}}\dfrac{1}{\sin\left(\dfrac{x}{2}\right)} - \frac{2}{x}\\
&= \lim_{x \to 0^{+}}\dfrac{x - 2\sin(x/2)}{x\sin(x/2)}\\
&= \lim_{x \to 0^{+}}\dfrac{x - 2\sin(x/2)}{x\dfrac{\sin(x/2)}{x/2}\cdot(x/2)}\\
&= 2\lim_{x \to 0^{+}}\dfrac{x - 2\sin(x/2)}{x^{2}}\\
&= 2\lim_{x \to 0^{+}}\dfrac{1 - \cos(x/2)}{2x}\text{ (by L'Hospital's Rule)}\\
&= \lim_{x \to 0^{+}}\dfrac{2\sin^{2}(x/4)}{x}\\
&= 2\lim_{x \to 0^{+}}\dfrac{\sin^{2}(x/4)}{(x/4)^{2}}\cdot\frac{(x/4)^{2}}{x} = 0\end{aligned}$
La observación que se han hecho acerca de la representación de $\sin(N + 1/2)x$ como una suma podemos ayudar en mostrar que $$\int_{0}^{\pi}\dfrac{\sin\left(N + \dfrac{1}{2}\right)x}{\sin(x/2)} = \pi$$ Using this result together with the earlier established limit $$\lim_{N \to \infty}\int_{0}^{\pi}\left(\dfrac{1}{\sin(x/2)} - \frac{2}{x}\right)\sin\left(N + \frac{1}{2}\right)x\,dx = 0$$ gives us $$\lim_{N \to \infty}\int_{0}^{\pi}\dfrac{\sin\left(N + \dfrac{1}{2}\right)x}{x}\,dx = \frac{\pi}{2}$$The last part of the question can be easily deduced by putting $(N + 1/2)x = t$ en la integral anterior.