# Expected value of random variable with random parameter

I'm trying to answer a question about expectations. Let's say I have a random variable, $X$, which is distributed $Expo(\lambda)$. Now assume that $\lambda$ is also an R.V. and is distributed $Expo(5)$. How do I find $E(X)$? Assume that I don't need to do this analytically, I can use the integrate command in R, for instance. I believe I should be using Adam's Law, but I'm not sure. Thank you!

• This sounds like a self-study question. Can you explain where you have problem with using Adam's Law? – Xi'an Feb 12 '18 at 11:34
• I understand the Adam's Law part of it I think (based on Siong's answer below). I'm unsure of how to actually integrate it in R. – lish Feb 12 '18 at 16:24
• Why would you want to find a numerical approximation when you can get the exact answer? – Xi'an Feb 12 '18 at 17:29