# A Continued Fraction for Error Function by Ramanujan

Today's post is inspired by this question I asked sometime back on MSE. And after some effort (offering a bounty) I received a very good answer from a user on MSE. This question was asked for the first time by Ramanujan in the "Journal of Indian Mathematical Society" 6th issue as Question no. 541, page 79 in the following manner:

Prove that $$\left(1 + \frac{1}{1\cdot 3} + \frac{1}{1\cdot 3\cdot 5} + \cdots\right) + \left(\cfrac{1}{1+}\cfrac{1}{1+}\cfrac{2}{1+}\cfrac{3}{1+}\cfrac{4}{1+\cdots}\right) = \sqrt{\frac{\pi e}{2}}\tag{1}$$ It turns out that the first series is intimately connected with the error function given $$\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_{0}^x e^{-t^2}\,dt\tag{2}$$ In his famous letter to G. H. Hardy, dated 16th January 1913, Ramanujan gave the following continued fraction for the integral used in the definition of error function given above: $$\int_{0}^{a}e^{-x^{2}}\,dx = \frac{\sqrt{\pi}}{2} - \cfrac{e^{-a^{2}}}{2a+}\cfrac{1}{a+}\cfrac{2}{2a+}\cfrac{3}{a+}\cfrac{4}{2a+\cdots}\tag{3}$$