Assume that we have a random variable $W = \max({X,Y})$ and that we would like to find the pdf of $W$. This is what I have done.
$$ F_W(w)= \mathbb{P}[ W\leq w]=\mathbb{P}[ \max({X,Y})\leq w]=\mathbb{P}[ X\leq w]\mathbb{P}[Y\leq w]= F_X(w)F_y(w) $$ then the pdf is $$f_W(w) = \frac{dF_W(w)}{dw}=\frac{d (F_X(w)F_y(w))}{dw}= f_x(w)F_y(w)+ f_y(w)F_x(w)$$
Is my reasoning correct?
What if one want to find the distribution of $W = \min({X,Y})$?