Say I have a 3x3 symmetric matrix $S$, having two positive and one negative eigenvalue.
I'm looking for two orthogonal unit vectors $X$ and $Y$ such that
$$X^T S X + Y^T S Y = 0$$
I have tried to solve it using spherical or cartesian parametrizations of $X$ and $Y$ but it quickly becomes painful. Do you know a way to solve this ?
Edit : I should insist on the unit vector requirement, otherwise the problem is indeed easier.
Call the three eigenvalues $a,b$ and $-c$, where $a\ge b\ge0\ge-c$. Complete $\{x,y\}$ to an orthonormal basis $\{x,y,z\}$ and let $Q$ be the augmented matrix $[x,y,z]$. Then $Q$ is orthogonal and $$ a+b-c=\operatorname{tr}(S)=\operatorname{tr}(Q^TSQ)=x^TSx+y^TSy+z^TSz=z^TSz. $$ Since $-c\le z^TSz\le a$, we see that a solution $\{x,y\}$ exists if and only if $-c\le a+b-c\le a$, i.e. iff $c\ge b$.
In case $c\ge b$ is indeed true, take any unit vector $z$ such that $z^TSz=a+b-c$ and any two unit vectors $x,y$ that form an orthonormal basis with $z$ would give a solution to your problem. Edit: for instance, let $u,v,w$ be three orthonormal eigenvectors for the eigenvalues $a,b,-c$ respectively. Then $z=\sqrt{\frac{a+b}{a+c}}\,u+\sqrt{\frac{c-b}{a+c}}\,w$ will satisfy the equation $z^TSz=a+b-c$. Now you may take $x=\sqrt{\frac{a+b}{a+c}}\,w-\sqrt{\frac{c-b}{a+c}}\,u$ and $y=v$.