Finding $E(Y_1 \mid \max(Y_1, Y_2))$ for independent $Y_1, Y_2$ random variables. Suppose that $Y_1, Y_2$ are two independent observations from the following distribution:
$$
f_\theta(y) = \begin{cases} \dfrac{3y^2}{\theta^3} &\text{for } 0 <y \leq \theta, \ \theta>0 \\[8pt]
0 & \text{otherwise}\end{cases} 
$$
I am trying to find $E(Y_1 \mid \max(Y_1, Y_2))$, and am not sure how to do this. I can directly compute the integral but I still need to find the joint distribution of $Y_1$ and $\max(Y_1,Y_2)$, which I am not sure how to derive. 

Without computing the joint density:
Let's define an indicator random variable $K$ taking value $1$  if $Y_1 > Y_2$, $2$ otherwise. Clearly, from symmetry, $P(K=1)=\frac12$. Let $Z=\max(Y_1,Y_2)$. 
Then, using the law of total expectation with respect to variable $K$, $$E(Y_1 \mid Z) =E( E(Y_1 \mid Z , K))=\frac12  E(Y_1 \mid Z, K=1)+\frac12  E(Y_1 \mid Z ,K=2)$$
But $E(Y_1 \mid Z, K=1)=Z$ and 
$$E(Y_1 \mid Z, K=2)=E(Y_1 \mid Y_1 < Z)$$
This expectation corresponds to that of a truncated $Y_1$:
$$E(Y_1 \mid Y_1 < Z)=\frac{\int_0^Z y\, 3 y^2\, dy }{\int_0^Z 3 y^2 \,dy}=\frac{3}{4}Z$$
Putting all together:
$$E(Y_1 \mid Z)=\frac{1}{2}Z+\frac{3}{8}Z=\frac{7}{8}Z$$
