I often see the following trick. When asked to compute the square root of a matrix A, diagonalize it first using the rotation matrix Q, then
$A^{\frac{1}{2}} = (Q \cdot A_{diag} \cdot Q^T)^{\frac {1}{2}} = Q \cdot A_{diag}^{\frac{1}{2}} \cdot Q^T$
The same trick is applied when computing a matrix exponential
$exp(A) = exp(Q \cdot A_{diag} \cdot Q^T) = Q \cdot exp(A_{diag}) \cdot Q^T$
However, I cannot see why this is allowed. Why is the exponential / square root not applied to the rotation matrices?
Checking why the given expression for $A^{1/2}$ works gives a valuable clue: note that squaring the expression gives $$ \big( Q\cdot A_{diag}^{1/2}\cdot Q^T \big) \big( Q\cdot A_{diag}^{1/2}\cdot Q^T\big) = Q\cdot A_{diag}^{1/2}\big( Q^T Q\big) A_{diag}^{1/2}\cdot Q^T = Q\cdot A_{diag}^{1/2}A_{diag}^{1/2}\cdot Q^T = A. $$ The fact that the interior $Q^TQ$ cancelled out (since that product is the identity matrix) is the main point: it proves that "conjugation by $Q$ respects multiplication of matrices". So the square root not being applied to $Q$ is not a feature or a bug: we simply wouldn't get the right answer if it were applied to $Q$, and we do get the right answer here.
A similar but slightly more complicated argument works for the matrix exponential as well.