Integration by parts: Am I doing this right

calculusintegration

So I'm working through the problems in this book. While I'm not at school, I can totally see how this might be someones homework, so if I have made any egregious errors in anything outside of the specific question, be a sport and don't blurt it out.

I should stress, I haven't taken a calculus course in (>10) years, and even when I did, I only passed by the thinnest of margins. Possibly a rounding error on the school system.

Anyway, I dug up my old books, and am using integration by parts to evaluate this equation
$$
\left<x^2\right> = \sqrt{\frac{\lambda}{\pi}} \int_{-\infty}^{+\infty}{x^2 e^{-\lambda(x-a)^2}}dx.
$$

I start by dusting of my calculus textbook, turn to page 316 to find this helpful integration rule/strategy:
$$\int{U(x)\frac{dV}{dx}}dx = U(x)V(x) – \int{V(x)\frac{dU}{dx}}dx.$$

I won't bore you with all the details, but after a little massaging I get the equation down looking like this:
$$
\left<x^2\right> = \sqrt{\frac{\lambda}{\pi}} \Big[
\overbrace{x^2}^{U(x)} \cdot \overbrace{e^{-\lambda (x-a)^2}}^{V(x)} –
\int_{-\infty}^{+\infty}{
\overbrace{e^{-\lambda (x-a)^2}}^{V(x)} \cdot
\overbrace{e^{-\lambda (x-a)^2} \cdot -2\lambda (x-a)}^{\frac{dV}{dx}}
}dx
\Big].
$$

(Let's just ignore any errors I may have made in applying the chain rule or using a poor substitution strategy or anything of that nature)

Now I was surprised to find the integral on the right hand side is actually not so hard to evaluate (it only took me a week of bugging the chat room to nut out). But now I am left scratching my head about how I evaluate the functions on the left, namely $U(x)$ and $V(x)$.

But then I realized, typing up this post, the rule is for an indefinite integral, I am evaluating a definite integral. So I just need to evaluate the functions at the endpoints, ie what is missing is:

$$
\left<x^2\right> = \sqrt{\frac{\lambda}{\pi}} \Big[
{x^2} \cdot e^{-\lambda (x-a)^2} –
\int_{-\infty}^{+\infty}{
{e^{-\lambda (x-a)^2}}\cdot
e^{-\lambda (x-a)^2} \cdot -2\lambda (x-a)
}dx
\Big] \Big|_{-\infty}^{+\infty}
$$

Am I on the right track there?

Edit:

From @David K's comment I think what I meant was. I'm not really familiar with typing out an integral mid-evaluation.:
$$
\left<x^2\right> = \sqrt{\frac{\lambda}{\pi}} \Big[
\big({x^2} \cdot e^{-\lambda (x-a)^2}\big)\ \Big|_{-\infty}^{+\infty} –
(-2\lambda) \int_{-\infty}^{+\infty}{
(x-a) e^{\lambda^2 (x-a)^4}
}dx
\Big]
$$

Best Answer

The general rule for integration by part is understood more easily as follows. For two functions $u$ and $v$, consider there derivatives $u'$ and $v'$ and a range of integration between $a$ and $b$ both finite. Then:

$$\int\limits_{a}^b u'(x) v(x) dx = u(b)v(b) - u(a)v(a) - \int\limits_{a}^b u(x)v'(x) dx$$

Now for $a$ and/or $b$ infinite, take a limit. This should be enough to set you on the right tracks.

Related Question