Calculate $$\int_{- \infty}^{\infty} \frac{ \sin\omega x}{x} dx$$ for $\omega$ real and positive
The solution that's given in the textbook for my Complex Analysis course is the following:
Solution: Since $g(z) = \frac{\sin \omega z}{z}$ is analytic everywhere we may write
We then get
Now in the solution above, no explanation is given as to how we go from one equality to another in the first line. For example I'm not sure why the principal value of the integral of $\frac{\sin \omega x}{x}$ equals the principal value of the integral of the imaginary part of $$\frac{e^{i \omega x}}{x}$$ and I'm not sure of the reason why the next equality holds.
Could somebody please explain how we arrive at all of these equalities in the first line?



The middle equality $\sin\omega x=\operatorname{Im}e^{i\omega x}$ comes from Euler's formula.
The right equality comes from linearity of integral $$ \int (g(x)+h(x))\,dx=\int g(x)\,dx+\int h(x)\,dx. $$ If you apply it to $f(x)=u(x)+iv(x)$ you'll get $$ \int(u(x)+iv(x))\,dx=\int u(x)\,dx+i\int v(x)\,dx, $$ hence, the imaginary part of the integral is $\int v(x)\,dx=\int\operatorname{Im}f(x)\,dx$.