I and many of my class mates are struggling very hard on this problem:
Let $X$ be a random variable with Poisson distribution, with parameter $\lambda$, where $\lambda$ itself is a random variable with exponential distribution of mean $1/\theta$, that is, $X \sim \text{Poisson}(\lambda)$, $\lambda \sim \exp(\theta)$. Find the marginal distribution of $X$.
I tried:
P(X=x) = (w.r.t λ from 0 to inf) ∫ P(X=x, λ=θ) = ∫ P(X=x | λ=θ)* P(λ=θ)
And then got stuck a.k.a. something not integrate-able
Help... T.T
Hint
Using total probability yield
$$\mathbb P\{X=k\}=\int_0^{\infty } \mathbb P\left\{X=k\mid \lambda =t\right\}f_\lambda (t)\,\mathrm d t=\frac{\theta }{k!}\int_0^\infty t^ke^{-(1+\theta )t}\,\mathrm d t, $$ which is integrable.
Several possibilities :
Brute force, $k$ integration by part is requiert.
Nevertheless, an antiderivative of $t^ke^{-t}$ is of the form $$(a_0+a_1t+...+a_kt^k)e^{-t}.$$ So, you can easily find the $a_i$.
An other way : do the substitution $u=(1+\theta )t$, and write the integral using Gamma function.