In the second episode of season $8$ of "The Big Bang Theory," which aired yesterday night, it is stated that one can integrate $x^2e^{-x}$ by using Feynman's trick of differentiating under the integral. Is this actually true, and if so, how to do it? And is it "better," in any sense, than the usual way of doing it by integration by parts?

  • 1
    $\begingroup$ I wasn't the only one who immediately went to try this when I heard that?! $\endgroup$ Sep 23 '14 at 16:48
  • 1
    $\begingroup$ This is the second question today that comes from this episode. Funny. $\endgroup$
    – Asaf Karagila
    Sep 23 '14 at 16:52
  • $\begingroup$ What's the first? $\endgroup$
    – Nishant
    Sep 23 '14 at 19:54
  • 1
    $\begingroup$ @Nishant math.stackexchange.com/questions/942581/… $\endgroup$ Sep 23 '14 at 20:22

If we just compute without thinking about problems such as interchanging integration and differentiation, the derivation is very simple. $$ \int_0^{\infty} x^2e^{-x}dx=\left.\left(\frac{d}{d\alpha}\right)^2\right|_{\alpha=1}\int_0^{\infty} e^{-\alpha x}dx=\left.\left(\frac{d}{d\alpha}\right)^2\right|_{\alpha=1} \frac{1}{\alpha}=\left.\frac{2}{\alpha^3}\right|_{\alpha=1}=2. $$

If you want limits other than the positive real axis, the same trick allows you to arrive at $$ \int_a^{b} x^2e^{-x}dx=\left.\left(\frac{d}{d\alpha}\right)^2\right|_{\alpha=1}\int_a^{b} e^{-\alpha x}dx=\left.\left(\frac{d}{d\alpha}\right)^2\right|_{\alpha=1} \frac{1}{\alpha}(e^{-a\alpha}-e^{-b\alpha}). $$ Of course, this can also be evaluated explicitly by using the Leibniz rule, but I will leave that up to you.

  • 1
    $\begingroup$ @steven putting in the usual limits of course ;) ha $\endgroup$
    – Chinny84
    Sep 23 '14 at 16:56
  • 1
    $\begingroup$ Gives: $a^2 e^{-a}-b^2 e^{-b} + 2 \left(e^{-a}-e^{-b}\right)-2 \left(b e^{-b}-a e^{-a}\right)$ $\endgroup$
    – amcalde
    Sep 23 '14 at 17:11
  • 1
    $\begingroup$ @UserX Here are some notes by Jie Yang that explain the procedure better than I ever could. $\endgroup$ Sep 26 '14 at 8:35
  • 1
    $\begingroup$ @UserX It is a two-fold application of Theorem 5 in the notes I linked to. The integrals are uniformly convergent because you have a bound of the type $x^n e^{-\alpha x}\leq C_n e^{-\alpha x/2}$ on the positive axis. As for setting $\alpha=1$, this is an application of Theorem 4 in the notes I linked to. $\endgroup$ Sep 26 '14 at 10:01
  • 3
    $\begingroup$ Almost right. We use $$\frac{\partial^2}{\partial a^2} e^{-ax} =x^2 e^{-ax}.$$ $\endgroup$ Sep 26 '14 at 11:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.