Suppose we have two random variables $A$ and $B$ both uniformly distributed on $[0, 1]$. Define $Z=A+B$.
The moment generating function of $A$ and $B$ is $M_A(\theta)=M_B(\theta)=\frac{e^{\theta}-1}{\theta}$, so $M_Z(\theta)=M_A(\theta) M_B(\theta)=(\frac{e^{\theta}-1}{\theta})^2 = \frac{e^{2\theta}-2e^{\theta}+1}{\theta^2} $.
On the other hand the probability density function of $Z$ is $f_Z(z)=z$ for $z<1$ so we should have $M_Z(\theta)=E[e^{Z\theta}]=\int_0^1e^{z\theta}f_Z(z) \space dz= \int_0^1e^{z\theta}z \space dz = \frac{e^{\theta} \theta - e^{\theta} + 1}{\theta^2}$.
Can someone please explain me where does the difference of answers come from?