Skip to main content

Integral of $e^{x^2}$

Using the Taylor series is a straight forward method, but let us try to approach the problem in a different manner.

Integration by Parts

NOTE: This method requires working knowledge of integration by parts.

When I tried to solve this problem, I first started to expand it using the integration by parts method. The pattern I observed was the thing which helped me put myself on the right track to solve this problem. Here is the pattern:
$$\int e^{x^2}dx = xe^{x^2} - 2\int x^2e^{x^2}dx$$
$$3\int x^2e^{x^2}dx = x^3e^{x^2} - 2\int x^4e^{x^2}dx$$
$$5\int x^4e^{x^2}dx = x^5e^{x^2} - 2\int x^6e^{x^2}dx$$
To make sure this pattern sustains, I decided to find the integral of $x^{2n}e^{x^2}$.
$$Y = \int x^{2n}e^{x^2}dx$$
$$Y = x^{2n+1}e^{x^2} - \int x[2nx^{2n-1}e^{x^2}+2x^{2n+1}e^{x^2}]dx$$
$$(2n+1)Y = x^{2n+1}e^{x^2}-2\int x^{2n+2}e^{x^2}dx$$
$$\therefore Y = \frac{x^{2n+1}e^{x^2}}{2n+1}-\frac{2}{2n+1}\int x^{2n+2}e^{x^2}dx$$
Note that the $\int x^{2n+2}e^{x^2}dx$ is similar to Y, with $n$ replaced by $n+1$. Expanding according to the above,
$$Y = \frac{x^{2n+1}e^{x^2}}{(2n+1)}-\frac{2^1x^{2n+3}e^{x^2}}{(2n+1)(2n+3)}+\frac{2^2x^{2n+5}e^{x^2}}{(2n+1)(2n+3)(2n+5)}-...$$
Placing $n=0$ since we want $\int e^{x^2}$,
$$Y_{n=0} = \frac{2^0x^1e^{x^2}}{1} -\frac{2^1x^3e^{x^2}}{1.3} +\frac{2^2x^5e^{x^2}}{1.3.5}-\frac{2^3x^7e^{x^2}}{1.3.5.7} +...$$
$$Y_{n=0}=\sum_{i=1}^{\infty} (-1)^{i+1}\frac{2^{i-1}x^{2i-1}e^{x^2}}{1.3.5...(2i-1)}$$

Integration using the $\operatorname{erf}$ function

As stated in The $\operatorname{erf}$ function, one can use it to find the integral of $e^{x^2}$, as well as $e^{-x^2}$.
Since $\int_0^x{\mathrm e}^{-t^2}{\mathrm d}t = \sqrt{\frac{\pi}2}\operatorname{erf}(x)$,
$$\int_0^x{\mathrm e}^{t^2}{\mathrm d}t = -i\sqrt{\frac{\pi}2}\operatorname{erf}(ix)$$
You can proceed to use the various series expansion of $\operatorname{erf}(x)$ to complete this problem.

Footnote: If you have an another method to solve this particular problem through which we can obtain the integral in a more creative and easier manner, please contact any of the writers in this blog.

Comments

Popular posts from this blog

Factorials, and the Gamma Function

What is the Gamma function? What does it have to do with the factorial of a number? And why does such a formula even work? The Factorial In our high school combinatorics course, we were introduced to the factorial of a natural number. We defined the factorial of a number $n$ to be the product of all the natural numbers till $n$. Or symbolically: $$n! = 1 . 2 . 3 ... (n-2)  (n-1)  n$$ This is a very useful function in Counting problems. This function also pops up in the exponential function: $$e^x = 1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+...$$ Setting this aside, we think: can we 'extend' this function to all real number? Surely, even if we were to come up with such a function, what would it mean to take this new 'factorial' of some real number? Well, let's take a look at one important property of the factorial function: $$n! = n(n-1)!$$ and this is true for all natural numbers $n$. So, even if we came up with this homologous function, we...

The $\operatorname{erf}$ function

Can a function be 'defined' as the anti-derivative of another function? $\operatorname{erf}$ is one such function. Even though it has various proper infinite series expansions (as in Wolfram MathWorld - Erf ), it is defined by mathematicians as such: $$\operatorname{erf}(z) \equiv \frac{2}{\sqrt{\pi}}\int_0^ze^{-t^2}dt$$ This function has extensive implications in statistics, and can be used to express the integral of $e^{-x^2}$ and $e^{x^2}$. See the post that tries to find  integral of $e^{x^2}$  - we need not use integration by parts there, but rather can use the $\operatorname{erf}$ function. Source: Wolfram MathWorld

Problems that deceive you #1

Let us look at one of the most easiest problems in calculus $$\int_0^{\frac{\pi}{2}}\sqrt{4\sin^2\frac{x}{2}-4\sin\frac{x}{2}+1}\; dx$$ Seems pretty simple and straightforward, doesn't it? Inside the square root, the expression evaluates to $(2\sin\frac{x}{2}-1)^2$, and thus the integral will be $$\int_0^{\frac{\pi}{2}}\Bigl(2\sin\frac{x}{2}-1\Bigr)dx$$ This then can be evaluated by the following: $$\biggl[-4\cos\frac{x}{2} -x\biggr]_0^{\frac{\pi}{2}}$$ Hold on for the surprise... Its wrong! What seemed like a really straightforward and easy problem, is designed in such a way to appear easy so that we approach the wrong way. Why is the approach wrong? We did not consider the fact that a simple square root symbol represents its principal square root i.e., the positive square root. That means each and every value the expression inside the original integral evaluates to a positive quantity. But that is not the case when we simplified the integral to  $$\int...