Evaluate the integral $\int_0^{\infty} x^3e^{-x^2}$ I used integration by parts since we have two functions multiplied by each other. 
$u=x^3$ $du=3x^2$ $dv=e^{-x^2}$ $v=-e^{-x^2}$
setting up got me:
$-x^3e^{-x^2}-\int -3x^2e^{-x^2}$ I then repeated the same steps over again and integrated by parts again
setting $u=-3x^2$ $du=-6x$ $v=e^{-x^2}$ $dv=-e^{-x^2}$
and obtained:
$-x^3e^{-x^2}--3x^2e^{-x^2}-\int -6xe^{-x^2}$
Doing so again gave me:
$-x^3e^{-x^2}+3x^2e^{-x^2}-6xe^{-x^2}-\int -6e^{-x^2}$
$-x^3e^{-x^2}+3x^2e^{-x^2}-6xe^{-x^2}+6e^{x^2}$
evaluating this final answer gives something that doesn't make sense, so I'm guessing that the approach to this problem was wrong but why? I was always under the impression that if you have two functions multiplied by each other then you integrate by parts, why on earth does that not work in this situation?
 A: Your choice of $dv$ does not work in your very first step, because $$\int e^{-x^2} \, dx \ne -e^{-x^2}.$$  You will find that taking the derivative of $e^{-x^2}$ yields, by the chain rule, $-2x e^{-x^2}$, and this in turn suggests that a suitable choice of $dv$ should be $$dv = x e^{-x^2} \, dx, \quad v = -\frac{1}{2} e^{-x^2}.$$  This then motivates the choice $$u = x^2, \quad du = 2x \, dx,$$ yielding $$\int x^3 e^{-x^2} \, dx = -\frac{1}{2} x^2 e^{-x^2} + \int x e^{-x^2} \, dx.$$  Then we observe that this remaining integral is one we have already done, namely it was our choice of $dv$ above; thus $$\int x^3 e^{-x^2} \, dx = -\frac{1}{2} x^2 e^{-x^2} - \frac{1}{2} e^{-x^2} + C.$$
An alternative approach that still involves integration by parts but is perhaps computationally easier, is to first write the integrand as $$x^3 e^{-x^2} = \frac{1}{2} x^2 \cdot 2x \cdot e^{-x^2},$$ and now we choose the substitution $y = x^2$, $dy = 2x \, dx$, to obtain $$\int x^3 e^{-x^2} \, dx = \frac{1}{2} \int y e^{-y} \, dy.$$  This is now amenable to integration by parts with the simpler choice $u = y$, $du = dy$, $dv = e^{-y} \, dy$, $v = -e^{-y}$.
A: Write $u(x)=x^2$ and $v(x)=-{1\over 2}e^{-x^2}$, $\int u(x)v'(x)dx=\int x^3e^{-x^2}dx= uv]-\int -xe^{-x^2}dx$ $=uv]_0^{\infty}-{1\over 2}e^{-x^2}]_0^{\infty}={1\over 2}.$
A: First do a substitution, $$u=x^2.$$
A: You did a mistake here
$u=x^3$ $du=3x^2$ $dv=e^{-x^2}$ $v=-e^{-x^2}$
$$v=-e^{-x^2} \implies dv=2xe^{-x^2}dx$$
It's not the best choice for an integration by part..
It's far better to choose $u=x^2$ 
Hint
Substitute $u=x^2$
$$I=\int x^3e^{-x^2}=\frac 1 2\int ue^{-u}du=\frac 1 2(-ue^{-u} -e^{-u})=-\frac 1 2e^{-u}(u+1)$$
$$I=-\frac 1 2e^{-x^2}(x^2+1)$$
A: It's actually more simple than that. To evaluate an improper integral, you must use limits to take care of the upper limit as such:
Set $u=x^2$ and $du=2xdx$. 
$$\lim\limits_{b\rightarrow\infty}\frac{1}{2}\int_{0}^b e^{-u}u\text{ }du$$
Now we use integration by parts
$$\lim\limits_{b\rightarrow\infty}\Bigl(-\frac{1}{2}e^{-u}u\Bigr)\Big|_{0}^{b}-
\lim\limits_{b\rightarrow\infty}\frac{1}{2}\int_{0}^b e^{-u}\text{ }du$$
Where $\lim\limits_{b\rightarrow\infty}\Bigl(-\frac{1}{2}e^{-u}u\Bigr)\Big|_{0}^{b}=\lim\limits_{b\rightarrow\infty}\bigl(0+0\bigr)=0$ then we are left with 
$$\lim\limits_{b\rightarrow\infty}\frac{1}{2}\int_{0}^b e^{-u}\text{ }du
=\frac{1}{2}\lim\limits_{b\rightarrow\infty}\bigl(-e^{-b}+e^{0}\bigr)=\frac{1}{2}\bigl(0+1\bigr)=\frac{1}{2}$$


TIP: If you are integrating a function $\int f(x)g(x)dx$  using integration by parts, then you should always make sure to check which one of
$$u=f(x);\text{   } dv=g(x)dx$$
and
$$u=g(x)dx;\text{   } dv=f(x)$$
is the better choice for your substitution. Usually, you will know which one will lead to an easier integration just by checking.

