Another way to find the equation a matrix satisfies under the Cayley-Hamilton theorem is to compute $P^2$ directly and then test which combination of $P$, $P^2$ and $I$ gives the zero matrix.
The matrix is $P = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix}$.
First find $P^2$ by multiplying $P$ with itself:
\[ P^2 = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix}\begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} = \begin{bmatrix} 4 & 5 \\ 0 & 9 \end{bmatrix} \]Now test option (A), $P^2 - 5P + 6I = 0$, by substituting the matrices:
\[ \begin{bmatrix} 4 & 5 \\ 0 & 9 \end{bmatrix} - 5\begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} + 6\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \]Work it entry by entry. Top left: $4 - 10 + 6 = 0$. Top right: $5 - 5 + 0 = 0$. Bottom left: $0 - 0 + 0 = 0$. Bottom right: $9 - 15 + 6 = 0$.
Every entry comes out zero, so $P^2 - 5P + 6I = 0$ holds for this matrix. That confirms option (A) directly, without using the trace and determinant shortcut.
Only option (A) makes every entry of the matrix expression vanish, so $P^2-5P+6I=0$ is the equation this matrix satisfies under the Cayley-Hamilton theorem.