Complementary error function in matlab

637 Views Asked by At

Please I really want to know how to verify the following relation in MatLAB

$\text{erfc}(x)\overset{x\rightarrow\infty}{\longrightarrow}\dfrac{e^{-x^2}}{x\sqrt{\pi}}$

1

There are 1 best solutions below

3
On BEST ANSWER

That is not the limit of the complementary error function for $x \rightarrow \infty$ (that's zero). It is also not the asymptotic series expansion of the function. Rather, it is just the first term in the the asymptotic series expansion, but it's a very good approximation.

To find the limit using Matlab, you can use the limit function in the Symbolic Math toolbox:

syms x;
limit(erfc(x),x,Inf)

To find the asymptotic series expansion you're going to have to use MuPAD. However, it is possible to call MuPAD functions from Matlab. Using the series function here is how you can obtain the first terms in the series from Matlab:

syms x;
s = feval(symengine,'series',erfc(x),x==Inf,5)
t1 = feval(symengine,'nthmonomial',s,1)
t2 = feval(symengine,'nthmonomial',s,2)
t3 = feval(symengine,'nthmonomial',s,3)

which returns

t1 =

exp(-x^2)/(pi^(1/2)*x)


t2 =

-exp(-x^2)/(2*pi^(1/2)*x^3)


t3 =

(3*exp(-x^2))/(4*pi^(1/2)*x^5)

In other words, for $x \in \mathbb{R}, x\rightarrow \infty$ and using big O notation:

$$\text{erfc}(x) = \frac{e^{-x^2}}{x \sqrt\pi} (1 + O(x^{-2}))$$

None of this is a "proof" of anything, but you'll be happy to know that the above results match up with what Mathematica returns.