How do you integrate #int x^2e^-x# by integration by parts method?

2 Answers
Jul 24, 2016

#= - e^-x ( x^2 + 2x + 2) + C#

Explanation:

#int \ x^2e^-x \ dx#

#= int \ x^2d/dx( - e^-x) \ dx#

which by IBP means
#= - x^2 e^-x - int \ - e^-x d/dx(x^2 ) \ dx#

#= - x^2 e^-x + int \ e^-x * 2x\ dx#

setting up one more round of IBP

#= - x^2 e^-x + int \ d/dx( - e^-x) * 2x\ dx#

#= - x^2 e^-x + ( - e^-x)* 2x - int \ - e^-x * d/dx( 2x)\ dx#

#= - x^2 e^-x - 2x e^-x + 2 int \ e^-x\ dx#

#= - x^2 e^-x - 2x e^-x - 2 e^-x + C#

#= - e^-x ( x^2 + 2x + 2) + C#

Jul 24, 2016

#-e^{-x}(x^2+2x+2+C_1)#

Explanation:

#d/(dx)(x^n e^{-x})=nx^{n-1}e^{-x}-x^n e^{-x}#

Calling #I_n = int x^n e^{-x}dx# we have

#I_n-nI_{n-1}=-x^n e^{-x}#

making now #J_n = e^xI_n# we obtain a simpler recurrence relation

#J_n-nJ_{n-1} = -x^n#

This recurrence formulation allows us to obtain the general solution for the integral

#int x^n e^{-x}dx#

Now doing #n=2# we have

# {(J_2-2J_1=-x^2), (J_1-J_0 = -x) :}#

Multiplying the second equation by #2# and adding with the first we obtain

#J_2-2J_0=-x^2-2x#

but #J_0 = e^xI_0 = e^x int e^{-x}dx = -1+C#

so

#J_2 = e^x I_2 = -x^2-2x-2+2C#

Finally

#I_2 = -e^{-x}(x^2+2x+2+C_1)#