# Integration by parts $\int xe^{x^2} dx$.

Find with integration by parts $$\int xe^{x^2} dx$$.

$$\int xe^{x^2} dx$$

Let $u(x) = x \ \ \ v^{'}(x) = e^{x^2}$

Now I can write the integral as $$\int xe^{x^2} dx = x \int e^{x^2} dx - \int\left(\int e^{x^2} dx \right) dx$$

Even after trying everything I am unable to solve $v^{'}(x) = e^{x^2}$ for $v(x)$.

I can do this question substitution $u = x^2$ but I told use integration by parts to do this question. What should I do ?

• No need to do any black magic operation on this one : $\int xe^{x^2} = \frac12\int 2xe^{x^2} = \frac12e^{x^2}$... Apr 4 '17 at 16:41
• There is no closed form for $v(x)$. You are going to have to use a different $u,v'$. Apr 4 '17 at 16:41
• Are there any limits of integration? Apr 4 '17 at 16:45
• @zahbaz No, I need to find indefinite integral.
– user312097
Apr 4 '17 at 16:49
• @ThomasAndrews How do you know that ?
– user312097
Apr 4 '17 at 16:49

Take $u=e^{x^2}$ then $du=2xe^{x^2}$ and $v=\frac{x^2}{2}$ so $$\int xe^{x^2}dx=\frac{x^2e^{x^2}}{2}-\int x^3e^{x^2}dx$$ Take $u=e^{x^2}$ and $dv=x^3$ then $$\int x^3e^{x^2}dx=\frac{x^4}{4}e^{x^2}-\frac{1}{2}\int x^5e^{x^2}dx$$ Similary $$\int x^5e^{x^2}dx=\frac{x^6}{6}e^{x^2}-\frac{1}{3}\int x^7e^{x^2}dx$$ In general $$\int x^{2n+1}e^{x^2}dx=\frac{x^{2n+2}}{2n+2}e^{x^2}-\frac{1}{n+1}\int x^{2n+3}e^{x^2}dx$$ From that we can take a few terms and notice that $$\int xe^{x^2}dx=\frac{x^2}{2}e^{x^2}-\frac{x^4}{4}e^{x^2}+\frac{x^6}{12}e^{x^2}-\frac{x^8}{48}e^{x^2}+\frac{x^{10}}{240}e^{x^2}+\cdots\\\int xe^{x^2}dx=\frac{e^{x^2}}{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}x^{2k}}{k!}$$Now with few adjustments you'll get$$e^{-x^2}=\sum_{k=0}^\infty\frac{(-1)^kx^{2k}}{k!}=1+\sum_{k=1}^\infty\frac{(-1)^kx^{2k}}{k!}=1-\sum_{k=1}^\infty\frac{(-1)^{k+1}x^{2k}}{k!}\\\int xe^{x^2}dx=\frac{e^{x^2}}{2}\left(1-e^{-x^2}\right)=\frac{e^{x^2}}{2}+C$$

• Why you don't write $dx$ in the end ?
– user312097
Apr 4 '17 at 17:56
• @A---B Bad habit I guess (edited though) Apr 4 '17 at 17:57
• I would have accepted your answer happily if I known anything about infinite sums. I cannot understand the adjustments to $$\frac{e^{x^2}}{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}x^{2k}}{k!}$$.
– user312097
Apr 4 '17 at 18:00
• @A---B Fair enough,this isn't a elementary approach,if you wanna learn more here's a link to the power series of $e^x$.plugging in $(-x^2)$ instead of $x$ you get the above sum without $(-1)^k$ and without the term that corresponds to $k=0$ which is why the $1$ Apr 4 '17 at 18:03
• This is definitely a proof from "The Book", specifically this book. Apr 4 '17 at 18:20

If you absolutely want to write the integration in the form of an integration by part use: $$v'=xe^{x^2} \quad \rightarrow \quad v=\frac{1}{2}e^{x^2}$$ and $$u=1 \quad \rightarrow \quad u'=0$$

• Haha this answer will surely infuriate the teacher :) Apr 4 '17 at 16:57
• Well I take this happily but I am looking for an answer that does not use $u = c \in \mathbb{R}$.
– user312097
Apr 4 '17 at 16:58
• Seriously OP you have been trolled. Apr 4 '17 at 16:59
• @samjoe I know but I don't have any other answer.
– user312097
Apr 4 '17 at 17:00
• The primitive if $v(x)=e^{x^2}$ can be expressed only using the erf function. So really I don't see any way to use integration by parts in a ''not joke'' manner. Apr 4 '17 at 17:07

Alternatively, with the change of variable $$u=e^{x^2}, \qquad du =2xe^{x^2},$$ one has $$\int xe^{x^2}dx=\frac12\int du$$ which is easy to evaluate.

• Sir he has already said that he needs by parts approach. Apr 4 '17 at 16:41
• Did you read to the end of the question? Apr 4 '17 at 16:41
• @ThomasAndrews That's why I wrote 'Alternatively'... Apr 4 '17 at 16:42
• @ThomasAndrews Here I prove it. I'm not writing only for the OP... I must confess I did not read the end of the question, but I think my answer worth to be written. Apr 4 '17 at 16:44
• Thank Olivier but I need to do by integration by parts.
– user312097
Apr 4 '17 at 16:53

Take $e^{x^2}$ as the first function and apply rule of by parts, you get

$\int e^{x^2}x dx =e^{x^2}\frac{x^2}{2}-\int x^3.e^{x^2}dx$.....$(A)$

Now $\int x^3e^{x^2}dx=\frac{1}{2}\int t.e^t dt$ where $x^2=t$ and $2xdx=dt$ (Assuming that your teacher didn't mean to completely reject substitution). On integration, it gives $\frac{1}{2}e^t(t-1)$ or $\frac{1}{2}e^{x^2}(x^2-1)$.

Substitute it in $(A)$ to get the answer.