Solution (source code)

= Solution

The <uniform distribution> has <probability density function> $1/2$ on $(-1,1)$. Therefore, for $t\ne0$,
$$
M_U(t)=\frac12\int_{-1}^1e^{tu}\,du=\frac{e^t-e^{-t}}{2t},\qquad \boxed{M_U(t)=\begin{cases}\sinh(t)/t,&t\ne0,\\1,&t=0.\end{cases}}
$$
The value at zero follows either directly from the definition of the <moment-generating function> or by continuity. This answer needs no assumption about $B$.