Integrate $\left(x^2e^{x^2}\right)$
Matthew Martinez
$\int\left(x^2e^{x^2}\right)$
First I integrated $$x^2e^{x^2}$$ to get $$F(x)=\frac{x^3}{3}\cdot\frac{1}{2x}\cdot e^{x^2}=\frac{x^3}{3}\cdot\frac{e^{x^2}}{2x} $$
I know this isnt correct, because when I derive $F(x)$ using the product rule I get
$$F'(x)=\frac{x^3e^{x^2}}{3}+\frac{x^2e^{x^2}}{2x}$$
which isnt equal to the function that I was integrating, $$x^2e^{x^2}$$
What did I do wrong?
Thanks in advance :)
$\endgroup$ 43 Answers
$\begingroup$Her is the correct way of doing this. $\int x(xe^{x^{2}})\, dx=\frac 1 2 x(e^{x^{2}})-\int \frac 1 2 e^{x^{2}}$ since $xe^{x^{2}}$ is the derivative of $e^{x^{2}}$. $\int e^{x^{2}}$ cannot be evaluated explicitly.
$\endgroup$ 2 $\begingroup$Try integrating by parts;
$\int x^2 e^{x^2}dx = \int uv' - \int u'v$
$u = x, v' = xe^{x^2}$
$u'=1, v = \frac{e^{x^2}}{2}$
So your integral becomes
$= \frac{xe^{x^2}}{2} - \int\frac{e^{x^2}}{2}dx$
Now you need to use properties of the Error function to get
$= \frac{xe^{x^2}}{2} - \frac{\sqrt{\pi}}{4} \mathrm{erfi}(x)$
Have a read of the wiki page as well
$\endgroup$ 3 $\begingroup$By indeterminate coefficients:
Assume the solution to be of the form $P(x)e^{x^2}$ for some polynomial $P$. Then
$$(P(x)e^{x^2})'=(P'(x)+2xP(x))e^{x^2}.$$
For the left factor to equal $x^2$, $P$ must be of the first degree, let $ax+b$.
Now
$$P'(x)+2xP(x)=a+2x(ax+b)$$
and by identification
$$a=\frac12,b=0,a=0.$$
Hey, what is going on ? Identification is not possible, we are in a dead end. The fact is that there is no solution of the form $P(x)e^{x^2}$!
If we consider the partial solution $\dfrac x2e^{x^2}$, the derivative is
$$ x^2e^{x^2}+\frac12e^{x^2}.$$
Hence we remain with the extra term $e^{x^2}$, which is known to have no closed-form antiderivative and requires the so-called error function.
$\endgroup$