= Solution
Set $c=\langle\psi|\phi\rangle$. The off-diagonal Hermiticity identity holds automatically, while
$$
\langle\psi|H|\psi\rangle=gc
$$
must be real. Thus
$$
\boxed{g\langle\psi|\phi\rangle\in\mathbb R}
$$
is necessary and sufficient. For $g\ne0$, put $r=gc/|g|\in\mathbb R$. Since the two normalized spanning <vectors> are linearly independent, $|r|<1$.
The normalized <eigenvectors> and <eigenvalues> are
$$
\boxed{
|\pm\rangle=
\frac{(g^*/|g|)|\psi\rangle\pm|\phi\rangle}
{\sqrt{2(1\pm r)}},
\qquad E_\pm=\pm|g|.}
$$
Direct application of $H$ verifies the <eigenvalue> equations. Their unnormalized <inner product> is
$$
-\frac g{|g|}c+\frac{g^*}{|g|}c^*=-r+r=0,
$$
so the distinct <eigenvectors> are orthogonal, as required for a <Hermitian operator>. If $g=0$, $H=0$ and every <vector> is an <eigenvector>.
Back to article page