# Random rate of exponential distribution

I am trying to work out the distribution function of an exponential distribution, whose rate is exponentially distributed. That is suppose $X \sim \exp(\lambda)$ and $\lambda \sim \exp(\mu)$. Find $P(X<x)$.

I suppose I should use the fact that $$P(X<x \mid \lambda)=1-e^{-\lambda x}$$ but this is as good as is gets.

You are almost there. Since you correctly conditioned on the value of $λ$ just apply the law of total probability to account for all possible values of $λ$ \begin{align}P(X<x)&=\int_{λ}P(X<x\mid λ)f_λ(λ)dλ=\int_{0}^{+\infty}(1-e^{-λx})μe^{-μλ}dλ\\[0.2cm]&=\int_{0}^{+\infty}μe^{-μλ}dλ-μ\int_{0}^{+\infty}e^{-(μ+x)λ}dλ=1-\frac{μ}{μ+x}\end{align}