Probability density function of $max(X,Y)$

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})$?


$\color{green}{\checkmark}\quad$ Your reasoning for the density function of $W=\max(X,Y)$ is correct. Apply the same reasoning to find that of the minimum, with minor modification.

Vis: Let $Z=\min(X,Y)$ such that $X$ and $Y$ are independent and both continuous random variables, with density functions: $f_X$ and $f_Y$. (And cumulative distributions $F_X, F_Y$).

$\begin{align} f_Z(z) & = \frac{\mathrm d\;}{\mathrm d z} \Bbb P(\min(X,Y)\leq z) \\[1ex] & = \frac{\mathrm d\;}{\mathrm d z} (1 - \Bbb P(\min(X,Y)\gt z)) \\[1ex] & = -\frac{\mathrm d\;}{\mathrm d z}\Big( \Bbb P(X>z)\,\Bbb P(Y>z) \Big) \\[1ex] & = -\frac{\mathrm d\;}{\mathrm d z} \Big(\big(1-F_X(z)\big)\big(1-F_Y(z)\big)\Big) \\[1ex] & = f_X(z)\Big(1-F_Y(z)\Big) + \Big(1-F_X(z)\Big)f_Y(z) \end{align}$