Solve the last part of a diferential equation I'm trying to solve this problem but I've some doubts about the final steps.
Solve the initial value problem using matrix functions:

$$
\frac {dy}{dx} = 
\begin{pmatrix}
1 & a & 1 \\
0 & 1 & a \\
0 & 0 & 1 \\
\end{pmatrix}
y
\text{ ; }
y(0) = 
\begin{pmatrix}
 0 \\
 0 \\
-1 \\
\end{pmatrix}
$$
First of all, I'm not sure what do they mean with "matrix functions" but I think I've to do the exponential development.
The way I've tried:
$$
\frac {dy}{dx} = Ay 
\text{ }\to\text{ } 
\frac {dy}{y} = Adx 
\text{ }\to\text{ } 
ln(y) = Ax+K 
\text{ }\to\text{ } 
y(x) = Ce^{Ax}
$$
$$
e^{Ax} = \sum_{n=0}^{\infty} \frac{(Ax)^n}{n!}
$$
I try to get a recurring rule for the powers of the matrix A:
$$
A^2 = 
\begin{pmatrix}
1 & 2a & 2+a^2 \\
0 & 1 & 2a \\
0 & 0 & 1 \\
\end{pmatrix}
\text{ }\text{ } 
A^3 = 
\begin{pmatrix}
1 & 3a & 3+3a^2 \\
0 & 1 & 3a \\
0 & 0 & 1 \\
\end{pmatrix}
\text{ }\text{ } 
A^4 = 
\begin{pmatrix}
1 & 4a & 4+6a^2 \\
0 & 1 & 4a \\
0 & 0 & 1 \\
\end{pmatrix}
$$
So that, it looks the n-power of A is:
$$
A^n = 
\begin{pmatrix}
1 & na & n+\frac{n(n-1)}{2}a^2 \\
0 & 1 & na \\
0 & 0 & 1 \\
\end{pmatrix}
=
I+
\begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0 \\
\end{pmatrix}
na+
\begin{pmatrix}
0 & 0 & 1 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{pmatrix}
(n + \frac {n(n-1)}{2}a^2)
$$
I just rename:
$$
\alpha = 
\begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0 \\
\end{pmatrix}
\text{ }\text{ } 
\beta = 
\begin{pmatrix}
0 & 0 & 1 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{pmatrix}
$$
So that $A^n$ becomes:
$$
A^n = I + na\alpha + (n + \frac {n(n-1)}{2}a^2)\beta
$$
$$
A^n = 
I + na\alpha + n\beta + \frac{n^2}{2}a^2 \beta - \frac{n}{2}a^2 \beta = 
I + (a\alpha + \beta -\frac{1}{2}a^2 \beta)n + \frac{a^2 \beta}{2}n^2
$$
Once this is done, I go back to the exponential development:
$$
e^{Ax} = 
\sum_{n=0}^{\infty} \frac{(Ax)^n}{n!} = 
\sum_{n=0}^{\infty} (I + (a\alpha + \beta -\frac{1}{2}a^2 \beta)n + \frac{a^2 \beta}{2}n^2) \frac{x^n}{n!}
$$
$$
e^{Ax} = 
Ie^{x} + (a\alpha + \beta -\frac{1}{2}a^2 \beta) \sum_{n=0}^{\infty} \frac{nx^n}{n!} 
+ \frac{a^2 \beta}{2} \sum_{n=0}^{\infty} \frac{n^2x^n}{n!}
$$
From here I've tried to solve both sums:
$$
\sum_{n=0}^{\infty} \frac{nx^n}{n!} = 
0 + \sum_{i=1}^{\infty} \frac{nx^n}{n!} = 
\sum_{n=1}^{\infty} \frac{x^{n-1}}{(n-1)!}x =
\sum_{m=0}^{\infty} \frac{x^m}{m!}x = xe^x
$$
$$
\sum_{n=0}^{\infty} \frac{n^2x^n}{n!} = 
0 + \sum_{i=1}^{\infty} \frac{n^2x^n}{n!} = 
\sum_{n=1}^{\infty} \frac{nx^{n-1}}{(n-1)!}x =
\sum_{m=0}^{\infty} \frac{(m+1)x^m}{m!}x =
\sum_{m=0}^{\infty} \frac{mx^m}{m!}x +
\sum_{m=0}^{\infty} \frac{x^m}{m!}x =
 x^2e^x+xe^x
$$
So that, the solution should be:
$$
e^{Ax} = 
Ie^{x} + (a\alpha + \beta -\frac{1}{2}a^2 \beta) xe^x 
+ \frac{a^2 \beta}{2} (x^2e^x+xe^x)
$$
$$
e^{Ax} = 
Ie^{x} + (a\alpha + \beta) xe^x + \frac{a^2 \beta}{2} x^2e^x
$$
On a matrix representation:
$$
e^{Ax} = 
\begin{pmatrix}
1 & ax & x + \frac{a^2}{2}x^2 \\
0 & 1 & ax \\
0 & 0 & 1 \\
\end{pmatrix}
e^x
$$
On the last part, I'm not sure how to get the solution because the constant C should be a row vector instead of a column vector. Is this right? How to get the final solution?
Thanks in advance.

A simple solution:
$$
\frac {dy}{dx} = 
    \begin{pmatrix}
    1 & a & 1 \\
    0 & 1 & a \\
    0 & 0 & 1 \\
    \end{pmatrix}
y
\text{ ; }
y(0) = 
    \begin{pmatrix}
     0 \\
     0 \\
    -1 \\
    \end{pmatrix}
$$
Let $y=\begin{pmatrix} y_1 \\ y_2 \\y_3 \end{pmatrix}$
Then you have three couples ODEs as
$\frac{dy_1}{dx}=y_1+ay_2+y_3~~~(1), \frac{dy_2}{dx}=y_2+ay_3~~~(2), \frac{dy_3}{dx}=y_3~~~~(3)$
Fist solve (3) to get $y_3=C e^x \implies y_3=-e^{x}$. Put this in (2) and solve the ODE:
$$\frac{dy_2}{dx}=y_2-ae^x \implies y_2=e^{x}\int -ae^x e^{-x}dx+ Be^{x}=-axe^{x}+Be^{x} \implies y_2=-axe^x$$
Putting these solutions in (1), we get
$$\frac{dy_1}{dx}=y_1-a^2 xe^x-e^{x} \implies y_1=e^{x}\int (-a^2xe^x e^{-x}-1) dx+Ae^x$$ $$ \implies y_1= -\frac{a^2x^2}{2} e^{x}-xe^x+Ae^x, y_1(0)=0 \implies A=0.$$ So the solutions of the Matrix ODE are
$$y(x)=\begin{pmatrix} -\frac{a^2x^2}{2}e^x-xe^x \\ -axe^x \\ -e^x \end{pmatrix}$$
