Respuesta :
I know you said "without making any assumptions," but this one is pretty important. Assuming you mean [tex]\alpha,\beta[/tex] are shape/rate parameters (as opposed to shape/scale), the PDF of [tex]X[/tex] is
[tex]f_X(x) = \dfrac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha - 1} e^{-\beta x} = \dfrac{2^8}{\Gamma(8)} x^7 e^{-2x}[/tex]
if [tex]x>0[/tex], and 0 otherwise.
The MGF of [tex]X[/tex] is given by
[tex]\displaystyle M_X(t) = \Bbb E\left[e^{tX}\right] = \int_{-\infty}^\infty e^{tx} f_X(x) \, dx = \frac{2^8}{\Gamma(8)} \int_0^\infty x^7 e^{(t-2) x} \, dx[/tex]
Note that the integral converges only when [tex]t<2[/tex].
Define
[tex]I_n = \displaystyle \int_0^\infty x^n e^{(t-2)x} \, dx[/tex]
Integrate by parts, with
[tex]u = x^n \implies du = nx^{n-1} \, dx[/tex]
[tex]dv = e^{(t-2)x} \, dx \implies v = \dfrac1{t-2} e^{(t-2)x}[/tex]
so that
[tex]\displaystyle I_n = uv\bigg|_{x=0}^{x\to\infty} - \int_0^\infty v\,du = -\frac n{t-2} \int_0^\infty x^{n-1} e^{(t-2)x} \, dx = -\frac n{t-2} I_{n-1}[/tex]
Note that
[tex]I_0 = \displaystyle \int_0^\infty e^{(t-2)}x \, dx = \frac1{t-2} e^{(t-2)x} \bigg|_{x=0}^{x\to\infty} = -\frac1{t-2}[/tex]
By substitution, we have
[tex]I_n = -\dfrac n{t-2} I_{n-1} = (-1)^2 \dfrac{n(n-1)}{(t-2)^2} I_{n-2} = (-1)^3 \dfrac{n(n-1)(n-2)}{(t-2)^3} I_{n-3}[/tex]
and so on, down to
[tex]I_n = (-1)^n \dfrac{n!}{(t-2)^n} I_0 = (-1)^{n+1} \dfrac{n!}{(t-2)^{n+1}}[/tex]
The integral of interest then evaluates to
[tex]\displaystyle I_7 = \int_0^\infty x^7 e^{(t-2) x} \, dx = (-1)^8 \frac{7!}{(t-2)^8} = \dfrac{\Gamma(8)}{(t-2)^8}[/tex]
so the MGF is
[tex]\displaystyle M_X(t) = \frac{2^8}{\Gamma(8)} I_7 = \dfrac{2^8}{(t-2)^8} = \left(\dfrac2{t-2}\right)^8 = \boxed{\dfrac1{\left(1-\frac t2\right)^8}}[/tex]
The first moment/expectation is given by the first derivative of [tex]M_X(t)[/tex] at [tex]t=0[/tex].
[tex]\Bbb E[X] = M_x'(0) = \dfrac{8\times\frac12}{\left(1-\frac t2\right)^9}\bigg|_{t=0} = \boxed{4}[/tex]
Variance is defined by
[tex]\Bbb V[X] = \Bbb E\left[(X - \Bbb E[X])^2\right] = \Bbb E[X^2] - \Bbb E[X]^2[/tex]
The second moment is given by the second derivative of the MGF at [tex]t=0[/tex].
[tex]\Bbb E[X^2] = M_x''(0) = \dfrac{8\times9\times\frac1{2^2}}{\left(1-\frac t2\right)^{10}} = 18[/tex]
Then the variance is
[tex]\Bbb V[X] = 18 - 4^2 = \boxed{2}[/tex]
Note that the power series expansion of the MGF is rather easy to find. Its Maclaurin series is
[tex]M_X(t) = \displaystyle \sum_{k=0}^\infty \dfrac{M_X^{(k)}(0)}{k!} t^k[/tex]
where [tex]M_X^{(k)}(0)[/tex] is the [tex]k[/tex]-derivative of the MGF evaluated at [tex]t=0[/tex]. This is also the [tex]k[/tex]-th moment of [tex]X[/tex].
Recall that for [tex]|t|<1[/tex],
[tex]\displaystyle \frac1{1-t} = \sum_{k=0}^\infty t^k[/tex]
By differentiating both sides 7 times, we get
[tex]\displaystyle \frac{7!}{(1-t)^8} = \sum_{k=0}^\infty (k+1)(k+2)\cdots(k+7) t^k \implies \displaystyle \frac1{\left(1-\frac t2\right)^8} = \sum_{k=0}^\infty \frac{(k+7)!}{k!\,7!\,2^k} t^k[/tex]
Then the [tex]k[/tex]-th moment of [tex]X[/tex] is
[tex]M_X^{(k)}(0) = \dfrac{(k+7)!}{7!\,2^k}[/tex]
and we obtain the same results as before,
[tex]\Bbb E[X] = \dfrac{(k+7)!}{7!\,2^k}\bigg|_{k=1} = 4[/tex]
[tex]\Bbb E[X^2] = \dfrac{(k+7)!}{7!\,2^k}\bigg|_{k=2} = 18[/tex]
and the same variance follows.