Let $A$ be an $n \times n$ matrix. Then the solution of the initial value problem \begin{align*} \dot{x}(t) = A x(t), \quad x(0) = x_0 \end{align*} is given by $x(t) = \mathrm{e}^{At} x_0$.
I am interested in the following matrix \begin{align*} \int_{0}^T \mathrm{e}^{At}\, dt \end{align*} for some $T>0$. Can one write down a general solution to this without distinguishing cases (e.g. $A$ nonsingular)?
Is this matrix always invertible?
Case I. If $A$ is nonsingular, then $$ \int_0^T\mathrm{e}^{tA}\,dt=\big(\mathrm{e}^{TA}-I\big)A^{-1}, $$ where $I$ is the identity matrix.
Case II. If $A$ is singular, then using the Jordan form we can write $A$ as $$ A=U^{-1}\left(\begin{matrix}B&0\\0&C\end{matrix}\right)U, $$ where $C$ is nonsingular, and $B$ is strictly upper triangular. Then $$ \mathrm{e}^{tA}=U^{-1}\left(\begin{matrix}\mathrm{e}^{tB}&0\\0&\mathrm{e}^{tC} \end{matrix}\right)U, $$ and $$ \int_0^T\mathrm{e}^{tA}\,dt=U^{-1}\left(\begin{matrix}\int_0^T\mathrm{e}^{tB}dt&0\\0&C^{-1}\big(\mathrm{e}^{TC}-I\big) \end{matrix}\right)U $$ But $\int_0^T\mathrm{e}^{tB}dt$ may have different expressions. For example if $$ B_1=\left(\begin{matrix}0&0\\0&0\end{matrix}\right), \quad B_2=\left(\begin{matrix}0&1\\0&0\end{matrix}\right), $$ then $$ \int_0^T\mathrm{e}^{tB_1}dt=\left(\begin{matrix}T&0\\0&T\end{matrix}\right), \quad \int_0^T\mathrm{e}^{tB_2}dt=\left(\begin{matrix}T&T^2/2\\0&T\end{matrix}\right). $$