TITLE: Integration by parts or substitution?
QUESTION [5 upvotes]: $$\int_{}^{}x e^x \mathrm dx$$
One of my friends said substitution , but I can't seem to get it to work.
Otherwise I also tried integration by parts but I'm not getting the same answer as wolfram.
The space in the question seems like it shouldn't take more than 2 lines though. Am I missing something?
Thanks to all the answers below , I messed up in the original question it was actually 
$$\int_{}^{}x e^{x^2} \mathrm dx$$
With help from the below answers I did the following:
Let $u = x^2$ , then $du=2x\mathrm dx$
So rewriting the integral
$$\int_{}^{}{{x\cdot e^u} {1 \over 2x}} \mathrm dx$$
Simplifying yields:
$${1 \over 2x}\int_{}^{}{e^u}\mathrm dx$$
Which in turn yields:
$${\frac{e^u}{2}} + C$$ 
The rest is fairly obvious!

REPLY [5 votes]: Yes you can solve it by substitution (which is not trivial in this case) but you can choose:
$$u = e^x(x-1) \rightarrow du=xe^xdx\rightarrow dx=\dfrac{du}{xe^x}$$ 
Replacing in the integral, you get:
$$\int{xe^x \mathrm dx}= \int{du=u+C=e^x(x-1)}+C$$
NOTE the easiest way to solve the integrals in this form ($P_1(x)e^x$) is by using integration by parts