I'm trying to implement an equation into a programming language which doesn't have functions for integrals. However as it's many years since I've had any math exercise I'm having some trouble understanding how I can simplify the following equation.

$$\mathrm{erf}(x) = \frac{1}{\sqrt{\pi}} \int_{-x}^x e^{-t^2} dt.$$

As an example would it be correct to refactor the equation as follows?

$$\frac{1}{\sqrt{\pi}} \cdot \left(x \cdot e^{-x^2}+(-x) \cdot e^{x^2}\right)$$

Please forgive me if I'm completely off target! As I said, it's been quite a few years since I've had integrals.

  • 3
    $\begingroup$ It can't be simplifed. Your programming language probably has a function for it though. It is called the "error function". $\endgroup$ – Samuel Apr 9 '13 at 8:47
  • 2
    $\begingroup$ You might want to see this. $\endgroup$ – J. M. is a poor mathematician Apr 9 '13 at 8:58

You can find many facts about the error function here: Error function

For example have a look at the sections Taylor series and Approximation with elementary functions - they might help you to implement this function into your programming language.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.