Matrix Differential equation x'(t) = Ax(t)+b solution defined for non-invertible values The problem I am trying to find a solution for is this linear ODE, where A is an $n x n$ matrix and b is an $nx1$ matrix.
$$x'(t) = Ax(t) + b$$
One solution for this equation is provided by a wikipedia article:
https://en.wikipedia.org/wiki/Matrix_differential_equation#Stability_and_steady_state_of_the_matrix_system
$$x^* = -A^{-1} b$$
$$x(t) = x^* + e^{At}(x(0) - x^*)$$
The biggest trouble I am running into is that, in my case, $A$ may be singular. In which case, this solution won't work.
One thing I noticed: if this were a scalar problem, not a matrix problem, and A were non-invertible, than A would have to be zero. If I set A to zero in my original equation, I get the following.
$$x'(t) = 0x(t) + b$$
$$x'(t) = b$$
$$x(t) = bt + x(0)$$
This tells me that the solution I seek should resolve to $x(t) = bt + x(0)$ if $A$ is the zero matrix.
How can I determine the solution to this equation when $A$ is singular, but not zero? Is there a way to take the limit of $x(t)=x^∗+e^{At}(x(0)−x^∗)$ so that it is defined when $A$ is singular?
 A: The general solution is the general homogeneous solution plus a particular solution. A very convenient particular solution is a stationary solution. In this problem, a stationary solution $x^*$ is any solution to $Ax^*=-b$. If a stationary solution exists, then the general solution is $x=e^{At}y+x^*$ as $y$ ranges over all of $\mathbb{R}^n$. Here in general $y \neq x(0)$. However, $e^{At}$ is always invertible. Therefore you can always find $y$ to fit to whatever initial condition you want.
This approach can be viewed as being equivalent to what we usually do in the nonnlinear case: $x'=Ax+b$ is equivalent to $(x-x^*)'=A(x-x^*)$, so you solve for $x-x^*$ and add $x^*$ back at the end.
Whether a stationary solution exists or not, and in fact whether the forcing is constant or not, a solution to $x'(t)=Ax(t)+f(t)$ is
$$x(t)=\int_0^t e^{As} f(t-s) ds.$$
In this case $f(t-s) \equiv b$, so we have
$$x(t)=\int_0^t e^{As} b ds.$$
Thus overall the general solution to $x'=Ax+b$ is
$$x(t)=e^{At}y+\int_0^t e^{As}b ds$$
as $y$ ranges over all of $\mathbb{R}^n$. Note that in this form actually $y=x(0)$, which is not the case for the form from the first paragraph.
A: In response to your nice observation when $x$ and $y$ are $1×1$ matrices, we could multiply with cofactor of $A$ to simplify the system. since $A$ cofactor $A$ is $\det A\,I$ is $0$ when $A$ is singular,
$$\newcommand{\cof}{\operatorname{cof}}
\cof A\,x'(t)= \cof A\, B\\
\cof A\,(x'(t)-B)=0
$$
Let's take 2 cases,


*

*Case 1.
$\cof A$ is not $0$. in that case $x'(t)-B$ must be $0$ which we know how to solve.

*Case 2.
$\cof A=0$. any function is ok as the second bracket can be anything

