# Evaluate $\int_0^{\infty } \left(x^2+1\right)^{b-\frac{1}{2}} e^{-p x^2} \cos \left((2 b-1) \tan ^{-1}(x)+2 p x\right) \ dx$

Gradshteyn&Ryzhik 3.976 states that $$\int_0^{\infty } \left(x^2+1\right)^{b-\frac{1}{2}} e^{-p x^2} \cos \left((2 b-1) \tan ^{-1}(x)+2 p x\right) \ dx=\frac{e^{-p} \sin (\pi b) \Gamma (b)}{2 p^b}$$ For $$b,p>0$$. This seems to be related to Hermite formula i.e. formula $$7$$ here, but so far not success. Any help or suggestions will be appreciated.

Notice that the integral in question $$I$$ can be written as

$$I=\frac{1}{2}\Re(I_1)\\I_1=\int_{-\infty}^{\infty}dx(1+ix)^{2b-1}e^{-px^2}e^{2ipx}$$

which we can subsequently manipulate into a gamma function integral by completing the square :

$$I_1=\int_{-\infty}^{\infty}dx(1+ix)^{2b-1}e^{-px^2}e^{2ipx}\\=e^{-p}i^{2b-1}\int_{-\infty}^{\infty}dx(x+i)^{2b-1}e^{-p(x+i)^2}\\=e^{-p}i^{2b-1}\int_{-\infty+i}^{\infty+i}dx~x^{2b-1}e^{-px^2}$$

It is left to the reader to verify that since the integrand of the last expression has no poles in the complex plane, we can form a rectangular contour connecting the two lines of integration and prove that

$$\int_{-\infty+i}^{\infty+i}dx~x^{2b-1}e^{-px^2}=\int_{-\infty}^{\infty}dx~x^{2b-1}e^{-px^2}$$

Performing carefully a change of variables $$y=x^2/p$$ we find that

$$\int_{-\infty}^{\infty}dx~x^{2b-1}e^{-px^2}=\frac{1}{p^b}\int_{0}^{\infty}dx~y^{b-1}e^{-y}=\frac{\Gamma(b)}{p^b}$$

So we finally see that

$$I_1=-ie^{-p}e^{\pi ib}\frac{\Gamma(b)}{p^b}$$

and by extracting the real part and dividing by 2, we obtain the requested result:

$$I=e^{-p}\frac{\sin{(\pi b)}\Gamma(b)}{2p^b}$$