= Solution
Left multiplication by the given <Givens rotation> mixes rows two and three, so $b_{31}=a_{21}\sin\theta_1+a_{31}\cos\theta_1$. If $r_1=\sqrt{a_{21}^2+a_{31}^2}>0$, choose
$$
\boxed{\cos\theta_1=\frac{a_{21}}{r_1},\qquad\sin\theta_1=-\frac{a_{31}}{r_1}.}
$$
Equivalently $\theta_1=\operatorname{atan2}(-a_{31},a_{21})$ modulo $2\pi$. Substitution gives $b_{31}=0$ and $b_{21}=r_1$. If $a_{21}=a_{31}=0$, take $\theta_1=0$; the desired zero is already present. This also covers singular matrices without division by zero.
Back to article page