Prove that $\det(A^2 + A + xI) = x$ 
Let $x > 0$ and $A \in \mathbb R^{2 \times 2}$ satisfy $\det(A^2 + xI) = 0$. Prove that $$\det(A^2 + A + xI) = x$$

I have tried something with characteristic polynomial and eigenvalues but it did not work. Can you give me a hint to solve this problem?
 A: Let $\lambda_{1,2}$ be the eigenvalues of $A$. Then $\lambda_{1,2}^2$ are the eigenvalues of $A^2$, and hence  $-\lambda_{1,2}^2$ are the eigenvalues of $-A^2$
As $\det(xI-(-A^2))=0$, it follows that $x$ is an eigenvalue of $-A^2$.
Therefore $x=-\lambda_j^2$ for $j=1$ or $j=2$. Without loss of generality $x=-\lambda_1^2$. This implies that $\lambda_1$ is purely complex, and as $A$ is a real matrix, $\lambda_2$ is the conjugate of $\lambda_1$. From $x=-\lambda_1^2$ you then get
$$\lambda_{1,2} = \pm i \sqrt{x}$$
This implies that the eigenvalues of $A^2+A+xI$ are $ -x  \pm i \sqrt{x} +x = \pm i \sqrt{x}$. The determinant conclusion follows.
A: Let me try to do this without mentioning complex numbers or square roots.
Given that $\det(A^2 + xI) = 0$, there must be some nonzero vector $v\in\ker(A^2+xI)$. It cannot be an eigenvector, as its eigenvalue would then have to be a real root of $X^2+x$ which does not exist (since $x>0$); therefore $v$ and $Av$ are linearly independent. Now $\ker(A^2+xI)$ is $A$-stable, so with $v$ it also contains $Av$, whence $\ker(A^2+xI)=\Bbb R^2$. Then $X^2+x$ is the minimal polynomial of$~A$. Also the fact that $A^2+xI=0$ means that the expression $A^2+A+xI$ reduces to just$~A$. 
Given its degree, $X^2+x$ must also be the characteristic polynomial of$~A$; in particular its constant term is $x=\det(-A)=\det(A)$. One also gets that $0=\operatorname{tr}(A)$, although that wasn't asked for.
A: Note that
$$
\det(A^2 + xI) = \det(A + i\sqrt x I)\det(A - i\sqrt x I)
$$
Since $A$ is real, its complex eigenvalues come in conjugate pairs.  Thus, in this case we conclude that $A$ has eigenvalues $\pm i \sqrt x$.
Now, if $\lambda$ is an eigenvalue of $A$, then $\lambda^2 + \lambda + x$ is an eigenvalue of $A^2 + A + xI$.  Thus, the matrix $A^2 + A + xI$ has eigenvalues
$$
(i\sqrt x)^2 + i\sqrt x + x = i\sqrt x, \\
(-i\sqrt x)^2 - i\sqrt x + x = -i\sqrt x
$$
Now, $\det(A^2 + A + xI)$ is the product of these eigenvalues, which is to say
$$
\det(A^2 + A + xI) = (i\sqrt{x})(-i\sqrt{x}) = x
$$ 
as desired.

Alternatively: after finding the eigenvalues of $A$, deduce that 
$$
A^2 + xI = (A + i\sqrt{x} I)(A - i\sqrt{x} I) = 0
$$ 
(by Cayley-Hamilton), so that
$$
\det(A^2 + A + xI) = \det(0 + A) = \det(A) = (i\sqrt x)(-i\sqrt x) = x
$$
A: Let's try to rewrite the proof by means of the Cayley-Hamiton theorem for $2 \times 2$ matrices:
For $2 \times 2$ matrices $A$, one has that the characteristic polynomial $f(\lambda)=det(A-\lambda I)$ may be rewritten as 
$$f(\lambda)=\lambda^2-{tr}(A)\lambda+det(A).$$ 
Moreover $O=f(A)=A^2-tr(A)A+det(A)I$.
On the other hand, the hypothesis $\det(A^2+xI)=0$ is equivalent to say that the equation $A^2v+xv=O$ admits a non-zero vector $v$ as solution.
In particular, the set of equations $O=f(A)v=A^2v+xv$ gives rise to $tr(A)=0$ and $\det(A)=x(>0)$.
That is $A^2+xI =O$ and $\det(A)=x$. This implies that
$\det(A^2+A+xI)=\det(A)=x,$
as desired.
