For $1 <a <2$,

$$ \begin{align} \int_{0}^{\infty} x^{1-a} \cos (wx)\ dx &= w^{a-2} \int_{0}^{\infty} u ^{1-a} \cos (u) \ du \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \int_{0}^{\infty} \int_{0}^{\infty} \cos (u) \ t^{a-2} e^{-ut} \ dt \ du
\\ &= \frac{w^{a-2}}{\Gamma(a-1)} \int_{0}^{\infty}t^{a-2} \int_{0}^{\infty} \cos (u)e^{-tu} \ du \ dt \\ & = \frac{w^{a-2}}{\Gamma(a-1)} \int_{0}^{\infty} t^{a-2} \frac{t}{1+t^{2}} \ dt \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \int_{0}^{\infty} \frac{t^{a-1}}{1+t^{2}} \ dt \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \frac{1}{2} \int_{0}^{\infty} \frac{v^{\frac{a}{2}-1}}{1+v} \ dv \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \frac{1}{2} B \left(\frac{a}{2}, 1- \frac{a}{2} \right) \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \frac{\pi}{2} \csc \left(\frac{\pi a}{2} \right) \\ &= \frac{w^{a-2}}{\Gamma(a-1)} \frac{\pi}{2} \frac{2 \cos \left(\frac{\pi a}{2} \right)}{\sin (\pi a)} \\ &= w^{a-2} \frac{\Gamma(a) \Gamma(1-a) \cos \left(\frac{\pi a}{2} \right)}{\Gamma(a-1)} \\ &= w^{a-2} \ (a-1) \Gamma(1-a) \cos \left(\frac{\pi a}{2} \right) \\ &=- w^{a-2} \ \cos \left(\frac{\pi a}{2} \right) \Gamma(2-a) \end{align}$$

which is the answer given by Wolfram Alpha

If you want to be more rigorous, integrate by parts at the beginning and choose $1+ \sin u$ for the antiderivative of $\cos u$. Then when you switch the order of integration, it's easily justified by Tonelli's theorem.