= Solution
The columns outside indices $i,j$ are unchanged coordinate <vectors>. The remaining two columns have nonzero entries only in rows $i,j$, with the $2\times2$ block $M(\theta)$. They have squared <norm> $\cos^2\theta+\sin^2\theta=1$ and mutual <inner product> zero; they are also <orthogonal> to all the unchanged columns. Hence $J^TJ=I$.
Let $r=\sqrt{x_i^2+x_j^2}$. If $r>0$, choose $\theta\in[-\pi,\pi]$ with $\cos\theta=x_i/r$ and $\sin\theta=x_j/r$. Then
$$
y_i=\cos\theta\,x_i+\sin\theta\,x_j=r,\qquad
y_j=-\sin\theta\,x_i+\cos\theta\,x_j=0.
$$
Every other coordinate is unchanged. If $r=0$, choose $\theta=0$; the same conclusions hold. Therefore the procedure can be fixed with the nonnegative <pivot> convention
$$
\boxed{y_i=\sqrt{x_i^2+x_j^2},\qquad y_j=0,\qquad y_k=x_k\ (k\neq i,j).}
$$
This is a <Givens rotation>.
Back to article page