<s>[INST] Factor 9 terms with 3 variables into 4 expression I just got the determinant from a 4x4 matrix and the simplified version is below.
$$
det(M) =  \begin{vmatrix}
2k-mw^2 & -k  & 0 & 0 \\
-k & 2k-mw^2 & -k  & 0 \\
0 & -k & 2k-mw^2 & -k  \\
0 & 0 & -k & 2k-mw^2\\
\end{vmatrix} 
$$
the polynomial I got after 1 hr is:
$$
5k^4 - 6k^2mw^2 + 6k^2m^2w^4 - 8k^3mw^2 + 2km^2w^4 - 4km^3w^6 - 3m^3w^6 + m^4w^8 - k^2m^2w^4
$$
I want to factor this out, I tried so many ways but just gave up.
Now I know, since it was defined in Physics that the system I am studying would produce 4 normal frequencies.
Usually, the form appear as:
$$
(k-mw^2)(3k-mw^2) \\
$$
(the example above is for 2x2 matrix, hence produces 2 normal frequencies)
which is very easy to solve for $ w $.
Please help, I just want to equate the whole equation to zero and get w.
 [/INST] First, let's make things a bit nicer to look at.  Let's substitute $x = 2k - mw^2$:
$$
det(M) =  \begin{vmatrix}
x & -k  & 0 & 0 \\
-k & x & -k  & 0 \\
0 & -k & x & -k  \\
0 & 0 & -k & x\\
\end{vmatrix} 
$$
I calculate the determinant to be $x^4 - 3k^2x^2 + k^4:$
$$
det(M) =  x\begin{vmatrix}
x & -k  & 0 \\
-k & x & -k  \\
0 & -k & x\\
\end{vmatrix} + k\begin{vmatrix}
-k & -k  & 0 \\
0 & x & -k  \\
0 & -k & x\\
\end{vmatrix} \\
= x^2\begin{vmatrix}
x & -k  \\
-k & x\\
\end{vmatrix} + xk\begin{vmatrix}
-k & -k  \\
0 & x\\
\end{vmatrix} -k^2\begin{vmatrix}
x & -k  \\
-k &x\\
\end{vmatrix} \\ = x^4 - x^2k^2 - x^2k^2 - x^2k^2+ k^4 \\
= x^4 - 3k^2x^2 + k^4. 
$$
Using the quadratic formula on $x^2$ gives
$$x^2 = \frac{(3 \pm \sqrt{5})k^2}{2} = (2k - mw^2)^2.$$
Now take square roots of both sides, isolate $w$, and square root again, tossing the imaginary roots as you go along.
</s>