This question may sound too basic, but I am new to complex numbers.
We all know $e^{it}=\cos t+i\sin t$. Given a real diagonal matrix $P$, what does $e^{itP}$ look like? I am guessing it would be: $e^{itP}=\cos P_{11} t +i\sin P_{22} t$, where $P_{11}$ and $P_{22}$ are diagonal entries. But I am pretty sure my guess is not correct.
Let's do things using the "complicated formula": $$ e^{itP} = \sum_{k=0}^\infty \frac 1{k!}(itP)^k = \sum_{k=0}^\infty \frac 1{k!}i^k t^k P^k = \sum_{k=0}^\infty \frac 1{k!}i^k t^k \pmatrix{P_{11}^k & 0 \\0 & P_{22}^k} = \\ \pmatrix{\sum_{k=0}^\infty \frac 1{k!}i^k t^k P_{11}^k & 0 \\0 & \sum_{k=0}^\infty \frac 1{k!}i^k t^k P_{22}^k} = \pmatrix{e^{iP_{11}t} & 0\\ 0 & e^{iP_{22}t}}=\\ \pmatrix{\cos P_{11}t + i \sin P_{11}t & 0\\ 0 & \cos P_{22}t + i \sin P_{22}t} = \\ \pmatrix{\cos P_{11}t & 0\\ 0 & \cos P_{22}t} + i \pmatrix{\sin P_{11}t & 0\\ 0 & \sin P_{22}t} = \\ \cos(Pt) + i \sin (Pt) $$