# Setting up double integral in calculating probability

I am having trouble understanding the solution to this problem. The problem define $$X_1$$ and $$X_2$$ to have the joint pdf $$f(x_1, x_2) = 15x_1^2 x_2$$, $$0 < x_1 < x_2 < 1$$, zero elsewhere. It then asks to calculate the marginal pdfs and $$P(X_1 + X_2 \leq 1)$$. I was able to get the marginal pdfs for $$X_1$$ and $$X_2$$, but was a bit confused on the solution of $$P(X_1 + X_2) \leq 1$$. They set up the integral as:

$$P(X_1 + X_2 \leq 1) = \int_0^{\frac{1}{2}} \int_{x_1}^{1 - x_1} f(x_1, x_2) dx_2 dx_1$$

And arrived at the answer of $$\frac{5}{64}$$. I have tried drawing the line and understood why they set up the integral like that, but I don't understand why doing either of the following ways do not give me the same answer.

1. Does the order of integration matter? I was trying with this integral and get a different result.

$$P(X_1 + X_2 \leq 1) = \int_{x_1}^{1 - x_1} \int_0^{\frac{1}{2}} f(x_1, x_2) dx_1 dx_2$$

1. Also, why doesn't this work?

$$P(X_1 + X_2 \leq 1) = \int_{\frac{1}{2}}^1 \int_{x_2}^{1 - x_2} f(x_1, x_2) dx_1 dx_2$$

Edit: I now understand why the second way does not make sense, but still stuck on the first way.

• I suggest you draw a picture. draw a unit square and the line $y+x=1$. Look at the area below this line and inside the square... Oct 8, 2022 at 18:55
• Thanks! I actually have drawn it and understood why they did it like it, but still don't understand why if I do like the other 2 ways I showed, I won't arrive at the same answer. Oct 8, 2022 at 19:10
• Re order of integration: see en.wikipedia.org/wiki/Fubini%27s_theorem.
– whuber
Oct 8, 2022 at 20:02

Also, the math is below to show how the double integral, when swapped, results in the same answer. $$Original: \int_{x_{1}}^{1-x_{1}}\int_{0}^{\frac{1}{2}} 15{x_{1}}^{2}x_{2} dx_{1} dx_{2}$$
Integrate with respect to x1 $$\int_{x_{1}}^{1-x_{1}}\frac{15{\frac{1}{2}}^{3}x_{2}}{3} dx_{2}$$
Simplify and then substitute in the boundaries used to evaluate dx1 within the x2 boundaries for x1 $$\int_{0}^{\frac{1}{2}} \frac{15}{24}x_{2} dx_{2}$$
Then integrate with respect to x2 and you will see you'll get the same result $$\frac{15}{24*2}\frac{1}{2}^{2} = \frac{15}{192} = \frac{5}{64}$$