Let $Z = ||X-Y||_2^2$ where $X$ and $Y$ are two points selected uniformly-randomly and independently on the unit circle. I'm trying to find the PDF of $Z$.
It is very similar to this question but answers over there are too clever for me. So here is what I did:
Since we are on the unit circle, if we switch to polar coordinates, both $X$ and $Y$ can be characterized by the angle. So, $$ X = \begin{bmatrix}cos(\theta_x)\\sin(\theta_x)\end{bmatrix}\ \ \ Y = \begin{bmatrix}cos(\theta_y)\\sin(\theta_y)\end{bmatrix}$$ where $\theta_x$ and $\theta_y$ are both $\sim Unif(0, 2\pi)$. Now the squared $L_2$ norm becomes
\begin{align*} ||X-Y||_2^2 & = (cos(\theta_x)-cos(\theta_y))^2 + (sin(\theta_x)-sin(\theta_y))^2 \\[7pt] & = 2 - 2(cos(\theta_x)cos(\theta_y)+sin(\theta_x)sin(\theta_y)) \\[7pt] & = 2 - 2cos(\theta_x - \theta_y) \end{align*}
I can now formulate the CDF of $Z$:
\begin{align*} P(Z\leq z) & = P(||X-Y||_2^2 \leq z) \\[10pt] & = P(2 - 2cos(\theta_x - \theta_y) \leq z) \\[7pt] & = P(cos(\theta_x - \theta_y) \geq \frac{2-z}{2}) \end{align*}
Now I take $arccos$ of both terms: \begin{align*} P(Z\leq z) & = P(\theta_x - \theta_y \leq arccos(\frac{2-z}{2})) \end{align*}
And I think this corresponds to the area of the white trapezoid below, where axes represent $\theta_x$ and $\theta_y$, red & blue lines are boundaries for $(0, 2\pi)$ and green line is $\theta_x - \theta_y = arccos(\frac{2-z}{2})$:
which gives
$$ F_Z(z) = \begin{cases} 0 & \text{ for } z \leq 0\\[7pt] 4\pi^2 - \frac{1}{2} (2\pi - arccos(\frac{2-z}{2}))^2 & \text{ for } 0 \lt z \lt 4\\[7pt] 1 & \text{ for } z \geq 4\\ \end{cases}$$
but this can't be true because $F_Z(z)$ is not continous at either end. I suspect I failed with the $arccos$ operation, any thoughts on how can I correct the steps?