Let $A$ be an $n*n$ matrix such that $A^3=A^2+A-I$. If $A$ Is diagonalizable Show that $A=A^{-1}$ 
Let $A$ be an $n*n$ matrix such that $A^3=A^2+A-I$. 
  
  
*
  
*Show that $A$ is invertible
  
*Suppose in $A$ is diagonalizable. Show that $A=A^{-1}$

For the first part I managed to do it by a rearrangement, 
$$I=A^{2}+A-A^{3}=A(A+I-A^2)$$ 
Thus $A+I-A^2$ is the right inverse and simillarly we have $A+I-A^2$as the left inverse. Hence $A$ is invertible.  
But for part 2. What I was able to do is: 
$A^{-1}=A+I-A^2=A+(PDP^{-1})(PDP^{-1})^{-1}-PD^{2}P^{-1}$.
But here after I don't see how should I proceed.  
 A: Hint If $\lambda$ is an eigenvalue, then 
$$\lambda^3-\lambda^2-\lambda+1=0 \Rightarrow (\lambda-1)^2(\lambda+1)=0 \Rightarrow \lambda=\pm 1$$
What is then $D^2$? 
Therefore
$$A^2=PD^2P^{-1}=??$$
A: Suppose $A$ is a diagonalizable, and write $A=PDP^{-1}$. Then the equation becomes $PD^3P^{-1}=PD^2P^{-1}+PDP^{-1}-I$, which when we multiply by $P^{-1}$ on the left and $P$ on the right, we see is equivalent to $D^3=D^2+D-I$. Thus it suffices to show the diagonal case.
Let $D$ have diagonal entries $\lambda_i$ ($1\leq i\leq n$). Then for each $i$ we have the equation $\lambda_i^3-\lambda_i^2-\lambda_i+1=0$ (since entries of diagonal matrices are multiplied directly), which is equivalent to $(\lambda_i+1)(\lambda_i-1)^2=0$. Now, find $\lambda_i$ to solve for $D$ and hence $D^{-1}$. I think you can take it from here.
A: Notice that $A$ satisfies the equation $x^3-x^2-x+1=0$. Upon factoring we see that the eigenvalues are $1$ and $-1$, where $1$ is of multiplicity $2$. So if $A$ is diagonalizable, we can write $A$ as $A=PDP^{-1}$, where the diagonal matrix $D$ is given by 
\begin{pmatrix} 
1 & 0 & 0\\
0 & 1 &0 \\
0 & 0 & -1
\end{pmatrix}
So, if we compute $D^2$ we get $I$. Hence,
$A^{-1}=A+I-A^2=A+I-(PDP^{-1})^2=A+I-PD^2P^{-1}=A+I-PIP^{-1}=A+I-I=A$.
A: Hint: consider the 1 dimensional case, which is immediate. Then argue that this case is sufficient by considering the fact that $A$ is diagonalisable.
