A Continued Fraction for Error Function by Ramanujan

4 comments
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 (1+113+1135+)+(11+11+21+31+41+)=πe2 It turns out that the first series is intimately connected with the error function given erf(x)=2πx0et2dt 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: a0ex2dx=π2ea22a+1a+22a+3a+42a+ In this post we will establish the relations (1) and (3) along the lines indicated in the answer on MSE.

Summing the Given Series

We first start with summing the given series S=1+113+1135+ Clearly if we define a function f(x) by f(x)=x+x313+x5135+ then S=f(1). It turns out that if we differentiate the series for f(x) term by term then we obtain f(x)=1+x2+x413+x6135+=1+x(x+x313+x5135+)=1+xf(x) so that the function y=f(x) satisfies the following first order differential equation dydxxy=1,y(0)=0 Clearly the integrating factor here ex2/2 and hence we have y=f(x)=ex2/2x0et2/2dt and hence S=f(1)=e10et2/2dt We can rewrite the sum S in the following manner S=e10et2/2dt=e0et2/2dte1et2/2dt=πe2e1et2/2dt where the first integral is easily calculated from the famous integral 0et2dt=π2 It follows that the equation (1) can be established if we show that e1et2/2dt=11+11+21+31+41+ It turns out that it is much easier to consider the function ϕ(x)=ex2/2xet2/2dt and derive a continued fraction for ϕ(x) and then put x=1 to get (6).

Derivatives of ϕ(x)

If we differentiate ϕ(x) we obtain ϕ(x)=xex2/2xet2/2dtex2/2ex2/2=xϕ(x)1 and a further differentiation gives ϕ(x)=ϕ(x)+xϕ(x)=ϕ(x)+x(xϕ(x)1)=(1+x2)ϕ(x)x It is now easy to guess the pattern of nth derivative of ϕ(x) and we have ϕ(n)(x)=Pn(x)ϕ(x)Qn(x) where Pn(x),Qn(x) are polynomials. We will derive many properties of these polynomials starting with the following Pn+1(x)=xPn(x)+Pn(x)Qn+1(x)=Pn(x)+Qn(x) Clearly we can see that Pn+1(x)ϕ(x)Qn+1(x)=ϕ(n+1)(x)={ϕ(n)(x)}={Pn(x)ϕ(x)Qn(x)}=Pn(x)ϕ(x)+Pn(x)ϕ(x)Qn(x)=Pn(x){xϕ(x)1}+Pn(x)ϕ(x)Qn(x)={xPn(x)+Pn(x)}ϕ(x){Pn(x)+Qn(x)} and we get the equations (9) by comparing the LHS and RHS of the above equation.

The initial values of these polynomials are P0(x)=1,P1(x)=x and Q0(x)=0,Q1(x)=1. Differentiating the fundamental relation ϕ(x)=xϕ(x)1 n times using Leibniz rule we get the following relation ϕ(n+1)(x)=xϕ(n)(x)+nϕ(n1)(x) if n1 and therefore we get Pn+1(x)ϕ(x)Qn+1(x)=x{Pn(x)ϕ(x)Qn(x)}+n{Pn1(x)ϕ(x)Qn1(x)}={xPn(x)+nPn1(x)}ϕ(x){xQn(x)+nQn1(x)} and thus by comparing LHS and RHS we get Pn+1(x)=xPn(x)+nPn1(x),Qn+1(x)=xQn(x)+nQn1(x) Comparing the above recursive relation of Pn(x) with the previous one given in equation (10) we also get Pn(x)=nPn1(x). We summarize our results as follows P0(x)=1,P1(x)=xQ0(x)=0,Q1(x)=1Pn+1(x)=xPn(x)+nPn1(x),n1Qn+1(x)=xQn(x)+nQn1(x),n1Pn(x)=nPn1(x),n1 Next we establish the following identity which seems like a cross multiplication of P and Q Qn+1(x)Pn(x)Pn+1(x)Qn(x)=(1)nn! Clearly by direct substitution it holds for n=0,1 and we can try induction on n to prove it for all n. We assume that the equation (12) above holds for n=m and try to prove it for n=m+1. We have F(x)=Qm+2(x)Pm+1(x)Pm+2(x)Qm+1(x)={xQm+1(x)+(m+1)Qm(x)}Pm+1(x){xPm+1(x)+(m+1)Pm(x)}Qm+1(x)=(m+1){Qm+1(x)Pm(x)Pm+1(x)Qm(x)}=(m+1)(1)mm!=(1)m+1(m+1)! and therefore the relation holds for n=m+1 and hence by induction equation (12) holds for all values of n.

Next another identity concerning sign of ϕ(n)(x) is needed. We have (1)nϕ(n)(x)>0,n0 for all x. We have 0etxet2/2dt=ex2/20e(x+t)2/2dt=ex2/2xez2/2dz (by putting z=x+t)=ϕ(x) and hence ϕ(n)(x)=(1)n0tnetxet2/2dt and the relation (13) is now obvious.

