The larger coordinate

A point (X,Y) is drawn uniformly from the unit square [0,1]^2. Let Z=\max(X,Y). Find the distribution function and the density of Z.

For z\in[0,1] the event \{Z\le z\} is the square [0,z]^2, which has area z^2. Thus F(z)=0 for z<0, F(z)=z^2 for 0\le z\le 1, and F(z)=1 for z>1. Differentiating on (0,1) gives the density f(z)=2z there, and f(z)=0 elsewhere.