<s>[INST] Characteristic polynomials of matrices related How to show that the characteristic polynomials of matrices A and B are $\lambda^{n-1}(\lambda ^2-\lambda -n)=0$ and $\lambda^{n-1}(\lambda^2+\lambda-n)=0$ respectively by applying elementary row or column operations.
$A=\begin{bmatrix}
1 & 1 & 1 & \cdots & 1 \\
1 & 0 & 0 & \cdots & 0 \\
1 & 0 & 0 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & 0 & 0 & \cdots & 0 \\ 
\end{bmatrix}$
$B=\begin{bmatrix}
-1 & 1 & 1 & \cdots & 1 \\
1 & 0 & 0 & \cdots & 0 \\
1 & 0 & 0 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & 0 & 0 & \cdots & 0 \\ 
\end{bmatrix}$
Where $A$ and $B$ are symmetric matrices of order $n+1$.
 [/INST] Use induction on $n$, we only consider the matrix $A$ because solving $B$ is similar. Before starting, I think that the characteristic polynomial of $A$ and $B$ should be of the form $\color{red}{(-1)^{n+1}}\lambda^{n-1}(\lambda^2-\lambda-n)$ and
$\color{red}{(-1)^{n+1}}\lambda^{n-1}(\lambda^2+\lambda-n)$, respectively. 
For $n=1$, then
$$\det(A-tI_2)=\left\vert\begin{matrix}1-t&1\\1&-t\end{matrix}\right\vert=t^2-t-1,$$
which is done.
Now, suppose that the result holds for some $n\in\mathbb{N}$, then for $n+1$,
we have
\begin{align*}
\det(A-tI_{n+2})&=
\left\vert
\begin{matrix}
1-t&1&1&\cdots&1\\
1&-t&0&\cdots&0\\
1&0&-t&\cdots&0\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
\color{blue} 1&0&0&\cdots&\color{blue}{-t}
\end{matrix}
\right\vert_{n+2}\\
&=(-1)^{n+3}
\left\vert
\begin{matrix}
1&1&1&\cdots&1&1\\
-t&0&0&\cdots&0&0\\
0&-t&0&\cdots&0&0\\
\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\
0&0&0&\cdots&0&0\\
0&0&0&\cdots&-t&0
\end{matrix}
\right\vert_{n+1}
-t
\left\vert
\begin{matrix}
1-t&1&1&\cdots&1\\
1&-t&0&\cdots&0\\
1&0&-t&\cdots&0\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
1&0&0&\cdots&-t
\end{matrix}
\right\vert_{n+1}\\
&=(-1)^{n+3}
\left\vert
\begin{matrix}
1&1&1&\cdots&1&\color{blue}1\\
-t&0&0&\cdots&0&0\\
0&-t&0&\cdots&0&0\\
\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\
0&0&0&\cdots&0&0\\
0&0&0&\cdots&-t&0
\end{matrix}
\right\vert_{n+1}
-t(-1)^{n+1}t^{n-1}(t^2-t-n)\\
&=
(-1)^{n+3}(-1)^{n+2}
\left\vert
\begin{matrix}
-t&0&\cdots&0\\
0&-t&\cdots&0\\
\vdots&\vdots&\ddots&\vdots\\
0&0&\cdots&-t
\end{matrix}
\right\vert_{n}
+(-1)^{n+2}t^n(t^2-t-n)\\
&=-(-1)^nt^n+(-1)^{n+2}t^n(t^2-t-n)\\
&=(-1)^{n+2}t^n[(t^2-t-n)-1]\\
&=(-1)^{(n+1)+1}t^{(n+1)+1}[t^2-t-(n+1)].
\end{align*}
This completes the proof for the matrix $A$.
</s>