5

$$\int x^2e^{\frac{x^2}2} \, dx$$

I do not need to evaluate $\int e^{\frac{x^2}{2}}$ in a numeric method.

If we take $u=x^2, u'=2x$ $v'=e^{\frac{x^2}{2}},v=\int e^{\frac{x^2}2}\,dx$

we get:

$$\int x^2e^{\frac{x^2}{2}} \, dx = x^2\int e^{\frac{x^2}{2}} \,dx-2\int \left( x \int e^{\frac{x^2}2} \,dx\right) dx\text{?}$$

How can the solution be $\displaystyle xe^{\frac{x^2}2}-\int e^{\frac{x^2}{2}}dx$?

gbox
  • 12,867
  • @Evariste it is a part of and ODE, I do not need to use the Gamma function, I just can not understand how they got to that solution if they used integration by parts – gbox Jan 17 '17 at 18:24
  • Never mind, I misinterpreted your question* – Evariste Jan 17 '17 at 18:25
  • (Regarding to my answer that I deleted) You are usually right, though I won't work here, and I'm not sure my method would work either after all... – E. Joseph Jan 17 '17 at 18:30
  • 1
    $$\int e^{\frac{x^2}{2}} \ dx= \sqrt{\frac{\pi}{2}} \text{erfi} \left( \frac{x}{\sqrt{2}} \right) $$ where $\text{erfi}$ indicates the imaginary error function, have a look at https://en.wikipedia.org/wiki/Error_function#Imaginary_error_function – Cahn Jan 17 '17 at 18:32
  • @MarvinF Yes, but I do not need to use it, I am just asking about the integration by parts – gbox Jan 17 '17 at 18:33
  • We should bear in mind here that the purpose is not to find a closed-form solution but rather to see how to get to the given proposed bottom-line answer, which still has an integral in it. – Michael Hardy Jan 17 '17 at 18:41
  • Related: http://math.stackexchange.com/questions/1635412/ – Watson Jan 17 '17 at 18:49

1 Answers1

5

$$ \int x^2 e^{x^2/2} \,dx = \int x\left( xe^{x^2/2} \,dx \right) = \overbrace{\int x \,dv = xv - \int v\,dx}^\text{integration by parts} = \cdots\cdots $$

You have $dv = xe^{x^2/2}\,dx$ and $v= e^{x^2/2}.$

This will not get you a closed form, but I take the question to mean: How do we use integration by parts to reach $\displaystyle xe^{x^2/2}-\int e^{x^2/2} \, dx \text{?}$

This is a bit subtler than elementary exercises in integration by parts usually are. The way I got the answer is by starting with the given answer and differentiating, and seeing how it fits into the usual pattern that you see when you check the answers to integration-by-parts exercises.