4

$\int e^{-x^2} \, \mathbb{d} x$, the Gaussian integral, is notorious throughout physics and statistics. Its definite integral defined over $\mathbb{R}$ is $\sqrt{\pi}$. However, the current indefinite integral is not an elementary solution.


Recently I thought about an integration technique that uses "error correcting." If we define a function $f(x)$ such that $f^{(n)}(x)$ still contains terms from $f(x)$ (most likely $f(x)$ will always contain $e^x$), then we can take its derivative, set it up to attempt at the integral, and correct any errors until solution is satisfied. Here's how I went about it: $$\int e^{-x^2} \, \mathbb{d} x \\ \frac{\mathbb{d}}{\mathbb{d}x} [e^{-x^2}] = -2xe^{-x^2}$$ We can therefore take a naïve guess and state that: $$\int e^{-x^2} \, \mathbb{d} x = -\frac 1 {2x} e^{-x^2}$$ This isn't true, because differentiated, the result is: $$e^{-x^2} (1 + \frac 1 {2x^2})$$ Using this, we could try to subtract $\frac{e^{-x^2}}{2x^2}$ from our first approximation of the integral (again, naïve): $$\int e^{-x^2} \, \mathbb{d} x = e^{-x^2} (-\frac 1 {2x} - \frac 1 {2x^2})$$ Differentiating: $$e^{-x^2}(1 + x^{-1} + \frac 1 2 x^{-2} + x^{-3})$$ The last three terms seem pretty simple to take the integral of, so if we subtract the integral of those three terms from our guess, perhaps we could obtain the correct answer. Let $\phi$ be our approximation. $$\phi = e^{-x^2} (-\frac 1 {2x} - \frac 1 {2x^2}) - (\int \frac {e^{-x^2}} x \, \mathbb{d} x + \int \frac{e^{-x^2}} {x^2} \, \mathbb{d} x + \int \frac{e^{-x^2}} {x^3} \, \mathbb{d} x)$$ $$\int \frac {e^{-x^2}} x \, \mathbb{d} x$$ Let us substitute $u = x^2$ and $\mathbb{d}u = 2x \mathbb{d}x$. $$\frac 1 2 \int \frac {e^{-u}} u \, \mathbb{d} u$$ Substitute $A = e^{-u}$ and $\mathbb{d}A = -e^{-u}$. $$\frac 1 2 \int \frac {\mathbb{d}A} {\ln A}$$ This is a relatively simple integral. $$\frac 1 2 \int \frac {\mathbb{d}A} {\ln A} = \frac 1 2 (\ln |\ln A| + \ln A + \sum_{k=2}^{\infty} \frac{\ln^k A}{k k!})$$ We can do the exact same substitution for $\int \frac{e^{-x^2}} {x^3} \, \mathbb{d} x$. $$\int \frac{e^{-x^2}} {x^3} \, \mathbb{d} x = \frac 1 2 \int \frac {\mathbb{d}A} {\ln^2 A} \\ = \frac 1 2 (\ln |\ln A| + \ln A + \sum_{k=2}^{\infty} \frac{\ln^k A}{k k!} - \frac A {\ln A})$$ However, $\int \frac{e^{-x^2}} {x^2} \, \mathbb{d} x$ requires a different substitution. Substitute $u = x^4$, $\mathbb{d}u = 4x^3 \mathbb{d}x$, $G = e^{-u^{1/2}}$, and $\mathbb{d}G = -\frac 1 2 u^{-1/2} e^{-u^{1/2}} \mathbb{d}u$. $$\int \frac{e^{-x^2}} {x^2} \, \mathbb{d} x = \frac 1 2 \int \frac{\mathbb{d}G}{\ln^2 G} \\ = \frac 1 2 (\ln |\ln G| + \ln G + \sum_{k=2}^{\infty} \frac{\ln^k G}{k k!} - \frac G {\ln G})$$ If we substitute, we find that the integral of $e^{-x^2}$ should be: $$-e^{-x^2}(\frac 1 {2x} + \frac 1 {2x^2}) + \frac 3 2 (\ln|x^2| - x^2 + \sum_{k=2}^{\infty}\frac{(-x^2)^k}{k k!}) + \frac {e^{-x^2}}{x^2}$$ However, I believe this evaluates to (when differentiated): $$e^{-x^2} + \frac 2 x (e^{-x^2} + \frac{e^{-x^2}} x) - \frac {e^{-x^2}} {x^3}$$ I may have made an error in that calculation. Either I am close or I have errored in the final product. Either way, is this a valid method? If so, could someone point out my error? If not, what is the issue?

