In my third year at university I was introduced to the error function during a
‘Transport Phenomena’ class. It came up in the context of deriving expressions
to describe heat and mass transfer through various geometries. While revising
for the exam I derived an expression for π \pi π . Starting with the error
function:
erf ( z ) = 2 π ∫ 0 z e − x 2 d x \text{erf}(z)=\frac{2}{\sqrt{\pi}}\int_{0}^{z}e^{-x^2}dx erf ( z ) = π 2 ∫ 0 z e − x 2 d x
Recall that the Maclaurin series of the exponential function, e x e^x e x , is given by
e x = ∑ n = 0 ∞ x n n ! e^x=\sum_{n=0}^{\infty}\frac{x^n}{n!} e x = ∑ n = 0 ∞ n ! x n
And so, we can write the error function as
erf ( z ) = 2 π ∫ 0 z ∑ n = 0 ∞ ( − x 2 ) n n ! d x = 2 π ∫ 0 z ( 1 − x 2 + x 4 2 ! − x 6 3 ! + . . . ) d x \begin{aligned}
\text{erf}(z)&=\frac{2}{\sqrt{\pi}}\int_{0}^{z}\sum_{n=0}^{\infty}\frac{(-x^2)^n}{n!}dx \\
&=\frac{2}{\sqrt{\pi}}\int_{0}^{z}\left(1-x^2+\frac{x^4}{2!}-\frac{x^6}{3!}+.\ .\ .\right)dx
\end{aligned} erf ( z ) = π 2 ∫ 0 z n = 0 ∑ ∞ n ! ( − x 2 ) n d x = π 2 ∫ 0 z ( 1 − x 2 + 2 ! x 4 − 3 ! x 6 + . . . ) d x
Taking the integral and applying the limits of integration gives
erf ( z ) = 2 π [ x − x 3 3 + x 5 5 ⋅ 2 ! − x 7 7 ⋅ 3 ! + . . . ] 0 z = 2 π ( z − z 3 3 + z 5 5 ⋅ 2 ! − z 7 7 ⋅ 3 ! + . . . ) = 2 π ∑ n = 0 ∞ ( − 1 ) n z 2 n + 1 n ! ( 2 n + 1 ) \begin{aligned}
\text{erf}(z)&=\frac{2}{\sqrt{\pi}}\left[x-\frac{x^3}{3}+\frac{x^5}{5\cdot2!}-\frac{x^7}{7\cdot3!}+.\: .\: .\right]_0^z \\
&=\frac{2}{\sqrt{\pi}}\left(z-\frac{z^3}{3}+\frac{z^5}{5\cdot2!}-\frac{z^7}{7\cdot3!}+.\: .\: .\right) \\
&=\frac{2}{\sqrt{\pi}}\sum_{n=0}^{\infty}\frac{(-1)^nz^{2n+1}}{n!(2n+1)}
\end{aligned} erf ( z ) = π 2 [ x − 3 x 3 + 5 ⋅ 2 ! x 5 − 7 ⋅ 3 ! x 7 + . . . ] 0 z = π 2 ( z − 3 z 3 + 5 ⋅ 2 ! z 5 − 7 ⋅ 3 ! z 7 + . . . ) = π 2 n = 0 ∑ ∞ n ! ( 2 n + 1 ) ( − 1 ) n z 2 n + 1
Next, we consider the value of the error function at various values of z z z :
erf ( 1 ) ≈ 0.8427008 \text{erf}(1)\approx0.8427008 erf ( 1 ) ≈ 0.8427008
erf ( 2 ) ≈ 0.9953223 \text{erf}(2)\approx0.9953223 erf ( 2 ) ≈ 0.9953223
erf ( 3 ) ≈ 0.9999779 \text{erf}(3)\approx0.9999779 erf ( 3 ) ≈ 0.9999779
erf ( 4 ) ≈ 0.9999999 \text{erf}(4)\approx0.9999999 erf ( 4 ) ≈ 0.9999999
We essentially see that as z z z increases erf ( z ) \text{erf}(z) erf ( z ) get closer and closer to 1.
And so, we can say that
lim z → ∞ erf ( z ) = lim z → ∞ 2 π ∑ n = 0 ∞ ( − 1 ) n z 2 n + 1 n ! ( 2 n + 1 ) = 1 π 2 = lim z → ∞ ∑ n = 0 ∞ ( − 1 ) n z 2 n + 1 n ! ( 2 n + 1 ) \begin{aligned}
\lim_{z\to\infty} \text{erf}(z) &= \lim_{z\to\infty} \frac{2}{\sqrt{\pi}} \sum_{n=0}^{\infty}\frac{(-1)^nz^{2n+1}}{n!(2n+1)} = 1 \\
\frac{\sqrt{\pi}}{2} &= \lim_{z\to\infty}\sum_{n=0}^{\infty}\frac{(-1)^nz^{2n+1}}{n!(2n+1)}
\end{aligned} z → ∞ lim erf ( z ) 2 π = z → ∞ lim π 2 n = 0 ∑ ∞ n ! ( 2 n + 1 ) ( − 1 ) n z 2 n + 1 = 1 = z → ∞ lim n = 0 ∑ ∞ n ! ( 2 n + 1 ) ( − 1 ) n z 2 n + 1
Plotting the convergence of the expression for z = 4 z = 4 z = 4 , as well the expression
rearranged for π \pi π :