As the title shows, is there a way to calculate the eigenvalues of $A\equiv \vec x\vec x^T+\vec y \vec y^T$, where $\vec x$ and $\vec y$ are two linearly independent vectors in $\mathbb{R}^n$(don't have to be unit vector).
Here're some of my thoughts. We can see that $A$ is of rank 2 since it can be seen as a map from $\mathbb{R}^n$ to $\mathbb{R}^n$ and there are only two linearly independent vectors in its range. So we may set the eigenvectors of $A$ as $a\vec x+b\vec y$, where $a$ and $b$ are two real numbers, then we have chances to get the eigenvalues by solving $$A(a\vec x+b\vec y) =\lambda (a\vec x+b\vec y)\tag{1}.$$
For example, if $\vec{x}=\frac{1}{\sqrt{2}}\left( \begin{array}{c} 1\\ 1\\ \end{array} \right) , \vec{y}=\left( \begin{array}{c} 1\\ 0\\ \end{array} \right) $, we can solve eq(1) to get the eigenvalues $1\pm \frac{1}{\sqrt 2}$. But eq(1) only have two equations while with 3 parameters $a,b,\lambda$.
So my question is: is there a way to calculate the eigenvalues of $xx^T+yy^T$, such as a formula related to $\vec x$ and $\vec y$ that I don't know?
Your idea is fine. You may write your product in the following way:
$$ (xx^T + y y^T) \pmatrix{x & y}\pmatrix{a\\b} =\pmatrix{x & y}\pmatrix{x^T \\ y^T} \pmatrix{x & y} \pmatrix{ a\\b}$$ which then becomes $$\pmatrix{x & y}\pmatrix{x^T x & x^T y \\ y^Tx &y^T y} \pmatrix{ a\\b}.$$ In the (sub-)basis $(x,y)$ the problem thus reduces to finding the eigenvalues of $$\pmatrix{x^T x & x^T y \\ y^Tx &y^T y}.$$ The vectors $x$ and $y$ need not be independent, in which case zero may appear as an eigenvalue.
More generally if $A = \sum_i x_i \ell_i^T$ then in the vector space spanned by the $(x_j)$'s the action of $A$ reduces to the matrix: $A_{ij}= \ell_i^T(x_j)$ which you then have to treat. Again the $(x_j)$'s (and the $(\ell_i)$'s need not be linearly independent.