Calculating distribution of variable $T$ if $T/N=n $ is distributed $exp(an+b) $ In my probability class I got a problem about conditional distributions to solve. 
Let $\lambda, a, b >0$. Random variable $N$ has Poisson distribution ($Po(\lambda) $). Conditioning on $N$, random variable $T$ has distribution $Exp(an+b)$. I need to calculate unconditional distribution of random variable $T$ and conditional distribution of random variable $N$ given $T$. 
If $N$ is Poisson distributed, then $P(N=n)= \frac{\lambda^n e^{-\lambda}}{n!}$ for $n=0,1,2,...$ and exponential distribution has density $f(t)= \lambda e^{-\lambda t} $ for $t>0,$ and $0$ otherwise. 
I started like this: 
let $0 \leq c \leq d $, then $P(c < T < d)= \sum_{n=0}^{\infty} P(N=n) P(c < T <d | N=n)= \sum_{n=0}^{\infty} \frac{\lambda^n e^{-\lambda}}{n!}(an+b) \int_{c}^d e^{-(an+b)t} dt $. 
I know I can exchange the integral and the sum but I don't know how to calculate this sum anyway. 
If someone has some idea of how to sum this, I would be really thankful. 
 A: You don't need to exchange the integral and the sum. Just calculate the inegral:
$$(an+b)\int_c^de^{-(an+b)t}\,dt=-\left.e^{-(an+b)t}\right\vert_c^d=e^{-(an+b)c}-e^{-(an+b)d}.$$
Then the sum becomes:
\begin{align}
\sum\limits_{n=0}^{\infty} \frac{\lambda^n e^{-\lambda}}{n!}(e^{-(an+b)c}-e^{-(an+b)d})&=\sum\limits_{n=0}^{\infty} \frac{\lambda^n e^{-\lambda}}{n!}e^{-(an+b)c}-\sum\limits_{n=0}^{\infty} \frac{\lambda^n e^{-\lambda}}{n!}e^{-(an+b)d}\\
&=e^{-(\lambda+bc)}\sum\limits_{n=0}^{\infty} \frac{(\lambda e^{-ac})^n}{n!}-e^{-(\lambda+bd)}\sum\limits_{n=0}^{\infty} \frac{(\lambda e^{-ad})^n}{n!}\\
&=e^{-(\lambda+bc)}e^{\lambda e^{-ac}}-e^{-(\lambda+bd)}e^{\lambda e^{-ad}}.
\end{align}
In the last step we're using the series expansion $e^x=\sum\limits_{n=0}^\infty\frac{x^n}{n!}$.
Also, to get the distribution, it's enough to calculate $P(T<d)$ instead of introducing another variable $c$. Then you get $$P(T < d)= \sum_{n=0}^{\infty} P(N=n) P(T <d | N=n)= \sum_{n=0}^{\infty} \frac{\lambda^n e^{-\lambda}}{n!}(an+b) \int_{0}^d e^{-(an+b)t}\,dt, $$
which simplifies the above calculation by setting $c=0$ and you get that the sum becomes
$$1-e^{-(\lambda+bd)}e^{\lambda e^{-ad}}=1-e^{-\lambda(1-e^{-ad})-bd}.$$
I'm not sure if this distribution has a name.
A: Work with densities instead. Let $f_T$ be the density function of $T$ and $f_{T\mid N}$ be the density of $T\mid N$. The latter is naturally the density of an exponential r.v. Let $\Omega$ be the probability space. To get the unconditional density of $T$, use that 
$$
f_T(t) = \int_\Omega f_{T\mid N}(t\mid n) \,\mathrm dP(N = n)
$$
where the integral is a Riemann-Stieltjes integral, i.e. 
\begin{align*}
f_T(t) 
&= 
\sum_{n = 0}^\infty f_{T\mid N}(t\mid n) P(N = n) 
\\&= 
\sum_{n = 0}^\infty (an+b)e^{-(an+b)t}  \frac{\lambda^n e^{-\lambda}}{n!}.
\end{align*}
By expanding a bit and pulling constants out of the sum we see that the sums are power series of the exponential function. Hence,
\begin{align*}
f_T(t) 
&=
e^{-(\lambda+bt)} \biggl(a\sum_{n = 0}^\infty \frac{\lambda^n e^{-ant}}{(n-1)!} + b\sum_{n = 0}^\infty \frac{\lambda^ne^{-ant}}{n!}
\biggr)
\\&=
e^{-(\lambda+bt)} \left(a\, e^{-at+\lambda \exp\{-at\}}+ be^{\lambda \exp\{-at\}}\right)
\end{align*}

To find $N\mid T$, use Baye's theorem,
$$
P( N = n\mid T\leq t) = \frac{P(T\leq t \mid N = n)P(N = n)}{P(T\leq t)}
$$