cygorx
  • 339
  • 2
    This is a nice idea, but I'm sorry to tell you that there's proof that there is no elementary formula for the integral. If you're okay with a series, just expand $ e^{-x^2} $ and integrate term by term. – Javier Jan 01 '14 at 06:28
  • @JavierBadia where is the proof? – cygorx Jan 01 '14 at 06:29
  • 1
    @cygorx Here, among the various options. – Ryan Reich Jan 01 '14 at 06:30
  • @JavierBadia This may even be a better option with more possible sources for you to look at: http://math.stackexchange.com/questions/155/how-can-you-prove-that-a-function-has-no-closed-form-integral – mathematics2x2life Jan 01 '14 at 06:31
  • Fair enough. I'd like to see a proof against my particular method though. – cygorx Jan 01 '14 at 06:33
  • 2
    Your approach is "valid" insofar as it is a good approximation, and better yet, a good technique for building up better approximations. To me, it looks like an integral version of Taylor's theorem. – nomen Jan 01 '14 at 06:33
  • 2
    @nomen How is it producing valid approximations? Differentiation does not product anything even close to the original integrand and try using a definite integral to see that the answers would not come close to matching! For example, try comparing by using $\int_{-0.5}^{10}$ or even $-\infty$ to $\infty$ does not product the correct $\sqrt{\pi}$. Not to mention the fact that the integral is defined over $x$'s that 'travel through' $x=0$ whereas the approximation here is even not valid at $x=0$! – mathematics2x2life Jan 01 '14 at 07:27
  • @nomen Also, something akin to Taylor's theorem would produce $x$'s in the numerator, not the denominator. So this would be more akin to a Laurent series. – mathematics2x2life Jan 01 '14 at 07:29
  • @mathematics2x2life I don't think you get it. – cygorx Jan 03 '14 at 04:58
  • @cygorx Given that your method doesn't produce correct results, I'm not so sure you get it. – mathematics2x2life Jan 03 '14 at 06:03
  • @mathematics2x2life Show me the error and I will believe you. – cygorx Jan 03 '14 at 17:16
  • @cygorx I have already pointed out some glaring errors in my previous comments. Moreover, differentiating your "approximations" do not produce anything close to $e^{-x^2}$. Nor do they produce anything close to the correct answer when treating it as an approximation to the definite integral. Furthermore, they are not even defined over the same domains! Even further, the general approach shows a lack of understanding on how to 'fix' problematic integrals. One simply cannot divide by the problem as you attempt to do. Alas, integration doesn't work like that. – mathematics2x2life Jan 03 '14 at 17:25
  • @cygorx Unfortunate, too, that it does not as it makes our jobs as mathematicians harder. Now you also have glaring redundancies such as $\log|x^2|$ which is clearly $\log x^2$ and $1/(kk!)$ which is clearly $1/(k+1)$. What your approximation ends up doing by the end is an incorrect attempt at reconstructing the integrated Taylor Series for $e^{-x^2}$, which is probably more the approximation you are looking for anyway. If you want a simple statement of the issues, it's this: dividing by the 'problem' part of the integration like you did in your first steps won't work. – mathematics2x2life Jan 03 '14 at 17:28
  • @mathematics2x2life No, it's not a problem of not understanding. It's just a different, native approach. I think you should re-read the post. The fact that the two integrals are not defined over the same domains is quite true. The way you're describing the process doesn't seem to be quite accurate, however. – cygorx Jan 03 '14 at 17:32
  • @cygorx It gets rid of the problematic part of the integral during differentiation only if you ignore the term you just divided by. However, during differentiation, this will create new terms and doesn't cancel things the way you'd hope and makes the approximation fail. Trying to fix the fix as you do doesn't create a better approximation, it just compounds the problem. Finally, looking at the approximations over neighborhoods that don't include the origin result in approximations that say $\int e^{-x^2}dx=e^{-x^2}$, which simply isn't true. – mathematics2x2life Jan 03 '14 at 17:33
  • @mathematics2x2life Yeah, okay, got it now. You definitely don't understand the method, please reread the OP. – cygorx Jan 03 '14 at 17:34
  • @cygorx It is a problem of understanding. I know you want this approach to work, but wanting it to work doesn't make the mathematics work. This simply doesn't work. You obviously haven't bothered to sit down and do the checks. I can't stress enough, this is not a correct method. Moreover, it is known this has no closed form solution. I'm not saying this method can't ever work, but what you are doing and the terms you are using produce very incorrect solutions. Don't be a person trying to square the circle, rethink the approach. – mathematics2x2life Jan 03 '14 at 17:36
  • 1
    You have expressed the antiderivative as a power series (I hold no opinion on whether your expression is correct). This can be done easily by writing down the power series for $e^{-x^2}$ and antidifferentiating term-by-term. – Gerry Myerson Jan 03 '14 at 21:11
  • That would seem to have no bearing on my comment. – Gerry Myerson Jan 03 '14 at 22:40

1 Answers1

8

EDIT: As noted in the comments, formulas (1) and (2) are wrong. I think what happened is that for some reason I worked with $e^{-x^2/2}$ instead of $e^{-x^2}$. I'll put the correct formulas at the end.

The author finds $$\int e^{-x^2}=A(x)+\sum^{\infty}a_kx^k$$ where $A(x)$ is a simple, elementary function, and the $a_k$ are also simple functions of $k$. I take the opportunity to point out that one can reach such a conclusion a lot faster by noting $$e^{-x^2}=1-(1/2)x^2+(1/2)(1/4)x^4-(1/6)(1/8)x^6+(1/24)(1/16)x^8+\cdots\tag1$$ and integrating term-by-term to get $$\int e^{-x^2}=x-(1/2)(1/3)x^3+(1/2)(1/4)(1/5)x^5-(1/6)(1/8)(1/7)x^7+(1/24)(1/16)(1/9)x^9+\cdots\tag2$$ The general term here is $(-1)^k(1/k!)(1/2^k)(1/(2k+1))x^{2k+1}$.

As noted earlier, (1) and (2) are actually formulas for $e^{-x^2/2}$ and $\int e^{-x^2/2}\,dx$. The correct formulas are, $$e^{-x^2}=1-x^2+(1/2)x^4-(1/6)x^6+(1/24)x^8+\cdots\tag3$$ and $$\int e^{-x^2}=x-(1/3)x^3+(1/2)(1/5)x^5-(1/6)(1/7)x^7+(1/24)(1/9)x^9+\cdots\tag4$$ The general term here is $(-1)^k(1/k!)(1/(2k+1))x^{2k+1}$.

Gerry Myerson
  • 179,216