Understanding the coefficient matrix of Hermite Interpolation I was not sure whether this is a computer science question or a math question, so I posted it here, hope that it is alright.
I am trying to learn the technique of Hermite interpolation. I do understand that it is a generalization of Newton polynomial interpolation, which also considers derivatives to ensure continuity of the interpolated curve at the provided points.
In the book Computer Animation — Algorithms and Techniques by Rick Parent, there is a definition of Hermite interpolation that looks like this:

Hermite interpolation generates a cubic polynomial from one point to another. In addition to specifying the beginning and ending points $(P_i,P_{i+1})$, the user needs to supply beginning and ending tangent vectors $(P'_i,P'_{i+1})$ as well.

Here, just the first derivatives are considered, and the aim is to find a polynomial of degree 3 by finding appropriate coefficients $a_3,a_2,a_1,a_0$ such that we have $a_3x^3 + a_2x^2 + a_1x + a_0$. These are found by solving a system of linear equations. So far, so good.
Now, in the book, the matrices look like this:

The general matrix form for a curve is $P(u) = U^TMB$. In the case of Hermite interpolation,
$$
U^T = \begin{bmatrix} u^3 &amp; u^2 &amp; u &amp; 1 \end{bmatrix} \\
M = \begin{bmatrix} 2 &amp; -2 &amp; 1 &amp; 1 \\ -3 &amp; 3 &amp; -2 &amp; -1 \\ 0 &amp; 0 &amp; 1 &amp; 0 \\ 1 &amp; 0 &amp; 0 &amp; 0 \end{bmatrix} \\
B = \begin{bmatrix} P_i \\ P_{i+1} \\ P'_i \\ P'_{i+1} \end{bmatrix}
$$

I do not understand the matrix $M$, I do not see where the values are coming from. Are these fixed, or can I somehow compute them?
We are looking for a curve
$$ P(u) = a_3 u^3 + a_2 u^2 + a_1 u + a_0 $$
which satisfies the following properties:

$P(0) = P_i$.
$P(1) = P_{i+1}$.
$P'(0) = P'_i$.
$P'(1) = P'_{i+1}$.

In terms of the coefficients $a_0,a_1,a_2,a_3$, these are:

$a_0 = P_i$.
$a_3 + a_2 + a_1 + a_0 = P_{i+1}$.
$a_1 = P'_i$.
$3a_3 + 2a_2 + a_1 = P'_{i+1}$.

In matrix form, this reads:
$$
\begin{pmatrix} P_i \\ P_{i+1} \\ P'_i \\ P'_{i+1} \end{pmatrix} =
\begin{pmatrix} 0 &amp; 0 &amp; 0 &amp; 1 \\ 1 &amp; 1 &amp; 1 &amp; 1 \\ 0 &amp; 0 &amp; 1 &amp; 0 \\ 3 &amp; 2 &amp; 1 &amp; 0 \end{pmatrix}
\begin{pmatrix} a_3 \\ a_2 \\ a_1 \\ a_0 \end{pmatrix}
$$
Inverting the matrix, we get
$$
\begin{pmatrix} a_3 \\ a_2 \\ a_1 \\ a_0 \end{pmatrix} =
\begin{pmatrix} 2 &amp; -2 &amp; 1 &amp; 1 \\ -3 &amp; 3 &amp; -2 &amp; -1 \\ 0 &amp; 0 &amp; 1 &amp; 0 \\ 1 &amp; 0 &amp; 0 &amp; 0 \end{pmatrix}
\begin{pmatrix} P_i \\ P_{i+1} \\ P'_i \\ P'_{i+1} \end{pmatrix}
$$
Therefore the equation of the curve is
$$
P(u) = \begin{pmatrix} u^3 &amp; u^2 &amp; u &amp; 1 \end{pmatrix}
\begin{pmatrix} a_3 \\ a_2 \\ a_1 \\ a_0 \end{pmatrix} =
\begin{pmatrix} u^3 &amp; u^2 &amp; u &amp; 1 \end{pmatrix}
\begin{pmatrix} 2 &amp; -2 &amp; 1 &amp; 1 \\ -3 &amp; 3 &amp; -2 &amp; -1 \\ 0 &amp; 0 &amp; 1 &amp; 0 \\ 1 &amp; 0 &amp; 0 &amp; 0 \end{pmatrix}
\begin{pmatrix} P_i \\ P_{i+1} \\ P'_i \\ P'_{i+1} \end{pmatrix}
$$