TITLE: $\int_0^\infty \frac{\sin^n x}{x^m}dx$ could be expressed via $\pi$ or $\log$
QUESTION [6 upvotes]: 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?

REPLY [4 votes]: The aim of this answer is to give the explicit expression for the value of the integrals. Essentially it is a development of the previous answer. Notice that for convenience I changed $m$ to $m+1$.
We are going to prove:

For all $0\le m<n$:
  $$
\int_0^\infty\frac{\sin^n x}{x^{m+1}}dx
=\frac{(-1)^{\left\lfloor\frac{n-m-1}2\right\rfloor}}{2^{n-1}m!}
\begin{cases}
\displaystyle\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}
(-1)^k\binom nk(n-2k)^m\;\log(n-2k),&n-m=0\operatorname{mod}2;\\
\displaystyle\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}
(-1)^k\binom nk(n-2k)^m\;\frac\pi2,&n-m=1\operatorname{mod}2.\\
\end{cases}\tag1
$$
  Observe that for $m=0$ and even $n$ both sides of (1) diverge.

A sketch of the proof:
We start with the expression:
$$\begin{align}
\int_0^\infty\frac{\sin^n x}{x^{m+1}}dx
&=\frac1{(2i)^n}\int_0^\infty\frac{(e^{ix}-e^{-ix})^n}{x^{m+1}}dx\\
&=\frac1{(2i)^n}\int_0^\infty\frac{dx}{x^{m+1}}\sum_{k=0}^n(-1)^k\binom nk e^{i(n-2k)x}.\tag2
\end{align}
$$
Integrating (2) by parts $m$ times one arrives at:
$$
\int_0^\infty\frac{\sin^n x}{x^{m+1}}dx=
\frac1{(2i)^nm!}\int_0^\infty\frac{dx}{x}\sum_{k=0}^n(-1)^k\binom nk i^m(n-2k)^m e^{i(n-2k)x}.\tag3
$$
Now observe that $\dfrac{(-1)^{n-k}(2k-n)^m}{(-1)^k(n-2k)^m}=(-1)^{n-m}$. Therefore the expression (3) can be rewritten as:
$$
\int_0^\infty\frac{\sin^n x}{x^{m+1}}dx
=
\begin{cases}
\displaystyle \frac{i^{m-n}}{2^{n-1}m!}\int_0^\infty\frac{dx}x
\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}
(-1)^k\binom nk(n-2k)^m \cos(n-2k)x,&n-m=0\operatorname{mod}2;\\
\displaystyle\frac{i^{m-n+1}}{2^{n-1}m!}\int_0^\infty\frac{dx}x
\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}
(-1)^k\binom nk(n-2k)^m \sin(n-2k)x &n-m=1\operatorname{mod}2.\\
\end{cases}\tag4
$$
The lower line together with the well-known identity $$\int_0^\infty\frac{\sin ax}x dx=\frac\pi2\operatorname{sgn}a$$ immediately gives the corresponding line of (1).
To obtain the upper line of (1) one observes that:
$$
\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}(-1)^k\binom nk(n-2k)^m=0\tag5
$$
for even values of $n-m$. A proof can be found elsewhere. Essentially it is based on the fact that
$$
\int_{-\infty}^\infty\frac{\sin^nx}{x^{m+1}}dx=0,
$$
since the integrated function is odd.
In view of (5) we can rewrite the upper line in r.h.s. of (4) as:
$$
\frac{i^{m-n}}{2^{n-1}m!}
\sum_{k=0}^{\left\lfloor\frac{n}2\right\rfloor}
(-1)^k\binom nk(n-2k)^m \int_0^\infty\frac{\cos(n-2k)x-\cos x}xdx.
$$
The resulting integral is of (generalized) Frullani type, so:
$$
\int_0^\infty\frac{\cos(n-2k)x-\cos x}xdx=-\log(n-2k),
$$
proving the upper line of (1).