TITLE: PDF of the sum of independent normal and uniform random variables
QUESTION [6 upvotes]: I have a continuous uniform random variable $P$ and a standard normal random variable $X$. 
The pdf of $P$ is: $\frac{1}{b-a}$
and the pdf for $X$ is: $\frac{1}{\sqrt{2\pi}}e^{-x^2/2}$
How to find the PDF of $Y=P+X$?

REPLY [5 votes]: Let $P\sim \mathcal{U}(0,1)$ and $X\sim \mathcal{N}(0,1)$ be independent random variables. Their PDFs are
$$\begin{align}g_P(x) &= \frac{1}{b-a},\qquad\quad 0<x<1 \\ \varphi(x) &= \frac{1}{\sqrt{2\pi}}e^{-x^2/2},\,\,-\infty<x<\infty\end{align}$$
Then
$$\begin{align}f_{X+P}(x) &= \int\limits_{-\infty}^{\infty}g_P(x)\varphi(x-u)du \\ &=\frac{1}{b-a} \int\limits_a^b\varphi(x-u)du \\ &= \frac{1}{2(b-a)} \left[ {\rm erf}\left(\frac{b-x}{\sqrt{2}}\right) - {\rm erf}\left(\frac{a-x}{\sqrt{2}}\right) \right] \end{align}$$
with
$${\rm erf}(x)=\frac{2}{\sqrt{\pi}}\int\limits_0^xe^{-t^2}dt$$
being the error function. A plot showing the difference between the normal distribution and $f_{X+P}$ looks like this: