# Why does this matrix give the derivative of a function?

I happened to stumble upon the following matrix:

And after trying a bunch of different examples, I noticed the following remarkable pattern. If $P$ is a polynomial, then:

Where $P'(a)$ is the derivative evaluated at $a$.

Futhermore, I tried extending this to other matrix functions, for example the matrix exponential, and wolfram alpha tells me:

and this does in fact follow the pattern since the derivative of $e^x$ is itself!

Furthermore, I decided to look at the function $P(x)=\frac{1}{x}$. If we interpret the reciprocal of a matrix to be its inverse, then we get:

And since $f'(a)=-\frac{1}{a^2}$, the pattern still holds!

After trying a couple more examples, it seems that this pattern holds whenever $P$ is any rational function.

I have two questions:

1. Why is this happening?

2. Are there any other known matrix functions (which can also be applied to real numbers) for which this property holds?

If
then by induction you can prove that

for $n \ge 1$. If $f$ can be developed into a power series

then

and it follows that

From $(1)$ and

one gets

which means that $(1)$ holds for negative exponents as well.
As a consequence, $(2)$ can be generalized to functions