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. 

Hint: to find the joint pdf of $(Y_1,\max(Y_1,Y_2))$:
The support of $(Y_1,\max(Y_1,Y_2))$ is 
Observe first that the CDF of $Y_i$ is $F_\theta(y)=\frac{y^3}{\theta^3}$ for $
0<y<\theta$
Now if $F$ and $f$ are the joint CDF and pdf of $Y_1$ and $Y_2$, then for $0<y_1,  y_2\le\theta$:
$$F(y_1,y_2)=P(Y_1\le y_1,\max(Y_1,Y_2)\le y_2)=P(Y_1\le y_1,Y_1\le y_2,Y_2\le y_2)\\=P(Y_1\le\min(y_1,y_2),Y_2\le y_2)=P(Y_1\le \min(y_1,y_2))P(Y_2\le y_2)=F_\theta(\min(y_1,y_2))F_\theta(y_2)$$
So
$$F(y_1,y_2)=
\begin{cases}
F_\theta(y_1)F_\theta(y_2)=\frac{9 y_1^2 y_2^2}{\theta^6}& \text{ if } y_1\le y_2\\
F_\theta(y_2)F_\theta(y_2)=\frac{9 y_2^4}{\theta^6}& \text{ if } y_1> y_2
\end{cases}
$$
The problem with this approach is that when you differentiate, there is a Dirac component coming from a discontinuity of $F$, which is messy to work with.
So for the simplest path to final goal, you should follow leonbloy advice in his answer and condition on whether $Y_1\le Y_2$ or not:
$$E[Y_1|\max(Y_1,Y_2)]=E[Y_1|\max(Y_1,Y_2),Y_1\le Y_2]P(Y_1\le Y_2)+E[Y_1|\max(Y_1,Y_2),Y_1>Y_2]P(Y_1>Y_2)$$
