# What is the expected value of X conditional on Lambda where both X and Lambda are random variables

Suppose we have a random variable $X \sim Expo(\lambda)$ with support $X \in \mathbb{R^+}$.

$$f_X(x) =\lambda e^{-\lambda x}$$

Let us now also assume that $\lambda$ is itself a random variable and thus $(X,\lambda)$. Assume that it is also exponentially distributed such that $\lambda \sim Expo(\Lambda=2)$. Thus, we have the following PDF

$$f_\lambda(\lambda) =2e^{-2\lambda}$$

I have three related questions:

First, how do we you express the joint (PDF) distribution of both these random variables? Is the following the correct answer:

$$f_{X\lambda}(x,\lambda) = f_{X}(x)f_{\lambda}(\lambda) = \\ (2e^{-2\lambda}) (\lambda e^{-\lambda x})$$

Second, how do we you express the joint (CDF) probability of both these random variables? Is the following correct?

$$F_{X\lambda}(x,\lambda) = F_{X}(x)F_{\lambda}(\lambda) = \\ \int_{0}^{\infty}\int_{0}^{\lambda} (2e^{-2\lambda}) (\lambda e^{-\lambda x})d\lambda dx$$

Here we first integrate over $\lambda$ since $X$ is conditioned on it. And then we integrate over $X$?

Third, how do we calculate $\mathbb{E}[X|\lambda]$?

$$\mathbb{E}[X|\lambda] = \int_{0}^{\infty}\int_{0}^{\lambda} \lambda (2e^{-2\lambda}) x(\lambda e^{-\lambda x})d\lambda dx$$

Here, as in the second question, we have to integrate over $\lambda$ since $X$ is conditioned on it.

I'd say $$f_{X\lambda}(x,\lambda) = f_{X \mid \lambda}(x \mid \lambda)f_{\lambda}(\lambda) = \\ (2e^{-2\lambda}) (\lambda e^{-\lambda x})$$.
Third, how do we calculate $\mathbb{E}[X \mid \lambda]$?
You just use the conditional density $f_{X \mid \lambda}(x \mid \lambda)$ and integrate: $$\mathbb{E}[X \mid \lambda] = \int_0^{\infty}xf_{X \mid \lambda}(x \mid \lambda)dx = \int_0^{\infty}x \lambda e^{-\lambda x} = \lambda^{-1}.$$