Calculation involving determinant of a matrix Suppose I have the following Toeplitz symmetric matrix
\begin{align}
M=\begin{bmatrix}
1 & c & c & x \\
c & 1 & c & c \\
c & c & 1 & c \\
x & c & c & 1 
\end{bmatrix}
\end{align}
I want to write an algorithm that takes $c$ as input and calculates the range of $x$ for which matrix $M$ is positive semidefinite.
Currently, I do Gaussian elimination by hand and reduce the problem to checking the determinant of a $2 \times 2$ matrix. But how do I automate the process so I can write a function that takes $c$ and $n$ as inputs, where $n$ is the dimension of $M$, and returns the range of $x$. Thanks!

For your specific example, done with pen and paper,
$$M_4=\left(
\begin{array}{cccc}
 1 & c & c & x \\
 c & 1 & c & c \\
 c & c & 1 & c \\
 x & c & c & 1
\end{array}
\right)$$
$$\Delta_4=\left(4 c^3-5 c^2+1\right)+\left(4 c^2-4 c^3\right) x+\left(c^2-1\right)
   x^2$$ With a computer
$$M_5=\left(
\begin{array}{ccccc}
 1 & c & c & c & x \\
 c & 1 & c & c & c \\
 c & c & 1 & c & c \\
 c & c & c & 1 & c \\
 x & c & c & c & 1
\end{array}
\right)$$
$$\Delta_5=\left(-6 c^4+14 c^3-9 c^2+1\right)+6 \left(c^4-2 c^3+c^2\right) x+\left(-2 c^3+3
   c^2-1\right) x^2$$
