# Conditional expectation of uniform random variable given sum of two uniform random variables

We know $X_1 \sim U[0, 1]$ and $X_2 \sim U[0, 2]$. I'm trying to compute $E[X_1^3 | 2X_1 + X_2 = 2]$.

I was given the hint that $X_1 | 2X_1 + X_2 \sim U[0, 1]$, and from here on I can compute $E[X_1^3 | 2X_1 + X_2 = 2] = \frac{1}{4}$. However, I'm not sure how we can prove the hint.

When $$2X_1+X_2=2$$, we know that $$X_1=\frac{2-X_2}{2}$$.
We also know that $$X_2\sim U[0,2]$$, so $$2-X_2\sim U[0,2]$$, and therefore $$\frac{2-X_2}{2}\sim U[0,1]$$.
When $$2X_1+X_2=2$$, we have that $$X_1=\frac{2-X_2}{2}\sim U[0,1]$$.