# Integral range when computing pdf of function of multiple random variables

I'm struggling to understand the endpoints in this problem from Degroot (3.9.4 example).

Suppose also that $$X_1$$ and $$X_2$$ are independent random variables with common distribution having p.d.f. $$f(x) = 2e^{−2x}$$ for x > 0 and 0 otherwise

We're interested in $$Y = X_1 + X_2$$. In particular, we want to know the pdf of Y.

The solution is found by first finding the CDF:

$$G(y) = Pr((X1, X2) ∈ Ay) = \int_0^{y} \int_0^{y−x_2} f(x)f(x)dx_1 dx_2$$

However, this doesn't quite make sense. Rearranging such that:

$$X_1 = Y - X_2$$
$$X_2 = Y - X_1$$

I would think that to find the CDF we would integrate over:

$$\int_0^{y - x_1} \int_0^{y−x_2} f(x)f(x)dx_1 dx_2$$

Why do we only integrate over the range of $$[0,y - x_1]$$ in the outer integral?

$$X_1 = Y - X_2$$
$$X_2 = Y - X_1$$
This is where you are mistaken, you don't have to "rearrange" twice. The proper way to go about it would be to write $$\mathbb P(Y\le y) = \mathbb P(X_1+X_2 \le y) = \mathbb P(X_1\le y-X_2)$$ And by the law of total probability we can rewrite this quantity as follows : \begin{align}\mathbb P(X_1\le y-X_2) &= \int_{x_2=0}^\infty\mathbb P(X_1\le y-X_2\ | \ X_2=x_2)f_{X_2}(x_2)dx_2\\ &= \int_{x_2=0}^y\mathbb P(X_1\le y-X_2\ | \ X_2=x_2)f_{X_2}(x_2)dx_2 \ \text{(the integrand is zero for x_2\ge y)}\end{align} And similarly \begin{align}\mathbb P(X_1\le y-X_2\ | \ X_2=x_2) &= \mathbb P(X_1\le y-x_2)\\ &=\int_{x_1=0}^{y-x_2}f_{X_1}(x_1)dx_1\end{align} Plug this in the previous inequality and the result follows.