Let $X$~$U(0,5)$ & $Y$ be exponential random variable with with mean $2x$. Find the mean and variance of Y. Let $X$~$U(0,5)$ & $Y$ be exponential random variable with with mean $2x$.
Find the mean and variance of Y.
My Working:
I know that the pdf of random variable $X$ is given by: $f_X(x)=1/5$
Since $Y$ exponential random variable with mean $2x$ this means that:
$Y$~$\text{Exp}(1/2x)$ and its pdf is given by: $g_Y(y)=(1/2x)e^{-y(1/2x)}$ for all $y>=0$ and $0$ otherwise.
I don't know how to proceed further. Can anyone help please? It will be appreciated
 A: Actually you have obtained the pdf of $Y|X=x$ instead of $X$. To find the pdf of $Y$, you must first find the joint pdf of $X$ and $Y$ by multiplying those of $Y|X=x$ and $X$ to obtain
$$
f_{XY}(x,y)=f_X(x)f_{Y|X}(x,y)=\begin{cases}
\frac{1}{10x}e^{-\frac{y}{2x}}&,\quad 0<x<5\text{ and }y>0\\
0&,\quad\text{elsewhere}
\end{cases}.
$$
Now you can calculate any statistics of $X$ and $Y$ you wish.
A: $E(Y|X)=2X$ so $EY=E(2X)=\frac 1 5 \int_0^{5}2x dx=5$. Similarly, $E(Y^{2}|X)=2(2X)^{2}$ so $EY^{2}=E(8X^{2})=\frac 1 5 \int_0^{5}8x^{2} dx=\frac {200} 3$. Finally. the variance of $Y$ is  $\frac {200} 3-25=\frac {125} 3$
A: The probability density function for $X$ is $$f_{\small X}(x)=(1/5)\,\mathbf 1_{x\in(0..5)}$$
The conditional probability density function for $Y$ given $X\,{=}\,x$ is $$f_{\small Y\mid X}(y\mid x)=(1/2x)\,\mathrm e^{-y/2x}\,\mathbf 1_{y\in(0..\infty),x\in(0..5)}$$
Now, we could use the definitions$$\begin{align}\mathsf E(Y) &= \iint_{(0..5){\times}(0..\infty)}(y/10x)\mathrm e^{-y/2x}\,\mathrm d \langle x,y\rangle\\[2ex]\mathsf {Var}(Y)&=\iint_{(0..5){\times}(0..\infty)}(y^2/10x)\mathrm e^{-y/2x}\,\mathrm d\langle x,y\rangle-\mathsf E(Y)^2\end{align}$$
Buuut...
More practically we know these expectation and variance of these distributions, so: $$\begin{split}\mathsf E(X)&=5/2\\\mathsf{Var}(X)&=25/12\\\mathsf E(Y\mid X)&=2X\\\mathsf {Var}(Y\mid X)&=4X^2\end{split}$$
Why is this practical?  Well, you can now use the following:
The Law of Total Expectation says: $\mathsf E(Y) = \mathsf E(\mathsf E(Y\mid X))$
The Law of Total Variance says: $\quad~\mathsf E(Y) = \mathsf E(\mathsf {Var}(Y\mid X))+\mathsf{Var}(\mathsf E(Y\mid X))$
