# How do I solve equations involving the error function?

In my heat transfer classes, we encounter the Gaussian error function when dealing with unsteady heat conduction of a semi-infinite surface. The equation I have to solve is usually of the form:

$$\text{erf}(x)=c$$

where $$c$$ is a number and $$x$$ is the variable.

For these questions, the method I use involves guessing a bunch of $$x$$'s and getting them as close to $$c$$ as possible. I can compute error function in my scientific calculator using:

$$\text{erf}(x)=\frac{2}{\sqrt{\pi}}\int_{0}^{x}{e^{-u^2}du}$$

The other method I know involves quadratic interpolation about three nearby points, but obtaining the polynomial and solving it is too time-consuming, so that's ruled out as well.

I would appreciate any method to compute error function equations which can be done reasonably by a scientific calculator. I knew the error function had an inverse, but I couldnt find a suitable form which I can compute via calculator.

• You can use Newton-Raphson method of root finding, which has quadratic convergence, and only requires computing the function and its derivative. Both of which you can do – Yuriy S Aug 7 at 16:09
• @YuriyS wow I haven't thought of that, silly me. Can you please post it as an answer so I can accept it and call it closed? Thank you. – Pritt Balagopal Aug 7 at 16:11
• I don't like giving short answers, so you can do it yourself if you want. I would also like to point out that, depending on the argument range, the error function can be computed by its Taylor series, or its asymptotic series, rather than the integral. Though it only matters if you need to optimize the algorithm for speed. – Yuriy S Aug 7 at 16:41

$$x_n=x_{n-1}-\frac{c-\int_{0}^{x_{n-1}}{e^{-u^2}du} }{-e^{-x_{n-1}^2}}$$
A suitable choice of $$x_0$$ is required for a speedy convergence.