matrix raised to a matrix i wanted to know if it was possible to raise a matrix to a matrix and i wanted to confirm if i have it. i tested it out with numbers and notation and i want to know if i'm right. $$
    x =\left [ \begin{matrix}
    1 & 1 \\
    0 & 1 \\
   \end{matrix} \right ]
$$
$$
    \left [ \begin{matrix}
    2 & 1 \\
    1 & 2 \\
   \end{matrix} \right ] ^ x
$$
now, i use e^ln(x) = x, and i diagonalize my matrix to take an easy ln. 
$$
e^(ln(
    \left [ \begin{matrix}
    2 & 1 \\
    1 & 2 \\
   \end{matrix} \right ] ^ x
))
$$
$$
    e ^ (x*ln(diag(\left [ \begin{matrix}
    2 & 1 \\
    1 & 2 \\
   \end{matrix} \right ]))
$$
my diag of my matrix is as follows:
$$
\left[\begin{matrix}
1 & 0\\
0 & 1\\
\end{matrix}\right]
$$
natural log of a diag matrix is as follows
$$
\left[\begin{matrix}
ln(1)=0 & 0\\
0 & ln(1)=0\\
\end{matrix}\right]
$$
$$
x
*
\left[\begin{matrix}
0 & 0\\
0 & 0\\
\end{matrix}\right]
=
\left[\begin{matrix}
0 & 0\\
0 & 0\\
\end{matrix}\right]
$$
than i have 
$$
e^\left[\begin{matrix}
0 & 0\\
0 & 0\\
\end{matrix}\right]
$$
and if that wasn't a zero matrix id apply the Taylor series. 
did i do that right? would my next step be correct. i'd love to know. thank in advance!! 
 A: Defining the exponential function of a (complex) matrix $A$ is not too difficult, it is just $\exp A:=\sum_{n=0}^{\infty} \frac{A^n}{n!}$, which can be shown to converge. The same is therefore true for $\cos A$ and $\sin A$.
Working out what $\exp A$ is another question. In the "easy" case, when $A$ is diagonalizable we have $A=P^{-1}DP$, where $D$ is diagonal with entries $d_1,d_2,\dots,d_n$. Then, using $P^{-1}(X+Y)P=P^{-1}X P+P^{-1}Y P$ and $P^{-1}(X \cdot Y)P=P^{-1}X P\cdot P^{-1}Y P$ we can check that $\exp A=P^{-1}\Delta P$, where $\Delta$ is a diagonal matrix with entries $\exp d_1, \exp d_2,\dots,\exp d_n$. 
(I think you are forgetting about the matrix $P$, which you must not do.)
Now lets talk about $\log A$. It easier to talk about $\log(I+ A)$, so lets do that.Now the power series for $\log(1+z)$ only converges for small $z$, so we can only proceed if $A$ is in some sense "small". But when it is, we can define $\log(I+A)$ as $\sum_{n=0}^{\infty} \frac{(-A)^{n+1}}{(n+1)}$.
If we are in the happy situation when $A$ is diagonalisable, and its eigenvalues $d_i$ are small, we will get $\log (I+A)=P^{-1}\Lambda P$, where $\Lambda$ is diagonal with entries $\log (1+d_i)$.
Once all this machinery has been set up, you can go on to define - in some restricted circumstances - the matrix $X^Y$. It is going to be $\exp(Y\cdot \log X)$. The restrictions will include that $(X-I)$ and its eigenvalues are "small".
Again, working it out is in general not easy, but if the right things are diagonalisable then the process is diagonalise, apply the usual functions to the diagonal elements, and undo the diagonalisation.
