I want to compute the conditional expectation of the sum of two independent uniform random variables, with two conditions. Is there anything wrong with my approach below?
Formally, let $X,Y$ both be independent draws from $U(0,1)$. I want the expectation of $X+Y$, conditional on $X\ge c_1$, where $c_1$ is a constant, and conditional on $X+Y\ge c_2 \iff Y\ge c_2-X$, where $c_2$ is another constant.
Edit: Via double integrals: $$E[X+Y|X\ge c_1,X+Y\ge c_2]=\frac{\int_0^1 \int_0^1 (x+y) 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ $$=\frac{\int_{c_1}^1 \int_0^1 (x+y) 1\{x+y\ge c_2\} dy dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ $$=\frac{\int_{c_1}^1 \int_{\max\{0,c_2-x\}}^1 (x+y) dy dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ $$=\frac{\int_{c_1}^1 \left[ xy+y^2/2\right]_{\max\{0,c_2-x\}}^1 dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ $$=\frac{\int_{c_1}^1 x(1-\max\{0,c_2-x\})+\frac{1-\max\{0,c_2-x\}^2}{2} dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ Now, for $x\ge c_2$, $\max\{0,c_2-x\}=0$, and $\max\{0,c_2-x\}=c_2-x$ otherwise. Hence, for $c_2> c_1$, $$=\frac{\int_{c_1}^{c_2} x(1-c_2+x)+\frac{1-(c_2-x)^2}{2} dx+\int_{c_2}^1 x+1/2 dx}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ $$=\frac{\left[ \frac{(1-c_2)x^2}{2}+\frac{x^3}{3}+\frac{x(1-c_2^2)}{2}-\frac{x^3}{6}+\frac{c_2x^2}{2} \right]_{c_1}^{c_2}+\left[ \frac{x^2+x}{2} \right]_{c_2}^1}{\int_0^1 \int_0^1 1\{x\ge c_1\}\cdot 1\{x+y\ge c_2\} dy dx}$$ where I will not simplify the numerator further since it will remain relatively messy, with cubic terms for $c_1$ and $c_2$. Instead of integrating in the denominator, I use basic geometry to calculate the area, which for $c_2>c_1$ is a square minus a triangle. Hence, $$=\frac{\left[ \frac{(1-c_2)x^2}{2}+\frac{x^3}{3}+\frac{x(1-c_2^2)}{2}-\frac{x^3}{6}+\frac{c_2x^2}{2} \right]_{c_1}^{c_2}+1-\frac{c_2^2+c_2}{2}}{1-c_1+c_1c_2-\frac{c_1^2+c_2^2}{2}}.$$ Now, for $c_1,c_2=0$, the two conditions become non-binding, and this expression simplifies to 1, which is the correct unconditional expectation.
Is this approach correct, and can you spot any mistakes in the computations?
(Moving comment to answer as OP suggested.)
The approach and most of it looks fine — you’re definitely on the right track. However, I think the lower limit of $\int^1_{\max(0,c_2-x)}$ should be $\min(1,\max(0,c_2-x))$. For example, sketch the region of possible $(x,y)$ in the case $c_1=0.1,c_2=1.2$. This is surprisingly tricky to do in general!