You can make a orthogonal change of coordinates as follows. First choose an orthogonal basis of the range of $A$, and one of the kernel. This makes a basis of $\mathbb R^n$ in which $A$ is block-diagonal with a zero block: $$A=\begin{pmatrix} A_+ & 0 \\\\ 0 & 0 \end{pmatrix},\qquad B=\begin{pmatrix} B_1 & B_2 \\\\ B_2^T & B_3 \end{pmatrix}.$$ Then a necessary condition is that $B_3\le0$. Now change the basis of $\ker A$ by choosing orthogonal bases of the kernel and range of $B_3$. Then $A$ is unchanged, whereas $B$ becomes $$B==\begin{pmatrix} B_1 & B_{12} & B_{13} \\\\ B_{12}^T & B_{22} & 0 \\\\ B_{13}^T & 0 & 0 \end{pmatrix}.$$ By assumption, we have $B_{22}< 0$. A new necessary condition appears, that $B_{13}=0$. Now the necessary and sufficient condition over $k$ is that $$k\ge\lambda_{max}(S(B_{1}-B_{12}B_{22}^{-T}B_{12}^T)S).$$
Denis Serre
- 52.3k
- 10
- 146
- 300