Integrating $\int_0^\infty \frac{\sin(px)\sin(qx)}{x^2} dx $ I want to solve the above integral (with p, q > 0 ) via complex analysis techniques (i.e. contour integration). 
So far I have tried calculating the integral of $\frac{e^{ipz} \sin(qz)}{x^2}$ using a semi-circular path with indentation at z = 0 and I derived an answer of $\frac{\pi\cdot q}{2}$ for the original integral (taking real parts etc) but the answer is supposed to be $\frac{\pi\cdot \min(p,q)}{2}$. Am I supposed to assume that $\ p \geq q $? If so, then why? see relevant diagram here
I know there are other posts with the same question but none have given clear answers to how the min(p,q) comes about. 
Thanks in advance  
 A: use that $$\sin(x)\sin(y)=\frac{1}{2}\left(\cos(x-y)-\cos(x+y)\right)$$
A: $$\int_{0}^{+\infty}\frac{\sin(px)\sin(qx)}{x^2}\,dx = \frac{1}{2}\int_{0}^{+\infty}\frac{\cos((p-q)x)-\cos((p+q)x)}{x^2}\,dx $$
where for any $s>0$, by integration by parts we have
$$ \int_{0}^{+\infty}\frac{1-\cos(sx)}{x^2}\,dx =\int_{0}^{+\infty}\frac{s\sin(sx)}{x}\,dx=\frac{\pi}{2}s$$
leading to:
$$\int_{0}^{+\infty}\frac{\sin(px)\sin(qx)}{x^2}\,dx =\pi\cdot\frac{|p+q|-|p-q|}{4}=\frac{\pi}{2}\cdot\min(p,q). $$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\int_{0}^{\infty}{\sin\pars{px}\sin\pars{qx} \over x^{2}}\,\dd x & =
{1 \over 2}\,p q\int_{0}^{\infty}{\sin\pars{\verts{p}x} \over \verts{p}x}\,
{\sin\pars{\verts{q}x} \over \verts{q}x}\,\dd x
\\[5mm] & =
{1 \over 2}\,p q\int_{-\infty}^{\infty}\
\pars{{1 \over 2}\int_{-1}^{1}\expo{\ic k_{1}\verts{p}x}\dd k_{1}}
\pars{{1 \over 2}\int_{-1}^{1}\expo{\ic k_{2}\verts{q}x}\dd k_{2}}\,\dd x
\\[5mm] & =
{1 \over 4}\,\pi p q\int_{-1}^{1}\int_{-1}^{1}
\int_{-\infty}^{\infty}\expo{\ic\pars{k_{1}\verts{p} + k_{2}\verts{q}}x}
\,{\dd x \over 2\pi}\,\dd k_{1}\,\dd k_{2}
\\[5mm] & =
{1 \over 4}\,\pi p q\int_{-1}^{1}\int_{-1}^{1}
\delta\pars{k_{1}\verts{p} + k_{2}\verts{q}}\,\dd k_{1}\,\dd k_{2}
\\[5mm] & =
{1 \over 4}\,\pi p q\int_{-1}^{1}\int_{-1}^{1}
{\delta\pars{k_{1} + k_{2}\verts{q/p}} \over
\verts{\vphantom{\Large A}\verts{p}}}\,\dd k_{1}\,\dd k_{2}
\\[5mm] & =
{1 \over 4}\,\pi\,\mrm{sgn}\pars{p}q
\int_{-1}^{1}\bracks{-1 < -\verts{q \over p}\,k_{2} < 1}\,\dd k_{2}
\\[5mm] & =
{1 \over 4}\,\pi\,\mrm{sgn}\pars{p}q
\int_{-1}^{1}\bracks{\verts{k_{2}} < \verts{p \over q}}\,\dd k_{2}
\\[5mm] & =
{1 \over 2}\,\pi\,\mrm{sgn}\pars{p}q
\int_{0}^{1}\bracks{k_{2} < \verts{p \over q}}\,\dd k_{2}
\\[5mm] & =
{1 \over 2}\,\pi\,\mrm{sgn}\pars{p}q
\braces{\bracks{\verts{p \over q} < 1}\int_{0}^{\verts{p/q}}\,\dd k_{2} +
\bracks{\verts{p \over q} > 1}\int_{0}^{1}\,\dd k_{2}}
\\[5mm] & =
{1 \over 2}\,\pi\,\mrm{sgn}\pars{p}q
\braces{\bracks{\verts{p} < \verts{q}}\verts{p \over q} +
\bracks{\verts{p} > \verts{q}}}
\\[5mm] & =
{1 \over 2}\,\pi\,\mrm{sgn}\pars{p}\,\mrm{sgn}\pars{q}
\braces{\vphantom{\Large A}\bracks{\vphantom{\large A}\verts{p} < \verts{q}}\verts{p} +
\bracks{\vphantom{\large A}\verts{p} > \verts{q}}\verts{q}}
\\[5mm] & =
\bbx{{1 \over 2}\,\pi
\,\mrm{sgn}\pars{p}\,\mrm{sgn}\pars{q}\min\pars{\verts{p},\verts{q}}}
\end{align}
