Let be $X,Y$ two random variables that are independently uniformly distributed on $[1,3]$. Compute the pdf and cdf of the random variable $Z:=2X-3Y$. (Hint: use convolution formula)
My approach:
We know that we can compute the pdf of $Z:= 2X+ (-3Y)$ by convolving the pdfs of $2X$ and $-3Y$. So first we compute those pdfs.
We see that the range of $2X$ is $[2,6]$, so for a $c\in [2,6]$ we consider the probability. \begin{align*} &P(2X\leq c)=\begin{cases}1,&c\geq 6\\P\left(x\leq \frac{c}{2}\right)=\int\limits_{-\infty}^{\frac{c}{2}}f_X(x)~dx=\int\limits_1^{\frac{c}{2}}\frac{1}{2}dx=\frac{c-2}{4},& c\in[2,6]\\0,&\text{else}.\end{cases}\\ &\implies f_{2X}(c)=\begin{cases}\frac{1}{4},&c\in[2,6]\\0,&\text{else}.\end{cases} \end{align*} We see that the range of $-3Y$ is $[-9,-3]$, so for a $c\in [-9,-3]$ we consider the probability. \begin{align*} &P(-3Y\leq c)=\begin{cases}1,&c\geq -3\\P\left(y\geq \frac{-c}{3}\right)=\int\limits_{\frac{-c}{3}}^{\infty}f_Y(y)~dy=\int\limits_{\frac{-c}{3}}^3\frac{1}{2}dy=\frac{3}{2}+\frac{c}{6},& c\in[-9,-3]\\0,&\text{else}.\end{cases}\\ &\implies f_{-3Y}(c)=\begin{cases}\frac{1}{6},&c\in[-9,-3]\\0,&\text{else}.\end{cases} \end{align*} Now we notice that the range of $Z:=2X-3Y$ is $[-7,3]$ and apply the convolution formula and get \begin{align*} &f_{2X-3Y}(z)=\int\limits_{-\infty}^{\infty}f_{2X}(x)f_{-3Y}(z-x)~dx=\int\limits_{-\infty}^{\infty}\frac{1}{24}1_{[2,6]}1_{[-9,-3]}(z-x)(x)~dx. \end{align*} In order to evaluate the integral we must split up the integral into intervals where it doesn't disappear. According to the domains of $f_{2X}$ and $f_{-3Y}$ we know that if \begin{align*} &2\leq x\leq 6\\ & z+3\leq x\leq z+9 \end{align*} are not satisfied, then the integral vanishes. If \begin{align*} &\text{if }-7\leq z\leq -3\implies 2\leq x\leq z+9\\ &\text{if }-3\leq z\leq -1\implies 2\leq x\leq 6\\ &\text{if }-1\leq z\leq 3\implies z+3\leq x\leq 6\\ \end{align*} then the integral doesn't vanish. So we get \begin{align*} &f_{2X-3Y}(z)=\dots=\begin{cases}\int\limits_{2}^{z+9}\frac{1}{24}~dx=\frac{z+9}{24}-\frac{1}{12},&z\in[-7,-3]\\\int\limits_{2}^{6}\frac{1}{24}~dx=\frac{1}{4}-\frac{1}{12},&z\in[-3,-1]\\\int\limits_{z+3}^{6}\frac{1}{24}~dx=\frac{1}{4}-\frac{z+3}{24},&z\in[-1,3]\\0,&\text{else.}\end{cases} \end{align*}
The problem is that the pdf $f_{2X-3Y}(z)$ doesn't integrate to $1$ and I don't see my mistake? If the pdf is correct, then the cdf is no problem...
Any feedback is welcome!
Let's check.
$\qquad\begin{align} f_{\small X,Z}(x,z) &= f_{\small X,2X-3Y}(x,z) \\ &= (1/3)~f_{\small X,Y}\big(x, (2x-z)/3\big) \\ &= (1/12)~\mathbf 1_{1\leq x\leq 3}~\mathbf 1_{1\leq (2x-z)/3\leq 3} \\ &= (1/12)~\mathbf 1_{1\leq x\leq 3}~\mathbf 1_{(3+z)/2\leq x\leq (9+z)/2}~\mathbf 1_{-7\leq z\leq 3} \\[2ex] f_{\small Z}(z) &= (1/12)~\big({\min\{3,(9+z)/2\}}-\max\{1,(3+z)/2\}\big)~\mathbf 1_{-7\leq z\leq 3} \\ &= (1/24)~\big({\min\{6,9+z\}}-\max\{2,3+z\}\big)~\mathbf 1_{-7\leq z\leq 3} \\ &= (1/24)~\big((9+z-2)~\mathbf 1_{-7\leq z\lt -3}+(6-2)~\mathbf 1_{-3\leq z\lt-1}+(6-3-z)~\mathbf 1_{-1\leq z\leq 3}\big) \\ &= (1/24)~\big((7+z)~\mathbf 1_{-7\leq z\lt -3}+4\cdot\mathbf 1_{-3\leq z\lt-1}+(3-z)~\mathbf 1_{-1\leq z\leq 3}\big) \\ &=\begin{cases}(7+z)/24 &:& -7\leq z\lt-3 \\ ~1/6 &:& -3\leq z< -1\\(3-z)/24&:& -1\leq z< 3 \\~0&:& ~~~3\leq z~\text{ or }~z< -7\end{cases} \end{align}$