Joint density of poisson process arrival times If we have a Poisson process of rate $x$, and we want to find the joint density of $T_1$ (first arrival time) and $T_2$ (second arrival time), then
$$
\begin{align}
P(T_1 < a,T_2 < b) &= P(T_2 < b \vert T_1 < a)P(T_1 < a)\\
&= P(T_2-T_1 < b-a)P(T_1 < a)\\
&= (1-e^{-x(b-a)})(1-e^{-xa})\quad \textrm{since interarrival times are i.i.d exp(x)}\\
&= 1 - e^{-xa} + e^{-xb} - e^{-x(b-a)}
\end{align}
$$
Then I differentiate this with respect to $a$, then differentiate with respect to $b$, and this gives the density to be
$$
f(a,b) = x^2e^{-x(b-a)}
$$
however the answer should be
$$
x^2e^{-xb}
$$
What is my mistake?
 A: Line 1 is incorrect.
$\{T_2-T_1 \le b-a, T_1 \le a\}$ is a subset of $\{T_1 \le a, T_2 \le b \}$.
For example $T_1=0$ and $T_2=b$ is not in $\{T_2-T_1 \le b-a, T_1 \le a\}.$
Instead, condition on a given value of $T_1.$
$$P(T_1\le a,T_2\le b)=\int_0^a P(T_2-T_1\le b-t \space | \space T_1=t)f_{T_1}(t)dt$$
This becomes $$\int_0^a (1-e^{-x(b-t)} )xe^{-xt}dt$$
and evaluates as
$$1-e^{-xa}-xae^{-xb}   $$
on the range $0<a<b.$ If you only need the joint density, you can immediately write it down: $$f_{T_1,T_2}(a,b)= f_{T_1,T_2-T_1}(a,b-a)=f_{T_1}(a)f_{T_2-T_1}(a,b-a)=x^2e^{-xb} , \space 0<a<b.   $$ (To be precise, you would need to go through the change of variable formalism with the Jacobean, but you may not have studied that yet.)
A: Alternatively, you can find the result as follows. Notice that, the joint probability can be written as the equation below, by using the chain rule for probability. 
$$P\left(T_2, T_1\right) = P\left(T_2|T_1\right)P\left(T_1\right)$$ 
Let us first find the  complementary cumulative distribution function (cdf) for the first term  on the right-hand side(An identical derivation can be found on https://en.wikipedia.org/wiki/Exponential_distribution#Memorylessness.
$$
\begin{align}\label{prob2}
 P\left(T>T_2|T>T_1\right) =& P\left(T> T_1 + \left(T_2 - T_1\right)|T>T_1\right) 
 \\ & =\frac{P\left(T> T_1 + \left(T_2 - T_1\right) \cap T>T_1\right) }{P\left(T>T_1\right)}
 \\ & =\frac{P\left(T> T_1 + \left(T_2 - T_1\right)\right) }{P\left(T>T_1\right)}
 \\ & =\frac{e^{-\lambda_{p}\left(T_1 + \left(T_2 - T_1\right)\right)}}{e^{-\lambda_{p}\left(T_1\right)}}
 \\ & =e^{-\lambda_{p}\left(T_2 - T_1\right)}
\end{align} 
$$
Thus, the cdf for $P\left(T<T_2|T>T_1\right)$ is $1- e^{-\lambda_{p}\left(T_2 - T_1\right)}$, and by taking the derivative wrt. our time variable ($T_2 - T_1$) we find the pdf, $\lambda  e^{-\lambda_{p}\left(T_2 - T_1\right)}$. 
Finally we insert the pdf into our initial expression.
$$P\left(T_2, T_1\right) = \lambda  e^{-\lambda_{p}\left(T_2 - T_1\right)}\lambda  e^{-\lambda_{p}T_1} =\lambda^2  e^{-\lambda_{p}T_2} $$ 
