The reason,
##\int_{-\infty}^{\infty}\sqrt{k^2+m^2} \sin k \ dk ##
diverges is because it generally means
## \lim_{R \rightarrow \infty} \lim_{S \rightarrow \infty}\int_{-R}^{S}\sqrt{k^2+m^2} \sin k \ dk ##
where ##R## and ##S## are independent.
If this is the answer to a physics problem then you may have made a mistake - what is the original problem?
By the way, the integral you are doing is a Fourier transform. One way to define it would be:
<br />
\mathcal{F}\left[f(k)\right] \equiv F(z) = \int_{-\infty}^{\infty} dk f(k) e^{i k z}<br />
Note that with this definition,
<br />
-i \frac{d F(z)}{dz} = \int_{-\infty}^{\infty} dk \, k \, f(k) e^{i k z} = \mathcal{F}\left[k f(k)\right]<br />
With these definitions (and a trick!) we can do the ##m=0## case, for which ##f(k) = |k| = k \, sign(k)##, where
##sign(k)=1## if ##k>0## and ##sign(k)=-1## if ##k<0##. The trick goes like this:
<br />
\mathcal{F}\left[sign(k)\right] = \lim_{\epsilon\rightarrow 0^+} \mathcal{F}\left[sign(k)e^{-\epsilon |k|}\right]= \lim_{\epsilon\rightarrow 0^+} \int_{-\infty}^{\infty} dk \, e^{i k z} \, e^{-\epsilon |k|}\, sign(k) = i\frac{2}{z}<br />
When I first saw this trick as an electrical engineer taking a signals and systems course it was not at all obvious why this was valid. It turns out that it can be justified in the theory of distributions, which I learned from the math department the following year (but it is still not obvious!).
Anyway, with this result your the ##m=0## integral becomes
<br />
\mathcal{F}\left[|k|\right]=\mathcal{F}\left[k\, sign(k)\right]=-i\frac{d}{dz} \left( i\frac{2}{z}\right) = - \frac{2}{z^2}.<br />
Note we have been fast and loose with the rigor, which is usually perfectly fine for an engineer. If that is all you are interested in then don't read the rest of my post please!
However, just like the dirac delta function is defined by how it operates under an integral, the results above also have that same flavor. Specifically, the ##2i/z## above actually means that when you multiply by a nice function ##g(z)## and integrate, you intepret the result as,
<br />
\lim_{\epsilon\rightarrow 0^+} \left[ \int_{-\infty}^{-\epsilon} dz \frac{2i g(z)}{z} + \int_{\epsilon}^{\infty} dz \frac{2i g(z)}{z}\right] \equiv {PV} \int_{-\infty}^{\infty} dz \frac{2i g(z)}{z} <br />
Where the above defines the Cauchy principal value integral. For the reason, sometimes you will see,
## \mathcal{F}\left[sign(k)\right] = 2i {PV} \frac{1}{z} ##
to remind you of how you interpret it. The final result ##-2/z^2 ## would be interpreted,
<br />
-2 \lim_{\epsilon\rightarrow 0^+} \left[\int_{-\infty}^{-\epsilon} dz \frac{g(z)}{z^2} + \int_{\epsilon}^{\infty} dz \frac{g(z)}{z^2} - \frac{2 g(0)}{\epsilon}\right]<br />
Sometimes this is referred to as a pseudofunction, and written,
## \mathcal{F}\left[|k|\right]=-2 PF \frac{1}{z^2} ##.
jason