There is a mistake in the exponents: it is

when

and

else.
How to find the result with little computation (but some nontrivial knowledge): first, the probability that

is

(classic useful computation); then, by the memoryless property of exponential distribution, conditionally to

and to the event

, the distribution of

is exponential with parameter

(note that since this distribution does not depend on

, it was unnecessary to condition by

). This gives the "

" part:

, and symmetry gives the other part.