Series Expansion for Pn(x)

We will now focus more on the polynomial Pn(x). It turns out that we have Pn(x)=ex2/2dndxn{ex2/2} Clearly if we let an(x)=ex2/2{ex2/2}(n) then a0(x)=1 and a1(x)=x. Also we have an+1(x)=ex2/2{ex2/2}(n+1)=ex2/2{xex2/2}(n)=x(ex2/2{ex2/2}(n))+nex2/2{ex2/2}(n1)=xan(x)+nan1(x) so that an(x) satisfies the same recurrence relation (11) as Pn(x). At the same time the initial values of an(x) for n=0,1 also match with those of Pn(x) and hence an(x)=Pn(x) for all x and n.

Next we start with the famous integral π2=0ex2dx and put z=x2 to get π2=0ez2/2dz=12ez2/2dz Putting z=tx we get 2π=ex2/2etxet2/2dt and therefore we have ex2/2=12πetxet2/2dt and differentiating this relation n times with respect to x we get \begin{align} P_{n}(x)\,&= \frac{e^{-x^{2}/2}}{\sqrt{2\pi}}\int_{-\infty}^{\infty}t^{n}e^{tx}e^{-t^{2}/2}\,dt\notag\\ &= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}t^{n}e^{-(t - x)^{2}/2}\,dt\notag\\ &= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}(u + x)^{n}e^{-u^{2}/2}\,du\notag\\ &= \sum_{k = 0}^{n}\binom{n}{k}x^{n - k}\left(\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}u^{k}e^{-u^{2}/2}\,du\right)\notag\\ &= \sum_{0 \leq 2k \leq n}\binom{n}{2k}x^{n - 2k}\left(\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}u^{2k}e^{-u^{2}/2}\,du\right)\notag\\ &= \sum_{0 \leq 2k \leq n}\binom{n}{2k}x^{n - 2k}\left(\frac{2}{\sqrt{2\pi}}\int_{0}^{\infty}u^{2k}e^{-u^{2}/2}\,du\right)\notag\\ &= \sum_{0 \leq 2k \leq n}\binom{n}{2k}x^{n - 2k}\left(\frac{2^{k}}{\sqrt{\pi}}\int_{0}^{\infty}t^{k - 1/2}e^{-t}\,dt\right)\text{ (by putting }u^{2} = 2t)\notag\\ &= \sum_{0 \leq 2k \leq n}\binom{n}{2k}x^{n - 2k}\cdot\dfrac{2^{k}\Gamma\left(k + \dfrac{1}{2}\right)}{\sqrt{\pi}}\notag\\ &= \sum_{0 \leq 2k \leq n}\binom{n}{2k}x^{n - 2k}\cdot\dfrac{(2k)!}{2^{k}k!}\notag \end{align} and we thus obtain the series for P_{n}(x) given by P_{n}(x) = \sum_{0 \leq 2k \leq n}\binom{n}{2k}\frac{(2k)!}{2^{k}k!}x^{n - 2k}\tag{15} It follows that P_{n}(x) is even function if n is even and is an odd function if n is odd. Also using the greatest k such that 2k\leq n in the above series we see that P_{2n}(x) \geq \frac{(2n)!}{2^{n}n!},\,\frac{P_{2n + 1}(x)}{x}\geq \frac{(2n + 1)!}{2^{n}n!}\tag{16} for all x.

Continued Fraction for \phi(x)

From (13) we see that \phi^{(2n)}(x) > 0 for all n and x and hence noting that P_{2n}(x) > 0 for all x (from (16)) we get \frac{Q_{2n}(x)}{P_{2n}(x)} < \phi(x) for all x and non-negative integers n. Similarly for x > 0 we see that \phi^{(2n + 1)}(x) < 0 and therefore \phi(x) < \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)} for non-negative integers n.

It follows that if x > 0 and n is a non-negative integer then \frac{Q_{2n}(x)}{P_{2n}(x)} < \phi(x)< \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)},\, \frac{Q_{2n + 2}(x)}{P_{2n + 2}(x)} < \phi(x)< \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)}\tag{17} and this leads to 0 < \phi(x) - \frac{Q_{2n}(x)}{P_{2n}(x)} < \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)} - \frac{Q_{2n}(x)}{P_{2n}(x)} = \frac{(2n)!}{P_{2n}(x)P_{2n + 1}(x)} and 0 < \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)} - \phi(x) < \frac{Q_{2n + 1}(x)}{P_{2n + 1}(x)} - \frac{Q_{2n + 2}(x)}{P_{2n + 2}(x)} = \frac{(2n + 1)!}{P_{2n + 1}(x)P_{2n + 2}(x)} by using the relation (12). We can combine the above inequalities and write 0 < \left|\phi(x) - \frac{Q_{n}(x)}{P_{n}(x)}\right| < \frac{n!}{P_{n}(x)P_{n + 1}(x)}\tag{18} for all x > 0 and all non-negative integers n. Using the estimates for P_{n}(x) given in (16) we see that \lim_{n \to \infty}\frac{Q_{n}(x)}{P_{n}(x)} = \phi(x)\tag{19} for all x > 0.

