Let l be the length of the side of the square. We can relate this problem to picking a random point, (A,B) from a 1x1 square (so l = 1). The length of the line segment AB is given by .
Here we see that and every point is equally likely. Using the hint, we have