# Integration by parts: Is this correct?

It's been a while since I have done integration by parts and I just wanted to see if I was correct or not, I have $$f(x)=\frac{x}{\theta^2}\exp\left(\frac{x^2}{2\theta^2}\right)$$ where $\theta$ is a constant. I set it up as \begin{align}\int_0^{\infty}\frac{x}{\theta^2}\exp\left(\frac{x^2}{2\theta^2}\right) dx\\\text{By doing the uv-\intvdu approach}\\\text{let u=\frac{x}{\theta^2} and v=-e^{-x}}\\\end{align} And of course taking their derivatives and rearranging the integral I came up with a final answer of$$-\frac{xe^{-x}}{\theta^2}+\int_0^{\infty}\frac{e^{-x}}{\theta^2}dx$$ If I got this part right then I can do the rest. But I'm wondering if I'm correct in what I did.

-
You seem to have some minus signs missing. But you have an $x^2$ in the exponent, so the primitive of $\exp \left(\pm\frac{x^2}{2\theta^2}\right)$ is not expressible in elementary functions. Fortunately, the factor outside the exponential is (up to a sign, possibly) exactly the derivative of the exponent, so $$\int_0^\infty \frac{x}{\theta^2}\exp\left(-\frac{x^2}{2\theta^2}\right)\,dx = \left[-\exp\left(-\frac{x^2}{2\theta^2}\right)\right]_0^\infty = 1.$$ –  Daniel Fischer Sep 9 '13 at 15:37
Well if $v=-e^{-x}$ then wouldn't that cancel out the minus sign that's supposed to be in there? I probably should have said that I was doing that. –  TheHopefulActuary Sep 9 '13 at 21:35
oh duh.... Wow it's been way to long since I've done an integral, now I see where I went wrong. It was way simpler than integration by parts. Thanks! –  TheHopefulActuary Sep 10 '13 at 3:15

$$\frac d{dx}\left(\frac{x^2}{2\theta^2}\right)=\frac x{\theta^2}\;,\;\;\text{and from here}:$$
$$\int\limits_0^\infty\frac x{\theta^2}\;\;exp\left(\frac{x^2}{2\theta^2}\right)dx=\int\limits_0^\infty d\left(\frac{x^2}{2\theta^2}\right)\;exp\left(\frac{x^2}{2\theta^2}\right)=\left.exp\left(\frac{x^2}{2\theta^2}\right)\right|_0^\infty$$