# Distribution function technique and exponential density

I'm having quite a bit of difficulty with the distribution function technique.

If $X_1$ and $X_2$ are independent random variables having exponential densities with parameter $\theta_1$ and $\theta_2$, use the distribution function technique to find the probability density of $Y = X_1 + X_2$ when (a) $\theta_1 \neq \theta_2$ and (b) $\theta_1 = \theta_2$

I know that the exponential distribution for this is $f(x_1,x_2)={\frac{1}{\theta_1}}{\frac{1}{\theta_2}}e^{-(\frac{x}{\theta_1})-(\frac{x}{\theta_2})}$ for $x_1,x_2 \gt 0$ and $f(x_1,x_2)=0$ otherwise.

I'm assuming that I would want to first find $\int_0^y\int_0^{y-x_2}f(x_1,x_2)dx_1dx_2$ and then find the derivative of that with respect $y$ or $[\int_0^y\int_0^{y-x_2}f(x_1,x_2)dx_1dx_2]\frac{d}{dy}$

My book says the answer is $\frac{1}{\theta_1 - \theta_2} (e^{\frac{-y}{\theta_1}}-e^{\frac{-y}{\theta_2}})$ for (a) and $\frac{1}{\theta^2} ye^{\frac{-y}{\theta}}$ for (b)

I can't see how it came upon this as even when using an integral calculator and taking the derivative I get a completely different answer. I am trying to figure out where I went wrong. Any help would be appreciated.

For the case $\theta_1 = \theta_2$, see this answer to see how it all works out for the more general case of Gamma random variables (of which exponential random variables are a special case). The same method also can be used in your case when $\theta_1 \neq \theta_2$. Essentially what happens is that when $\theta_2 \neq \theta_1$, the integrand in $$\int_0^z \frac{1}{\theta_1}e^{-x/\theta_1}\frac{1}{\theta_2}e^{-(z-x)/\theta_2}\,\mathrm dx$$ does not simplify to the constant function $\frac{1}{\theta_2^2}e^{-z/\theta_2}$ of $x$. Thus, we integrate an exponential function of $x$ over $[0,z]$ instead of a constant over $[0,z]$, and so the result is different.