How to integral: $\int x^{2}e^{-\frac{x}{2}}dx$? How to integral: $\int x^{2}e^{-\frac{x}{2}}dx$ ?
I try to use the rule: $\int udv=uv-\int vdu$, and 
$u=x^{2}, du=2xdu, dv=e^{-\frac{x}{2}}dx, v=-2e^{-\frac{x}{2}}$, and 
$\int x^{2}e^{-\frac{x}{2}}dx=x^{2}\cdot (-2e^{-\frac{x}{2}})-\int (-2e^{-\frac{x}{2}})2xdx$
However, it doesn't simplify anything.
 A: $$\dfrac{d(x^ne^{mx})}{dx}=mx^ne^{mx}+nx^{n-1}e^{mx}$$
Integrate both sides to find $$x^ne^{mx}+k=nI_{n-1}+mI_n\implies I_n=?$$
where $\displaystyle I_n=\int x^ne^{mx}\ dx$
Here $n=2$
A: It actually simplify it. You reduce the order of the polynomial in the integral $\int x^k \cdot e^{x} dx$. (Integration by Parts is the general method to solve that). Apply it again on $\int x \cdot e^{\frac{-x}{2}} dx$ and you'll find out the answer. There also exists a method by using the Taylor expansion of exponential and turning the integral problem into a sum problem.
A: Guide:
$$\int x^{2}e^{-\frac{x}{2}}dx=x^{2}\cdot (-2e^{-\frac{x}{2}})-\int (-2e^{-\frac{x}{2}})2xdx=-2x^2\exp(-\frac{x}2)+4\int x\exp(-\frac{x}2)\, dx$$
Now, we just have to focus on $\int x \exp(-\frac{x}2)\, dx$.
Let $u=x, du=dx, dv=\exp(-\frac{x}2)\, dx,v=-2\exp(-\frac{x}2). $
After you perform another integration by part, you still have to integrate the exponential function one more time.
A: Another option is $$\int_0^xt^2\exp -atdt=\partial_a^2\int_0^x\exp -atdt=\partial_a^2\frac{1-\exp -ax}{a}=\frac{2-(2+2ax+a^2x^2)\exp -ax}{a^3},$$which we can double-check by noting the above vanishes if $x=0$ and has $x$-derivative $x^2\exp -ax$ as required. Substiuting $a=\frac12$ gives $16-(16+8x+4x^2)\exp -x/2$. For an indefinite integral, just replace the first $16$ with $C$.
