Solution to this integral?

Note that we can write

$$\begin{align} e^{-x}\sin(x)\cos(ax)&=\text{Re}\left(e^{-x}e^{iax}\sin(x)\right)\\\\ &=\text{Re}\left(\frac{e^{i(a+1+i)x}-e^{i(a-1+i)x}}{2i}\right) \end{align}$$

Hence, we have from the Generalized Frullani's Theorem

$$\begin{align} \int_0^\infty \frac{e^{-x}\sin(x)\cos(ax)}{x}\,dx&=\text{Re}\left(\frac{1}{2i}\int_0^\infty \frac{e^{i(a+1+i)x}-e^{i(a-1+i)x}}{x}\,dx\right)\\\\ &=\frac12\arctan\left(\frac{\text{Im}((a+1-i)(a-1+i))}{\text{Re}((a+1-i)(a-1+i))}\right)\\\\ &=\frac12 \arctan(2/a^2) \end{align}$$


By the sine addition formulas, it is enough to compute $$ f(m)=\int_{0}^{+\infty}\frac{\sin(mx)}{x}e^{-x}\,dx \tag{1}$$ where $f(0)=0$ and by the dominated convergence theorem $$ f'(m) = \int_{0}^{+\infty}\cos(mx)e^{-x}\,dx\stackrel{IBP}{=}\frac{1}{1+m^2}\tag{2}$$ implying: $$ f(m)=\int_{0}^{+\infty}\frac{\sin(mx)}{x}e^{-x}\,dx = \arctan(m)\tag{3} $$ and $$\begin{eqnarray*} \int_{0}^{+\infty}\frac{\sin(x)\cos(ax)}{x}e^{-x}\,dx &=& \frac{\arctan(1-a)+\arctan(1+a)}{2}\\&=&\color{red}{\frac{1}{2}\,\arctan\frac{2}{a^2}}.\tag{4} \end{eqnarray*}$$


$\newcommand{\bbx}[1]{\,\bbox[8px,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}{\expo{-x}\sin\pars{x}\cos\pars{ax} \over x}\,\dd x \\[5mm] = &\ {1 \over 2} \int_{0}^{\infty}{\expo{-x}\sin\pars{\bracks{1 + a}x} \over x}\,\dd x + {1 \over 2} \int_{0}^{\infty}{\expo{-x}\sin\pars{\bracks{1 - a}x} \over x}\,\dd x \\[5mm] = &\ {1 \over 2}\pars{1 + a} \int_{0}^{\infty}\expo{-x}\, {\sin\pars{\bracks{1 + a}x} \over \pars{1 + a}x}\,\dd x\ +\ \pars{a \leftrightarrow -a} \\[5mm] = &\ {1 \over 2}\pars{1 + a} \int_{0}^{\infty}\expo{-x}\, {1 \over 2}\int_{-1}^{1}\expo{\ic\pars{1 + a}xk}\,\dd k\,\dd x\ +\ \pars{a \leftrightarrow -a} \\[5mm] = &\ {1 \over 4}\pars{1 + a} \int_{-1}^{1}\int_{0}^{\infty}\exp\pars{\bracks{- 1 + \ic\pars{1 + a}k}x} \,\dd x\,\dd k\ +\ \pars{a \leftrightarrow -a} \\[5mm] = &\ {1 \over 4}\pars{1 + a} \int_{-1}^{1}{-1 \over -1 + \ic\pars{1 + a}k}\,\dd k\ +\ \pars{a \leftrightarrow -a} \\[5mm] = &\ {1 \over 4}\pars{1 + a}2 \int_{0}^{1}{\dd k \over \pars{1 + a}^{2}k^{2} + 1}\ +\ \pars{a \leftrightarrow -a} = {1 \over 2} \int_{0}^{1 + a}{\dd k \over k^{2} + 1}\ +\ \pars{a \leftrightarrow -a} \\[5mm] = &\ \bbx{\arctan\pars{1 + a} + \arctan\pars{1 - a} \over 2} \end{align}