# Understanding how integration by parts is done in Gamma function

The the Gamma function is defined as...

$S = \int_{0}^{n}t^{s-1}(1-\frac{t}{n})^{n}dt$ .

I'm looking into how the Gauss representation of the Gamma function is derived and the first step is integration by parts. No steps are shown and the following is the result of applying integration by parts...

$S = \frac{t^{2}}{s}(1-\frac{t}{n})^{n}\binom{n}{0} + \frac{n}{ns}\int_{0}^{n}t^{s}(1-\frac{t}{n})^{n-1}dt$ .

I'm confused as to how these values were derived. This is my take on it...

$u = (1-\frac{t}{n})^{n}$ .

$dv = t^{s-1}$ .

I imagine this is how they chose u and dv, which means...

$v = \frac{t^{s}}{s}$ .

$du = ?$ .

I am not sure how they got du. I tried deriving u and ended up at...

$$e[n \ln(1-t/n)]$$

and then ended up getting a different answer after attempting to derive it. Can someone show me how du is derived, or show me where I am going wrong, so that I can complete the parts by integration?

What you are looking for is $$\frac {du}{dt}=\frac d{dt}\left(\left(1-\frac tn\right)^n\right)=n\left(1-\frac tn\right)^{n-1}\times\frac d{dt}\left(1-\frac tn\right)$$by the chain rule$$=n\left(1-\frac tn\right)^{n-1}\times-\frac1n=-\left(1-\frac tn\right)^{n-1}$$which should be as required for your integration. (I notice they have written this term with a $$\frac nn$$ in front, which is basically redundant.)

You want to differentiate $$u = \left(1-\frac{t}{n}\right)^n$$ with respect to $$t$$. Just use the power rule and chain rule: $$\frac{du}{dt} = n \left(1-\frac{t}{n}\right)^{n-1}\times (-1/n) = - \left(1-\frac{t}{n}\right)^{n-1}.$$