how do you do this integral from fourier transform.

We have that $$\cos(kx)\sin(ax) = \frac{\sin((a-k)x)}{2}+\frac{\sin((a+k)x)}{2}$$

So put in a different form we have that

$$\int_{\Bbb{R}}\frac{\cos(kx)\sin(ax)}{x}dx = \int_{\Bbb{R}}\frac{\sin((a-k)x)+\sin((a+k)x)}{2x} ~~dx$$

We also know that because of the identity: $$\int_{\Bbb{R}^+}\frac{f(t)}{t} = \int_{\Bbb{R}^+}\mathcal{L}\{f\}$$ And that $\mathcal{L}[\sin(ax)](s) = \frac a {s^2 +a^2},$ where $\mathcal{L} $ represents the Laplace transform that $$\int_{\Bbb{R}}\frac {\sin(ax)}{x} = \int_{\Bbb{R}}\frac a {x^2 + a^2} = \left.\arctan\left(\frac x a\right)\right|_{-\infty}^\infty = \pi \operatorname{sgn}(a)$$

Making the resulting integral: $$\frac{\pi(\operatorname{sgn}(a-k)+\operatorname{sgn}(a+k))}2$$


To avoid confusion, this is the version of the Fourier transform that I will use in my answer: $$f(x)\longmapsto \hat{f}(\omega)=\int_{-\infty}^\infty e^{-i\omega x}f(x)\,dx.$$

One way is to determine the Fourier transform of $\sin(ax)$, and then using the fact that division by $-ix$ corresponds to integration in the frequency domain.

The transform of the sine function is $$\sin(ax)=\frac{1}{2i}(e^{iax}-e^{-iax})\longmapsto\hat{f}(\omega)=\frac{1}{2i}(2\pi\delta(\omega-a)-2\pi\delta(\omega+a))=\frac{\pi}{i}(\delta(\omega-a)-\delta(\omega+a)),$$ where $\delta(\omega)$ denotes the Dirac delta.

We now get $$g(x)=\frac{\sin(ax)}{x}\longmapsto \hat{g}(\omega)=-\pi\int_{-\infty}^\omega (\delta(u-a)-\delta(u+a))\,du=\pi(H(\omega+a)-H(\omega-a)),$$ where $H(\omega)$ is the Heaviside step function.