The integral of the product of two functions may be verbally given as,
"First function into integral of the second minus integral of the derivative of the first into integral of the second." Which is nothing but, integration by parts.
Now, one thing that must be noted is that, the correct choice of first function and second function can either make or break a problem.
The correct choice can vastly simplify and an incorrect one can put you in a lot of trouble.
#int x*e^x dx# is the integral we need to evaluate.
If we use #e^x# as the first function and #x# as the second and integrate by parts,
#int x*e^x*dx = e^x int x*dx - int (e^x int x*dx)*dx#
#= e^x*x^2/2 - int e^x*x^2/2*dx + C#
If we apply integration by parts to the second term, we again get a term with a #x^3# and so on.
This, not only complicates the problem but, spells disaster.
But, if we had chosen #x# to be the first and #e^x# to be the second, the integral would have been very simply to evaluate.
#int x*e^x*dx = x int e^x*dx - int (d/(dx)x int e^x*dx)*dx#
#= e^x*x - e^x + C#