A definite integral that surely needs contour integration: $\int_0^{\infty} \frac{1}{x^2 + a^2}\cos\left(\frac{x(x^2 - b^2)}{x^2 - c^2}\right)\, dx$ During my Master Thesis work I came up with an integral which I am going to consider as a hard challenge. I have been trying for days to crack it, but still nothing. The integral is the following
$$\int_0^{+\infty} \frac{1}{x^2 + a^2}\cos\left(\frac{x(x^2 - b^2)}{x^2 - c^2}\right)\ \text{d}x$$
Where $a, b, c$ are simplified real constants ("simplified" means that they are constants, well defined, which I wrote $a, b, c$ for simplicity and brevity).
I do believe (but I think it's obvious [?]) that some contour integration is required. However I didn't obtain anything but to extend the integration to the whole axis since it's an even function..
The solution does exist, and it has been confirmed by one of my professor's colleagues which used Mathematica I guess. The explicit solution is
$$\frac{\pi}{2a}\exp\left(-\frac{a(a^2 + b^2)}{a^2 + c^2}\right)$$
Any hint to solve that integral? 
 A: Assume that all the parameters are real and nonnegative.
Then the equation $$\int_{0}^{\infty}  \frac{1}{x^2 + a^2} \, \cos\left(\frac{x(x^2 - b^2)}{x^2 - c^2}\right) \, dx = \frac{\pi}{2a} \, \exp\left(-\frac{a(a^2 + b^2)}{a^2 + c^2}\right)$$ holds iff $a >0$ and  $b \ge  c$.
To see why this is the case, consider the function $$f(z) = \frac{1}{a^{2}+z^{2}}  \, \exp \left(iz \, \frac{z^{2}-b^{2}}{z^{2}-c^{2}} \right) = \frac{1}{a^{2}+z^{2}} \, \exp(iz) \exp \left(-iz \, \frac{b^2-c^2}{z^2-c^2}\right).  $$
(Daniel Fischer suggested expressing $f(z)$ in that alternative way to make the analysis a bit easier.)
In the upper half of the complex plane, both $|\exp(iz)|$ and $ \left| \exp\Bigl(-iz \, \frac{b^2-c^2}{z^2-c^2}\Bigr) \right|$ are bounded if $b \ge c$.
The latter is not particularly obvious. But by substituting $x+iy$ for $z$, one finds that the real part of $-iz \, \frac{b^2-c^2}{z^2-c^2} $ is $$-\frac{(b^{2}-c^{2})(c^{2}y+x^{2}y+y^{3})}{(x^2-y^2-c^{2})^{2}+4x^2y^{2}},$$ which is never positive if $y>0$ and $b \ge c$.
So if $b \ge c$, the magnitude of  $\exp\Bigl(-iz \, \frac{b^2-c^2}{z^2-c^2}\Bigr)$, like the magnitude of $\exp(iz)$, never exceeds $1$ in the upper half-plane, which includes near the essential singularities at $z= \pm c$.
Therefore, if $b \ge c$, we can integrate around a closed semicircular contour in the upper half-plane that is indented at $z=\pm c$ and conclude after taking limits that $$ \begin{align} \text{PV}\int_{-\infty}^{\infty} \frac{1}{x^2 + a^2} \, \cos\left(\frac{x(x^2 - b^2)}{x^2 - c^2}\right) \, dx &= \text{Re} \, 2 \pi i \, \text{Res} \left[f(z), ia \right]  \\ &= \frac{\pi}{a} \, \exp\left(-\frac{a(a^2 + b^2)}{a^2 + c^2}\right). \end{align}$$
But since $\cos\left(\frac{x(x^2 - b^2)}{x^2 - c^2}\right)$ is bounded along the real axis, the integral coverges in the traditional sense we can drop the Cauchy principal value sign.
I don't know how to determine the value of the integral when $b < c$.

EDIT:
A solution was posted in The Gazette of the Royal Spanish Mathematical Society, but I don't think it's correct.  It makes no mention of any restriction on the parameters.
I rechecked with Wolfram Alpha to make sure the equation doesn't hold if $b<c$, and indeed it doesn't appear to.
A: I am going to stick my neck out, right here and now, and say that the answer provided by your professor's colleague is wrong.  I did a simple numerical check in Mathematica and found the numerical result disagreeing with the proposed analytical result for $a=3$, $b=1$, and $c=2$.
Beyond that, however, it looks like whoever supplied this result merely used a semicircular contour in the upper half plane and used the residue theorem to find the residue of the integrand at the pole $z=i a$ and multiply by $i 2 \pi$ and be done with it.  As nice and simple as it looks, this is wrong because the obvious essential singularity at $z=c$ has been ignored altogether.  Further, the argument of the cosine term - to be replaced by an exponential - changes sign between $b$ and $c$, before, and after.  It makes a difference whether $b \gt c$ or otherwise.  
It is not obvious that this integral is a candidate for the residue theorem or any other scheme that uses integration in the complex plane.  You need to examine all of the singularities of the integrand and see whether it makes sense to attack the integral in this manner.  Further, you should do numerical checks on your answers before declaring victory.
