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
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))$