Probability density function of random variable $X-Y$ Suppose $X$ and $Y$ are independent random variables. $X$ and $Y$ are continuous and given by exponential and uniform density functions. Find the probability density function of the random variable $X - Y$. 
My question is, can we use the convolution for $X-Y$? I know we can for $X+Y$, but I'm not sure for $X-Y$. If we can, do we do anything different?
Just to be as explicit as possible, I am referring to $(f_X * f_Y)(a) = \int f_X(a-t)f_Y(t)\,dt$. 
Thank you. 
 A: $X-Y = X + (-Y)$.  Find the probability density of the random variable $-Y$, then find the convolution.
A: If $Y\sim U(a,b)$, then $Y$ has density $$f_Y(y)=\frac1{b-a}\mathbb I_{(a,b)}(y),$$ where $\mathbb I$ denotes the indicator function. Hence $-Y$ has density 
$$f_{-Y}(y) = f_Y(-y) = \frac1{b-a}\mathbb I_{(a,b)}(-y) = \frac1{b-a}\mathbb I_{(-b,-a)}(y).$$
It follows that $-Y\sim U(-b,-a)$. From here, you would compute the convolution
$$(f_X\star f_{-Y})(t) = \int_\mathbb R f_X(t-s)f_{-Y}(s)\mathsf ds. $$
Extending the work of Math1000 and Michael Hardy here. 
Denote $V=X-Y$, where  $X\sim \mathcal{N}\left(0,\frac{\sigma^{2}}{2}\right)$ and $Y \sim U(a,b)$ , the pdf of $V$ is the convolution,
\begin{eqnarray*}
f_{V}(v) &=& \int_{z}^{}{f_{X}(v-z) f_{-Y}(z) dz} \\
&=& \int_{-b}^{-a}{\frac{1}{\sigma \sqrt{2\pi}} e^{\frac{(v-z)^{2}}{2\sigma^{2}}}  \frac{1}{b-a} dz } \\
&=& \frac{\text{erfc}\left(\frac{v+a}{\sigma\sqrt{2}}\right)- \text{erfc}\left(\frac{v+b}{\sigma\sqrt{2}}\right)}{2(b-a)} \\
&=& \frac{Q\left(\frac{v+a}{\sigma}\right)-Q\left(\frac{v+b}{\sigma}\right)}{b-a}
\end{eqnarray*}

Note: The complementary error function reference https://en.wikipedia.org/wiki/Error_function#Complementary_error_function
and the Q function https://en.wikipedia.org/wiki/Q-function
A: Extending the work of Math1000 and Michael Hardy here. 
Denote $V=X-Y$, where  $X\sim \mathcal{N}\left(0,\frac{\sigma^{2}}{2}\right)$ and $Y \sim U(a,b)$ , the pdf of $V$ is the convolution,
\begin{eqnarray*}
f_{V}(v) &=& \int_{z}^{}{f_{X}(v-z) f_{-Y}(z) dz} \\
&=& \int_{-b}^{-a}{\frac{1}{\sigma \sqrt{2\pi}} e^{\frac{(v-z)^{2}}{2\sigma^{2}}}  \frac{1}{b-a} dz } \\
&=& \frac{\text{erfc}\left(\frac{v+a}{\sigma\sqrt{2}}\right)- \text{erfc}\left(\frac{v+b}{\sigma\sqrt{2}}\right)}{2(b-a)} \\
&=& \frac{Q\left(\frac{v+a}{\sigma}\right)-Q\left(\frac{v+b}{\sigma}\right)}{b-a}
\end{eqnarray*}

Note: The complementary error function reference https://en.wikipedia.org/wiki/Error_function#Complementary_error_function
and the Q function https://en.wikipedia.org/wiki/Q-function
