Find $\operatorname{Tr}(A^{2018})$ if $\det(A^2-2018I_2)=0, A\in M_2(\mathbb{Q})$
My attempt:
Let $A^2=\begin{bmatrix}a&b\\c&d\end{bmatrix}$ then $B=A^2-2018I_2=\begin{bmatrix}a-2018&b\\c&d-2018\end{bmatrix}$
then $\det(B)=(a-2018)(d-2018)-bc$ then we have: $a = 2018$ or $d=2018$ AND $b=0$ or $c=0$. And I took the possible candidate for $A^2$ when all of these happen at the same time so: $a=2018,d=2018,b=0,c=0\implies \operatorname{Tr}(A^{2018})=2\times2018^{1009}$ by induction.
Did I do everything right? I feel like my solution is not really that good.
Also can you give me some advice that might help me in these kind of situation with problems like this?
Let $$ A=\begin{bmatrix} \sqrt{2018}&0\\0&a\end{bmatrix}.$$ Then, $$ \det(A^2-2018I_2)=0 $$ and $$ A^{2018}=\begin{bmatrix}2018^{1009}&0\\0&a^{2018}\end{bmatrix},$$ which does not have a trace independent of $a$. So, is there any additional information you have about $A$?