<s>[INST] Taylor series of functions with matrix input Today my professor said something interesting, replace $x$ in $f(x)$ with matrix  \begin{bmatrix}x&1\\0&x\end{bmatrix}
Then $$f(\begin{bmatrix}x&1\\0&x\end{bmatrix}) = f(x)\begin{bmatrix}1&0\\0&1\end{bmatrix} + f^{'}(x)\begin{bmatrix}0&-1\\1&0\end{bmatrix}$$
and asked us to find the higher order terms ($f^{''}(x), f^{'''}(x) ....$)  and extend it to multi variable functions.
I didn't understand how he came up with this. 
After some googling, this seems similar to matrix exponential from lie groups. 
 [/INST] I believe that, as mentioned by mathreadler in his comment on the question itself, that there is indeed a typo and that the correct formula may be written
$f \left (\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix} \right ) = f(x)I + f'(x)N, \tag 0$
with $I$ and $N$ explained in what follows.
I assume $f(x)$ is represented by a Taylor series about $x = 0$:
$f(x) = f(0) + f'(0)x + \dfrac{1}{2}f''(0)x^2 + \ldots = \displaystyle \sum_0^\infty \dfrac{1}{n!} f^{(n)}(0) x^n; \tag 1$
we have
$\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix}^n = \left ( \begin{bmatrix} x & 0 \\ 0 & x \end{bmatrix} + \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} \right )^n = \left ( x\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} \right )^n; \tag 2$
setting
$I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \tag 3$
and
$N =  \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, \; N^2 = 0, \tag 4$
we write
$\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix}^n = (xI + N)^n; \tag 5$
since $IN = NI$, (5) may be subject to the ordinary binomial expansion, and since $N^2 = 0$, the terms containing the powers of $N$ greater than the second vanish; thus
$\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix}^n = (xI + N)^n = x^nI + nx^{n - 1}N; \tag 6$
if we substitute this into (1) we obtain
$f \left (\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix} \right ) = f(0)I + f'(0)(xI + N) + \dfrac{1}{2}f''(0) (x^2 I + 2xN) + \ldots$
$= (f(0) + f'(0)x + \dfrac{1}{2} f''(0)x^2 + \ldots)I + (f'(0) + f''(0)x + \ldots)N$
$= \displaystyle \sum_0^\infty \dfrac{1}{n!} f^{(n)}(0)(xI + N)^n = \sum_0^\infty \dfrac{1}{n!}f^{(n)}(0)(x^nI + nx^{n - 1}N)$
$= \displaystyle \sum_0^\infty \dfrac{1}{n!} f^{(n)}(0)x^nI + \sum_1^\infty \dfrac{1}{n!} f^{(n)}(0)nx^{n - 1}N$
$= \left ( \displaystyle \sum_0^\infty \dfrac{1}{n!} f^{(n)}(0)x^n \right ) I + \left ( \displaystyle \sum_1^\infty \dfrac{1}{(n - 1)!} f^{(n)}(0)x^{n - 1} \right )N; \tag7$
we observe that the coefficient of $I$ is the Taylor series of $f(x)$ and that of $N$ is the Talylor series of $f'(x)$; thus
$f \left (\begin{bmatrix} x & 1 \\ 0 & x \end{bmatrix} \right ) = f(x)I + f'(x)N. \tag 8$
This "expansion" is in fact exact on any inteval containing $0$ on which the Taylor series for $f(x)$ and $f'(x)$ converge.
</s>