Understanding the coefficient matrix of Hermite Interpolation
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}
$$