# Understanding underlying algebra behind simplified expression

The solution to a linear algebra problem I'm working on reads:

$$\det(A-\lambda I) = \det\begin{pmatrix}-\lambda & 1 & 0 \\ 0 & -\lambda & 1\\ 1 & -1 & 1-\lambda\end{pmatrix} = -\lambda(-\lambda(1-\lambda)+1)+1$$ This may be written as $\lambda^2(1-\lambda)+(1-\lambda) = (\lambda^2+1)(1-\lambda)$.

I understand how the determinant is calculated, but am struggling to understand the algebraic manipulation at the end. By my math, $-\lambda(-\lambda(1-\lambda)+1))+1$ simplifies to $-\lambda(-\lambda + \lambda^2 +1)+1$, which simplifies to $(\lambda^2 - \lambda^3 - \lambda)+1$

What am I misunderstanding here?

-

Particularly, the algebra used to factor the expression is: \begin{align} -\lambda(-\lambda(1-\lambda) + 1) + 1 &= \lambda^2(1-\lambda) - \lambda + 1\\ &= \color{red}{\lambda^2}\color{blue}{(1-\lambda)} +\color{red}{1}\color{blue}{(1 - \lambda)} \\ &= \color{blue}{(1-\lambda)}\color{red}{(\lambda^2+1)} \end{align}

-
I love this site, thanks! you win for the color coding! will accept when I can. – aqaeous Apr 28 '14 at 2:41

You are completely correct. I guess the only thing you're missing is that $-\lambda^3 + \lambda^2 -\lambda + 1 = (\lambda^2 + 1)(1 - \lambda)$. The latter is the factorization of the former.

In general, when we have a polynomial, we want to factor it to find its roots. One way to do this is to use the integral root test or something similar.

-

$$-\lambda[-\lambda(1-\lambda)+1]+1 = \lambda^2(1-\lambda) +(- \lambda + 1) = (1-\lambda)(\lambda^2+1)$$

-