# For $A \in \mathbb{R}^{3 \times 3}$, find $P, Q \in \mathbb{R}^{3 \times 3}$ such that $A = P-Q$, where $P^2 = P$, $Q^2 = Q$ and $PQ = 0 = QP$

This is an exercise from a previous linear algebra exam:

The diagonalisable matrix $$A = \begin{pmatrix} 3 & -6 & 2\\ 4 & -7 & 2\\ 8 & -12 & 3 \end{pmatrix} \in \mathbb{R}^{3 \times 3}$$ has the eigenvalues 1 and -1. Find $P, Q \in \mathbb{R}^{3 \times 3}$ such that $A = P-Q$, where $P^2 = P$, $Q^2 = Q$ and $PQ = 0 = QP$.

We want $A = P-Q$, so we will have $A^2 = P+Q$ and by plugging in $Q = P - A$, we find $$A^2 = 2P - A \iff P = \frac{1}{2} (A^2 + A).$$

This gives $$P = \begin{pmatrix} 2 & -3 & 1\\ 2 & -3 & 1\\ 4 & -6 & 2 \end{pmatrix} \text{ and } Q = \begin{pmatrix} -1 & 3 & -1\\ -2 & 4 & -1\\ -4 & 6 & -1 \end{pmatrix}$$ and these two matrices satisfy all conditions.

Question: The problem states that $A$ is diagonalisable and also gives its eigenvalues. Is there another, maybe even faster way to find $P$ and $Q$ by diagonalising $A$?

-
Just noting for the record that you never used the hypothesis about the eigenvalues of $A$, but your method would give false answers without that hypothesis. – Gerry Myerson Aug 12 '12 at 12:59
@GerryMyerson: Why exactly? Is there some step that needs those eigenvalues? – Huy Aug 12 '12 at 17:00
Pick any matrix $A$ that doesn't have those eigenvalues, define $P=(A^2+A)/2$, $Q=P-A$, and you will find $P$ and $Q$ don't satisfy the conditions. To prove they satisfy the conditions, you need to use the hypothesis about the eigenvalues. – Gerry Myerson Aug 12 '12 at 23:25

There's an invertible matrix $B$ such that $A=BDB^{-1}$, where $D$ is diagonal and has diagonal entries $\pm1$. $D=E-F$ where $E,F$ are diagonal, $E$ has 1 where $D$ does and 0 elsewhere, $F$ has 1 where $D$ has $-1$ and 0 elsewhere. Let $P=BEB^{-1}$, $Q=BFB^{-1}$.