How to solve $\int_{0}^{\infty} \frac{\sin^2 \frac{x}{2}}{x^p} dx$ with $1<p<3$ ?
I tried integration by parts. For $p=2$ a solution is obtained using Residue theorem. For the general case $1<p<3$ I cannot find a solution.
Mathematica provides
$\int_{0}^{\infty} \frac{\sin^2 \frac{x}{2}}{x^p} dx = - \frac{1}{2} \sin \left( \frac{\pi p }{2} \right) \Gamma (1 -p)\,$ for $1<\mathrm{Re}(p)<3$
You can use
$$\frac{1}{x^p}=\frac{1}{\Gamma(p)}\int_0^{\infty}e^{-x\,t}t^{p-1}\,dt$$
and your integral becomes
$$\int_{0}^{\infty} \frac{\sin^2 \frac{x}{2}}{x^p} dx=\frac{1}{\Gamma(p)}\int_0^{\infty}t^{p-1}\,dt\int_{0}^{\infty} e^{-x\,t}\sin^2 \frac{x}{2}dx$$
Later integral can be calculate by parts to obtain
$$\int_{0}^{\infty} \frac{\sin^2 \frac{x}{2}}{x^{p}} dx=\frac{1}{\Gamma(p)}\int_0^{\infty}\frac{t^{p-1} }{2 t^3+2 t}\,dt=\frac{1}{2\Gamma(p)}\int_0^{\infty}\frac{t^{p-2} }{ t^2+1}\,dt=\frac{1}{4\Gamma(p)}\int_0^{\infty}\frac{u^{p/2-3/2} }{ u+1}\,du$$ This last integral is (see NIST beta function)
$$\beta(p/2-1/2,3/2-p/2)=\Gamma(p/2-1/2)\Gamma(3/2-p/2)=\frac{\pi}{\sin \pi (p/2-1/2)}=\frac{\pi}{\cos \,\pi p/2}$$
Now
$$\int_{0}^{\infty} \frac{\sin^2 \frac{x}{2}}{x^p} dx=\frac{\pi}{4\,\Gamma(p)\cos \,\pi p/2}$$
and using $\Gamma(1-p)\Gamma(p)=\frac{\pi}{\sin \,\pi p}$ and $\sin 2x=2 \sin\,x \cos\,x$ we arrive to desired result.