Integrating $\int\nolimits_0^{\infty}{\frac{e^{-ax}-e^{-bx}}{x}\sin{mx} \, dx} \quad (a > 0 \, , b >0)$

I don't have the theorems to justify all the tricks I am manipulating (mainly because it's late and I just thought I'd give you an idea) but here's how this goes : let $$ f(t) = \int_0^{\infty} \frac{e^{-atx} - e^{-btx}}x \sin(mx) \, dx $$ Now clearly $f(0) = 0$ because when $t=0$ the integrand is $0$. The trick here is to evaluate $$ f(1) = \int_0^1 f'(t) \, dt $$ and to differentiate under the integral sign, as you suggested. So here it goes : $$ \begin{gather*} \begin{aligned} f'(t) & = \frac{d}{d t} \int_0^{\infty} \frac{e^{-atx} - e^{-btx}}x \sin (mx) \, dx \\\ & = \int_0^{\infty} \frac{\partial}{\partial t} \left( \frac{e^{-atx} - e^{-btx}}x \sin (mx) \right) \, dx \\\ & = \int_0^{\infty} \frac{-ax e^{-atx} + bx e^{-btx}}x \sin(mx) \, dx \\\ & = \int_0^{\infty} (b e^{-btx} - a e^{-atx}) \sin(mx) \, dx. \\\ & = b \left( \frac{m}{m^2+(bt)^2} \right) - a \left( \frac{m}{m^2+(at)^2} \right). \\\ \end{aligned} \end{gather*} $$

Integrating this between $0$ and $1$ gives you the right answer. If you need clarification on some aspects I may edit the answer for you.

Hope that helps,

P.S. : I almost forgot you had a first question :P right now, your procedure is fine! Modulo some justification on your arguments (mine lacks arguments too, but the sketch is all there!) Good question, seriously. Most undergraduates I know don't even know about parametric differentiation to evaluate complicated integrals. Is there any course in which we encounter this? I'm a first year, so I just did basic calculus, analysis, algebra... and read some books in my leisure time. =)


Concerning the first question ``Is this procedure ok?'', the key step, that is the equality $$ \int_0^\infty {\bigg[\int_a^b {e^{ - xy} \sin (mx)\,dy\bigg]dx} } = \int_a^b {\bigg[\int_0^\infty {e^{ - xy} \sin (mx)} \,dx\bigg]dy} , $$ is justified by Fubini's theorem (see here). Specifically, letting $$ f(x,y) = e^{ - xy} \sin (mx), $$ it suffices to show that $$ \int_0^\infty {\bigg[\int_a^b {|f(x,y)|\,dy\bigg]dx} } < \infty \;\;{\rm or}\;\; \int_a^b {\bigg[\int_0^\infty {|f(x,y)|} \,dx\bigg]dy} < \infty. $$ Since $|f(x,y)| \leq e^{-xy}$, it thus suffices to show that $$ \int_0^\infty {\bigg[\int_a^b {e^{-xy}\,dy\bigg]dx} } < \infty \;\;{\rm or}\;\; \int_a^b {\bigg[\int_0^\infty {e^{-xy}} \,dx\bigg]dy} < \infty. $$ Both are very easy to show, the latter in particular: $$ \int_a^b {\bigg[\int_0^\infty {e^{-xy}} \,dx\bigg]dy} = \int_a^b {\frac{1}{y}\,dy} < \infty . $$


The integral can also be evaluated as follows. First a change of variable $x \mapsto mx$ gives $$ I = \int_0^\infty {\frac{{e^{ - ax} - e^{ - bx} }}{x}} \sin (mx)\,dx = \int_0^\infty {\frac{{e^{ - (a/m)x} - e^{ - (b/m)x} }}{x}\sin (x)\,dx} . $$ Thus, $$ I = \int_0^\infty {e^{ - (a/m)x} \frac{{\sin (x)}}{x}dx} - \int_0^\infty {e^{ - (b/m)x} \frac{{\sin (x)}}{x}dx} . $$ The Laplace transform of the sinc function ($\sin(x)/x$) is well known (*): $$ \int_0^\infty {e^{ - sx} \frac{{\sin (x)}}{x}} \,dx = \arctan \bigg(\frac{1}{s}\bigg), \;\; s > 0. $$ Hence $$ I = \arctan \bigg(\frac{m}{a}\bigg) - \arctan \bigg(\frac{m}{b}\bigg), $$ or alternatively $$ I = \bigg[\frac{\pi }{2} - \arctan \bigg(\frac{a}{m}\bigg)\bigg] - \bigg[\frac{\pi }{2} - \arctan \bigg(\frac{b}{m}\bigg)\bigg] = \arctan \bigg(\frac{b}{m}\bigg) - \arctan \bigg(\frac{a}{m}\bigg). $$

(*): See here (starting from "Take an additional parameter $a$ to the defining integral...'') for an elementary proof.