Is this right? (improper integral)

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

Coding
Posts: 47
Joined: Thu Sep 15, 2011 6:59 pm UTC

Is this right? (improper integral)

Not homework, just seemed like a neat problem to me (saw just the conclusion stated in a textbook, and decided to try to get it myself; I'm currently in Calc II).
$\int_{0}^{\infty} x^k e^{-x}dx$
Now I use the indefinite integral and integrate by parts, with u=xk and dv=e-xdx:
$\int x^k e^{-x}dx = x^k(-e^{-x}) - \int -e^{-x}kx^{k-1}dx$ $= -x^ke^{-x} + \int kx^{k-1}e^{-x}dx$
Hey, the second term looks just like the original integral, with a different coefficient and xk-1 rather than xk. So repeatedly integrating by parts will eventually give me this:
$-x^ke^{-x} - kx^{k-1}e^{-x} - k(k-1)x^{k-2}e^{-x} - ... - (k!)x^{0}e^{-x}$
Which I can rewrite as:
$\frac{-x^k - kx^{k-1} - k(k-1)x^{k-2} - ... - k!}{e^x}$
So:
$\int_{0}^{\infty} x^k e^{-x}dx = \lim_{b \to \infty} \left( \frac{-b^k - kb^{k-1} - k(k-1)b^{k-2} - ... - k!}{e^b} - \frac{-0^k - k0^{k-1} - k(k-1)0^{k-2} - ... - k!}{e^0}\right)$
$= \left( \lim_{b \to \infty} \frac{-b^k - kb^{k-1} - k(k-1)b^{k-2} - ... - k!}{e^b}\right) - \frac{-k!}{e^0}$
I've got infinity / infinity for the limit, so I use l'Hopital's rule repeatedly, taking the 1st, 2nd,..,kth derivative, so the denominator remains eb while all terms but one (the leftmost) in the numerator disappear:
$\left( \lim_{b \to \infty} \frac{-k!}{e^b}\right) + k!$
The limit is 0, so I am left with k! and have: [imath]\int_{0}^{\infty} x^k e^{-x}dx = k![/imath]
Last edited by Coding on Fri Apr 13, 2012 12:55 am UTC, edited 1 time in total.

Dopefish
Posts: 855
Joined: Sun Sep 20, 2009 5:46 am UTC
Location: The Well of Wishes

Re: Is this right? (improper integral)

Wolfram gives the result of the integral as gamma(k+1), which is equal to k! for positive integers, so it seems you've done it right.

You need to be a bit careful if you're not assuming that k is a positive integer however, because you're doing things like taking k-th derivatives and integration by parts k times, which could be problematic if k is negative or a non-integer.

Coding
Posts: 47
Joined: Thu Sep 15, 2011 6:59 pm UTC

Re: Is this right? (improper integral)

Yeah, good point. Thanks.

eSOANEM
:D
Posts: 3652
Joined: Sun Apr 12, 2009 9:39 pm UTC
Location: Grantabrycge

Re: Is this right? (improper integral)

I actually got this same question (although it was explicitly stated to only do it for positive integer values of k) on a paper for a university interview (for physics). I don't remember anyone else managing it so well done!

One useful trick which might have saved a couple of lines is that e^x grows faster than any finite order polynomial as x goes to infinity (it also goes to 0 faster than any finite order polynomial grows as x goes to -infinity), this can really help when you've go limits with e^x and polynomials in it (as happened here).
my pronouns are they

Magnanimous wrote:(fuck the macrons)

Timefly
Posts: 56
Joined: Sun Nov 14, 2010 7:30 pm UTC

Re: Is this right? (improper integral)

Your answer is correct. Though the derivation is slightly simpler than that.
Just notice that k! = k*(k-1)! and so does your integral, also that your integral has a value of 1 when k = 0.
This means you've defined the factorial over the integers. A further proof that the function is meromorphic is required to show that you have the gamma(x+1).
http://en.wikipedia.org/wiki/Gamma_function