# Variational distance between negative exponential distributions

I'm trying to compute the variational distance between two negative exponential distributions. If $a$ denotes the value of $x$ where both curves are equal, then:

$$\int_0^{+\infty}\left|\lambda_1e^{-\lambda_1x}-\lambda_2e^{-\lambda_2x}\right|dx$$

$$=-\int_{0}^a(\lambda_1e^{-\lambda_1x}-\lambda_2e^{-\lambda_2x})dx+\int^{+\infty}_a(\lambda_1e^{-\lambda_1x}-\lambda_2e^{-\lambda_2x})dx$$

$$=\left[e^{-\lambda_2x} - e^{-\lambda_1x}\right]_{0}^a +\left[e^{-\lambda_1x} - e^{-\lambda_2x}\right]^{+\infty}_a$$

$$=e^{-\lambda_2a} - e^{-\lambda_1a} -1 +1 +e^{-\infty} - e^{-\infty}-e^{-\lambda_1a}+e^{-\lambda_2a}$$

$$=2\left(e^{-\lambda_2a}-e^{-\lambda_1a}\right).$$

Computing $a$ is not difficult: \begin{eqnarray*} \lambda_1e^{-\lambda_1x}=\lambda_2e^{-\lambda_2x} \Leftrightarrow\ln(\lambda_1)-\lambda_1x&=&\ln(\lambda_2)-\lambda_2x\ \Leftrightarrow x&=&\frac{\ln(\lambda_2)-\ln(\lambda_1)}{\lambda_2-\lambda_1}. \end{eqnarray*}

However, what puzzles me is that I am integrating a positive function, yet depending on how parameters are related to each other, the value of the above result may be negative ... what am I missing?

(sorry for the messy layout, it seems that my &'s are ignored ...)

-

$$\lambda_1 e^{-\lambda_1x} > \lambda_2 e^{-\lambda_2x}$$
for $x > a$. (Which is equivalent to assuming $0 < \lambda_1 < \lambda_2$.) You'll see that the parameter ranges that gives you a negative answer from your computation precisely corresponds to the case where the above assumption is false