Let $A,B$ be $d\times d$ symmetric matrices with real coefficients such that $A$ is positive semi-definite. Prove that $\det(tA+B)\in \mathbb{R}[t]$ is either $0$ or has all roots real.
Here is what I tried:
Let us at-first assume that $A$ is positive definite. Then we know that there is a non-singular matrix $S$ such that $SAS^{T}=I$ and $SBS^{T}=\Lambda$, where $\Lambda$ is some diagonal matrix. Thus the problem reduces to showing that $\det(tI+\Lambda)$ has real roots, but this is obvious because the roots are eigenvalues of $\Lambda$ and any symmetric matrix has all real eigenvalues.
However, I am stuck with the case where $A$ has a $0$ eigenvalue. My guess is that we can still find such a invertible matrix $S$ such that $SAS^{T}$ is diagonal with only $0$'s and $1$'s on the diagonal and $SBS^{T}$ is diagonal. But I am not sure how to prove this. Any help would be appreciated.