Here is a proof of Ramanujan's identity (thanks to Todd Trimble for encouraging me to post this!). As Andrey Rekalo notes, we have the identity $$\displaystyle\prod\limits_{k=0}^{\infty}(1+\frac{x^2}{(k+a)^2})=\frac{\Gamma(a)^2}{|\Gamma(a+ix)|^2}$$ In particular, the integrand in Ramanujan's integral is $\dfrac{\Gamma(b+1)^2 |\Gamma(a+ix)|^2}{\Gamma(a)^2 |\Gamma(b+1+ix)|^2}$. Hence, after a little algebra (and also changing $b$ to $b-1$; I personally think Ramanujan made the wrong aesthetic choice here), we need to prove the integral evaluation $$I=\displaystyle\int\limits_{-\infty}^{\infty} \frac{|\Gamma(a+ix)|^2}{|\Gamma(b+ix)|^2}dx=\sqrt{\pi}\frac{\Gamma(a)\Gamma(a+1/2)\Gamma(b-a-1/2)}{\Gamma(b-1/2)\Gamma(b)\Gamma(b-a)}$$ Now, if $f(x)$ has Mellin transform $F(s)$, then one form of Parseval's theorem for Mellin transforms is the identity $$\int_{0}^{\infty}|f(x)|^{2}x^{-1}dx=\frac{1}{2\pi}\int\limits_{-\infty}^{\infty}|F(it)|^2 dt$$ (under suitable conditions of course). Applying this with the Mellin pair $f(x)=\Gamma(b-a)^{-1}x^{a}(1-x)^{b-a-1}$ if $0\leq x \leq 1$ (and $f=0$ otherwise), $F(s)=\dfrac{\Gamma(s+a)}{\Gamma(s+b)}$ gives $$I=2\pi \Gamma(b-a)^{-2} \int\limits_{0}^{\infty}x^{2a-1}(1-x)^{2b-2a-2}dx$$ $$=2\pi \Gamma(b-a)^{-2} \frac{\Gamma(2a) \Gamma(2b-2a-1)}{\Gamma(2b-1)}$$ Next, apply the formula $\Gamma(2z)=2^{2z-1}\pi^{-1/2}\Gamma(z)\Gamma(z+1/2)$ to each of the $\Gamma$-functions in the quotient here, getting $$I=\sqrt{\pi} \frac{\Gamma(a)\Gamma(a+1/2)\Gamma(b-a-1/2)\Gamma(b-a)}{\Gamma(b-a)^2 \Gamma(b-1/2) \Gamma(b)}$$And cancelling $\Gamma(b-a)$ concludes the proof. Exercise: Give a proof, along similar lines, of the formula $$\int_{-\infty}^{\infty} |\Gamma(a+ix)\Gamma(b+ix)|^2 dx=\sqrt{\pi}\cdot\frac{\Gamma(a)\Gamma(a+1/2)\Gamma(b)\Gamma(b+1/2)\Gamma(a+b)}{\Gamma(a+b+1/2)}$$ And determine for what range of $a,b$ it holds.