Proof of a Ramanujan Integral While studying Ramanujan's Collected Papers I came across a paper titled "Some Definite Integrals" which appeared in Messenger of Mathematics, ${\tt XLIV}, 1915, \mbox{10-18}$.
It contains lot of weird integrals for which Ramanujan has given proofs.

*

*However in one instance he discusses about the integral \begin{align}
&\int_{0}^{\infty}\frac{dx}{\left(1 + x^{2}\right)\left(1 + r^{2}x^{2}\right)\left(1 + r^{4}x^{2}\right)\cdots}
\\[5mm] = &\ \frac{\pi}{2\left(1 + r + r^{3} + r^{6} + r^{10} + \cdots\right)}\label{1}\tag{1}
\end{align} where $0 < r < 1$.


*Ramanujan derives this formula from \begin{align}
&\int_{0}^{\infty}\frac{\left(1 + arx\right)\left(1 + ar^{2}x\right)\cdots}{\left(1 + x\right)\left(1 + rx\right)\left(1 + r^{2}x\right)\cdots}x^{n - 1}\,\mathrm{d}x
\\[5mm] = &\
\frac{\pi}{\sin\left(n\pi\right)}
\prod_{m = 1}^{\infty}\frac{\left(1 - r^{m - n}\,\,\right)\left(1 - ar^{m}\,\right)}{\left(1 - r^{m}\,\right)\left(1 - ar^{m - n}\,\,\right)}\label{2}\tag{2}
\end{align}
where $0 < r < 1, n > 0, 0 < a < r^{n - 1}$ and $n$ is not an integer and $a$ is not of the form $a = r^{p}$ where $p$ is a positive integer.


*Unfortunately, Ramanujan does not prove the formula (\ref{2}).
Is there any direct approach to establish
(\ref{1}) without using (\ref{2}) or some way to establish (\ref{2}) $?$.

I find this relationship charming.
Here is what I have so far as an alternative solution without resorting to complex analysis.
For $n=0,1,...$ define
\begin{align}
I_n=\int_0^{\infty} \frac{dx}{(1+x^2)(1+r^2x^2)...(1+r^{2n}x^2)}
\end{align}
Doing many partial fractions I could establish for $n=1,2,3,4,...$ that
\begin{align}
I_{n}&=\frac{1-r^{2n-1}}{1-r^{2n}}I_{n-1}\\
I_0&=\frac{\pi}{2}
\end{align}
Therefore
\begin{align}
I_{\infty}&=\frac{\prod_{n=1}^{\infty}\Big(1-r^{2n-1}\Big)}{\prod_{n=1}^{\infty}\Big(1-r^{2n}\Big)}\frac{\pi}{2}
\end{align}
Now using the same arguments as in this post, we can establish $(1)$.