From the recurrence relations (11) it is now clear that Q_{n}(x)/P_{n}(x) is the n^{\text{th}} convergent of the continued fraction \cfrac{1}{x + }\cfrac{1}{x + }\cfrac{2}{x + }\cfrac{3}{x + }\cfrac{4}{x + \cdots} and from (19) it follows that these convergents do converge to \phi(x) if x > 0. It follows that \phi(x) = e^{x^{2}/2}\int_{x}^{\infty}e^{-t^{2}/2}\,dt = \cfrac{1}{x + }\cfrac{1}{x + }\cfrac{2}{x + }\cfrac{3}{x + }\cfrac{4}{x + \cdots}\tag{20} for positive values of x. Putting x = 1 we get equation (6) and thus the problem posed by Ramanujan in equation (1) is solved. The continued fraction in equation (3) is equivalent to e^{a^{2}}\int_{a}^{\infty}e^{-t^{2}}\,dt = \cfrac{1}{2a + }\cfrac{1}{a + }\cfrac{2}{2a + }\cfrac{3}{a + }\cfrac{4}{2a + \cdots} and it can be proved in the manner similar to the continued fraction of \phi(x). We only need to note that if \psi(x) = e^{x^{2}}\int_{x}^{\infty}e^{-t^{2}}\,dt then \psi'(x) = 2x\psi(x) - 1 so that the polynomials P_{n}(x), Q_{n}(x) corresponding to \psi^{(n)}(x) = P_{n}(x)\psi(x) - Q_{n}(x) will have the following recurrence relations \boxed{\begin{align} P_{0}(x) &= 1,\, P_{1}(x) = 2x\notag\\ Q_{0}(x) &= 0,\, Q_{1}(x) = 1\notag\\ P_{n + 1}(x) &= 2xP_{n}(x) + 2nP_{n - 1}(x)\notag\\ Q_{n + 1}(x) &= 2xQ_{n}(x) + 2nQ_{n - 1}(x)\notag \end{align}}\tag{21} and like the case of \phi(x) these recurrence relations lead to the continued fraction \psi(x) = e^{x^{2}}\int_{x}^{\infty}e^{-t^{2}}\,dt = \cfrac{1}{2x +}\cfrac{2}{2x +}\cfrac{4}{2x +}\cfrac{6}{2x +}\cfrac{8}{2x + \cdots} and it can be easily simplified by cancelling 2 from numerator and denominator at appropriate terms in the continued fraction to get the final version as mentioned by Ramanujan \psi(x) = e^{x^{2}}\int_{x}^{\infty}e^{-t^{2}}\,dt = \cfrac{1}{2x +}\cfrac{1}{x +}\cfrac{2}{2x +}\cfrac{3}{x +}\cfrac{4}{2x + \cdots}\tag{22}
Note: Some of the proofs are taken from an online paper by Omran Kouba (who provided an answer to my question posted on MSE).

Print/PDF Version

4 comments :: A Continued Fraction for Error Function by Ramanujan

Post a Comment

  1. The substitution by u^2 = 2t^2 is wrong, it has to be u^2 = 2t.

    My main question is though: I don't understand the conclusions in (16), what do you mean by these?

  2. @excentrique,
    You are right and thanks for catching the typo. I will fix it. Equation (16) comes from (15) and we are just using the fact that P_{n}(x) is greater than one particular term in the series representation (15) of P_{n}(x) and this we do based on parity of n. This is possible because each term in series for P_{2n}(x) and for P_{2n + 1}(x)/x is positive.

    Regards,
    Paramanand

  3. Hi Paramanand,

    thanks for the explanation.
    I worked my way through the proof and I'm almost there at the end where I cannot quite reproduce the proof for psi(x), the recurrence relations of (21) don't lead to the conclusion (12), so how can I proceed from these relations to a similar proof of phi(x). Is there a shorter way to explain oneself that the continued fraction in (3) is equivalent to the new one at the end?

  4. @excentrique,

    From equation (21) you will get an equation similar to (12) namely Q_{n + 1}(x)P_{n}(x) - P_{n + 1}(x)Q_{n}(x) = (-2)^{n}n! and there will some minor tweaks in the equations which follow accordingly. But end result will be as mentioned after equation (21). You should try out these calculations and let me know if you face any problem.

    Regards,
    Paramanand