1

I'm working through problem 1.17 in Pattern Recognition and Machine Learning where I'm getting:

\begin{align*} \Gamma(x+1) = & \int_{0}^{\infty} u^{(x+1)-1}e^{-u} \hspace{1mm} du \\ = & \big[-u^x e^{-u} \big]_{0}^{\infty} - \int_{0}^{\infty} e^{-u}xu^{x-1} \hspace{1mm} du & \text{(simplify and integrate by parts*)} \end{align*}

*$f=u^x$, $g_u=e^{-u}$, $f_u= xu^{x-1}$, and $g=\int e^{-u} \hspace{1mm} du$. To solve the integral for $g$: \begin{align*} g= & - \int e^s \hspace{1mm} ds & \text{(substitute $s = -u$ and $-ds = du$)} \\ = & -e^s + C & \text{(by known antidervative)} \\ = & -e^{-u} + C & \text{(substitute $s = -u$)} \end{align*}

The book (in the link above) says the integration by parts results in (notice the plus sign - otherwise equivalent): $$\big[-e^{-u}u^x \big]_{0}^{\infty} \boldsymbol{+} \int_{0}^{\infty} xu^{x-1}e^{-u}$$

I've gone over my work again and again. I can't see where I made a mistake.

Matt
  • 661
  • The formula for integration by parts is $\int udv=uv-\int vdu$. So you should get two minus signs, hence the plus sign. – carmichael561 Sep 12 '17 at 02:43
  • ${}{}(-1)(-1)=1$ – Angina Seng Sep 12 '17 at 02:45
  • @carmichael561 aren't both $v$ (or $g$) and $du$ (or $f'$) positive? I don't see where another minus sign comes form – Matt Sep 12 '17 at 02:46
  • In your notation, $\int fg^{\prime}=fg-\int f^{\prime}g$. And $f^{\prime}(u)=xu^{x-1}$, $g(u)=-e^{-u}$. – carmichael561 Sep 12 '17 at 02:48
  • You did the antiderivative for $g'$ correctly but missed the minus sign in the IBP formula. That's what @carmichael561 is getting at. – Randall Sep 12 '17 at 02:51
  • @Randall -- Oh. Yeah I'm getting tired, sometimes I just can't see these kinds of mistakes even when I 'think' I'm looking for them. Ah, so I plugged in $g_u$ not $g$ in the second term. – Matt Sep 12 '17 at 03:03

1 Answers1

2

\begin{align} \int_0^\infty u^x e^{-u} \, du & = \int_0^\infty \Big( u^x\Big) \Big( e^{-u} \, du\Big) \\[10pt] & = \underbrace{ \int f\, dg = fg - \int g\,df}_{\large\text{This is integration by parts.}} \end{align}

You have \begin{align} f & = u^x, & & & df & = xu^{x-1}\, du \\ dg & = e^{-u}\, du & & & g & = -e^{-u} \end{align}

So $$ fg - \int f \,dg = \left[ -u^x e^{-u} \vphantom{\frac 1 1} \right]_{u=0}^{u=\infty} -\int_0^\infty (-e^{-u}) xu^{x-1} \,du $$