Advanced techniques needed to solve a difficult integral. I am looking to solve the following integral.
$\int_{0}^{\infty} \frac{1-\cos(ax)}{x^2}e^{bx} dx$. 
I have made an attempt using the differentiation under the integral sign method and I got the following:
$b\ln(b)-\frac{1}{2}b-\frac{1}{2}b\ln(b^2+a^2)-\frac{1}{2}a\arctan(\frac{b}{a})$. eqn(2)
I think the above answer is incorrect because I know that if b=0, then
$\int_{0}^{\infty} \frac{1-\cos(ax)}{x^2} dx = \frac{\pi}{2}|a|$
however, if I let b$\rightarrow$0 in  eqn(2) my result is 
$\int_{0}^{\infty} \frac{1-\cos(ax)}{x^2}e^{bx} dx = 0$.
I would appreciate any assistance provided. Thank you.
 A: $b \lt 0$ for convergence, so rewrite for $b=-c$ as 
$$2 \int_{-\infty}^{\infty} dx \frac{\sin^2{(a x/2)}}{x^2} e^{-c x} \theta(x) $$
where $\theta(x) = 0$ when $x \lt 0$ and $1$ when $x \gt 0$.  
We can use Parseval's equality to evaluate this integral.  Parseval states that, if $f$ and $g$ have respective Fourier transforms $F$ and $G$, then
$$\int_{-\infty}^{\infty} dx \, f(x) g^*(x) = \frac1{2 \pi} \int_{-\infty}^{\infty} dk \, F(k) G^*(k) $$
$$f(x) = 2 \frac{\sin^2{(a x/2)}}{x^2} \implies F(k) = \pi \left (a-|k| \right ) \theta(a-|k|)$$
$$g(x) = e^{-c x} \theta(x)  \implies G(k) = \frac1{c+i k} $$
The integral is then
$$\begin{align}\frac12 \int_{-a}^a dk \frac{a-|k|}{c-i k}  &= \frac{a}{2} \int_{-a}^a \frac{dk}{c-i k} + \frac12 \int_0^a dk \, k \left ( \frac1{c-i k} + \frac1{c+i k}\right ) \\ &= i \frac{a}{2} \log{\left (\frac{a+i c}{-a+i c}  \right )}+ c \int_0^a dk \, \frac{k}{c^2+k^2} \\ &= a \arctan{\frac{a}{c} }+ \frac{c}{2} \log{\left (1+\frac{c^2}{a^2} \right)}\end{align}$$
A: b bust be negative to ensure the integral convergence. Then if we write the value of the integral we get b in the denominator all through. What you have done is you eliminated the denominators and you know that you want the denominator to be 0. There is no mistake.  
A: According to Mathematica the answer for $b<0$ and $a$ real is :
$$\frac{1}{2}b \log(a^2+b^2) -b \log(-b) - |a|\arctan \left(\frac{|a|}{b}\right)$$
which indeed converges to the value $|a|\frac{\pi}{2}$ when $b \rightarrow 0$. It is closed to you expression but not exactly the same.
What exactly did you do with differentiation under the integral ? For example, using this kind of method, you have to use some inital value to fix your integration constants. Which one did you use ?
