Let $A$ and $B$ be two real symmetric matrices such that $A^{2018} = B^{2018}$. Show that $\cos A = \cos B$.
(And is it true that $\sin A = \sin B$ ?)
We can write $A = PDP^T$ and $B = QD'Q^T$ by the spectral theorem ;
Hence $PD^{2018}P^T = QD'^{2018}Q^T$
Do you have a hint to solve this?
$A^2$ and $B^2$ are positive definite matrices satisfying $$ (A^2)^{1009} = (B^2)^{1009} $$ It follows that $A^2 = B^2$.
Now, note that the power series for $\cos(A)$ may be written as a power series on $A^2$.
It is easy to come up with a counterexample for $\sin$. If you like, take $A = \pi/2$, $B = -\pi/2$ (both $1 \times 1$ matrices).