Factorize the polynomial
$$P(x)= \begin{vmatrix} a_1^2-x & a_{1}a_2 & a_1a_3 & \cdots & a_1a_n \\ a_2a_1 & a_2^2-x & a_{2}a_3 & \cdots & a_2a_n\\ a_3a_1 & a_3a_2 & a_3^2-x & \cdots & a_3a_n \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ a_na_1 & a_na_2 & a_na_3 & \cdots & a_n^2-x\\ \end{vmatrix}$$
I was thinking of getting the eigenvalues for the matrix , however i couldn't find a way to determine them.
I also tried to get the determinant for n=2 :
determinant = $X(X-(a_1^2+a_2^2))$
However that alone is not sufficient to generalize the determinant
Any hints or advices appreciated.
I would also be grateful if anyone would know somewhere where i can tackle similar problems .
Thanks in advance.