<s>[INST] $\int_0^\infty \frac{\sin^n x}{x^m}dx$ could be expressed via $\pi$ or $\log$ I want to show some results first (they were computed by MMA)

$$
\int_0^\infty \frac{\sin^5 x}{x^3} dx =\frac{5}{32}{\color{Red}\pi} \quad
\int_0^\infty \frac{\sin^5 x}{x^5} dx =\frac{115}{384} {\color{Red}\pi} \\
\int_0^\infty \frac{\sin^5 x}{x^2} dx =\frac{5}{16}\,{\color{Red}\log}\, \frac{27}{5} \quad
\int_0^\infty \frac{\sin^5 x}{x^4} dx =-\frac{5}{96}(27\,{\color{Red }\log } \,3-25\,{\color{Red}\log }\,5) \\
$$

and

$$
\int_0^\infty \frac{\sin^6 x}{x^4} dx =\frac{1}{8} {\color{Red}\pi} \quad
\int_0^\infty \frac{\sin^6 x}{x^6} dx =\frac{11}{40} {\color{Red}\pi} \\
\int_0^\infty \frac{\sin^6 x}{x^3} dx =\frac{3}{16}\,{\color{Red}\log}\, \frac{256}{27} \quad
\int_0^\infty \frac{\sin^6 x}{x^5} dx ={\color{Red}\log}\, \frac{3^\frac{27}{16}}{4} \\
$$

As we can see, in the integral $\displaystyle\int_0^\infty \frac{\sin^nx}{x^m}dx$ 
, if $n-m$ is even, the integral is expressed via $\pi$, and if $n-m$ is odd, the integral is expressed via $\log$. Amazing for me, it seems always true such as
$$\int_0^\infty \frac{\sin^8 x}{x^2} dx =\frac{5\pi}{32}$$ and
$$\int_0^\infty \frac{\sin^8 x}{x^3} dx =\frac{9}{8}\log\frac{4}{3}$$

Do we have a general method to compute $\displaystyle\int_0^\infty \frac{\sin^nx}{x^m}dx$ which implies these laws?

My attempt
This post tells us how to compute $\displaystyle\int_0^\infty \frac{\sin^n x}{x^n}dx \tag{*}$
We can compute some other  $\displaystyle\int_0^\infty \frac{\sin^nx}{x^m}dx$ via $(*)$, such as via the formulas
$$\displaystyle\int_{0}^{\infty}\dfrac{\sin^3 x}{x}\,dx = \dfrac{3}{4}\int_{0}^{\infty}\dfrac{\sin x}{x}\,dx - \dfrac{1}{4}\int_{0}^{\infty}\dfrac{\sin 3x}{x}\,dx$$
and
$$\int_0^\infty \frac{\sin^2 (2x)}{x^2}dx=\int_0^\infty \frac{4\sin^2 x-4\sin^4 x}{x^2}$$
But it's complicated to compute the general cases. Could you please  share some ideas of a possible method to show the law mentioned above?
 [/INST] If $n=2p$ is even then note that
$$\sin^n(x)=\frac1{2^n}\binom np+\frac1{2^{n-1}}\sum_{k=0}^{p-1}\binom nk(-1)^{p-k}\cos((n-2k)x)$$
If $n=2p+1$ is odd then note that
$$\sin^n(x)=\frac1{2^{n-1}}\sum_{k=0}^p\binom nk(-1)^{p-k}\sin((n-2k)x)$$

By rewriting the $\sin^n(x)$, we get an integral of a sum of $\cos(jx)/x^m$ or $\sin(jx)/x^m$. By repeatedly integrating by parts, one can reduce this down to an integrals of the forms:
$$\int_0^\infty\frac{\cos(ax)-\cos(bx)}x~\mathrm dx=\ln\frac ba,~\int_0^\infty\frac{\sin(ax)}x~\mathrm dx=\frac\pi2$$
From which you can easily deduce the result, depending on whether $n-m$ is even or odd, as either a multiple of $\pi$ or a multiple of a logarithm.

If $n-m$ is even, the computation can be reduced. Since $n-m$ is even, then the integrand is even and we can rewrite it as integral over $\mathbb R$:
$$\int_0^\infty\frac{\sin^n(x)}{x^m}~\mathrm dx=\frac12\int_{-\infty}^\infty\frac{\sin^n(x)}{x^m}~\mathrm dx$$
We can then apply the above formulas, take the real or imaginary parts, and then use a standard semicircle contour and complex analysis.
</s>