I need to find the generating function for this PDF:
$$f(x) = 6(1 - x)x$$
I know that the generating function for $f(x)$ is $\frac{12}{t^3} - \frac{12e^t}{t^3} + \frac{6}{t^2} + \frac{6e^t}{t^2}$
I also know that I need to integrate $e^{tx} \cdot f(x)$ on $[0, 1]$ in order to find this function.
I have been given a tip that I can calculate $\int_0^1 x \cdot e^{tx}\, dx$ and $\int_0^1 x^2 \cdot e^{tx}\, dx$ by calculating $\int_0^1 e^{tx}\, dx$ and taking the derivative of the result twice.
When I do this, I get $$\frac{e^t}{t} - \frac{e^t}{t^2} + \frac{2e^t}{t^3} - \frac{2}{t^3}.$$ When I multiply this by $6$, the result is close to what it's supposed to be, but not quite.
Any advice for how to fix this? Thanks in advance.
Integration by parts $$I(x)=\int x e^{t x} \, dx=x\left(\frac{e^{t x}}{t}\right)-\int \frac{e^{t x}}{t}\,dx= \frac{x e^{t x}}{t}-\frac{e^{t x}}{t^2}+C$$ and $$\int x^2 e^{t x} \, dx=x^2\left(\frac{e^{t x}}{t}\right)-\int (2x)\left(\frac{e^{t x}}{t}\right)\,dx=\frac{x^2e^{t x}}{t}-\frac{2}{t}\int x e^{t x} \, dx=\frac{x^2e^{t x}}{t}-\frac{2}{t}I(x)=$$ $$=\frac{x^2e^{t x}}{t}+\frac{2x e^{t x}}{t^2}+\frac{2e^{t x}}{t^3}+C$$ And finally $$6\int_0^1 (1-x) x e^{t x} \, dx=6\left[-\frac{2 e^{t x}}{t^3}+\frac{2 x e^{t x}}{t^2}-\frac{e^{t x}}{t^2}-\frac{x^2 e^{t x}}{t}+\frac{x e^{t x}}{t}\right]_0^1=$$ $$=\frac{12}{t^3}-\frac{12 e^t}{t^3}+\frac{6 e^t}{t^2}+\frac{6}{t^2}$$
Hope this helps