I would like to know if a homogeneous linear differential equation, with variable coefficients which are periodic, is stable.
So the differential equation can be written as,
$$ \dot{y}(t)=A(t)y(t), \tag{1} $$
$$ A(t+T)=A(t). \tag{2} $$
I would suspect that the solution could be of the following form, similar to a linear time invariant system,
$$ y(t)=e^{B(t)\,t}y(0). \tag{3} $$
This solution is stable if the eigenvalues of $e^{B(T)\,T}$ lie inside the unit disk.
Here $B(t)$ should satisfy the following differential equation,
$$ B(t)+t\dot{B}(t)=A(t), \tag{4} $$
with the constraint that $B(t)\,t$ at $t=0$ is the zeros matrix.
In my case the matrix $A(t)$ is,
$$ A(t) = \begin{bmatrix} 0 & 1\\ a+\sin(b\,t) & -c \end{bmatrix}. \tag{5} $$
Solving for $B(t)$ yields,
$$ B(t)\,t=\begin{bmatrix} 0 & t\\ a\,t+\frac{1-\cos(b\,t)}{b} & -c\,t \end{bmatrix}. \tag{6} $$
However when I compare this solution to a numerical solution, they look very different. So where did I go wrong and how can I find the correct solution?
Another example, where the following $A(t)$ matrix is chosen,
$$ A(t) = \begin{bmatrix} 0 & 1\\ \left(\sin(t) - 1\right)\left(1 - \sin(t) - 2t\cos(t)\right) & 2\left(\sin(t) - 1 + t\cos(t)\right) \end{bmatrix}, \tag{7} $$
such that the $B(t)$ matrix conveniently becomes,
$$ B(t) = \begin{bmatrix} 0 & 1\\ -\left(\sin(t) - 1\right)^2 & 2\left(\sin(t) - 1\right) \end{bmatrix}, \tag{8} $$
which has the repeated eigenvalues $\lambda=\sin(t)-1$. The matrix exponential therefore becomes,
$$ e^{B(t)t} = e^{t\left(\sin(t) - 1\right)} \begin{bmatrix} 1 + t - t\sin(t) & t\\ -t\left(\sin(t) - 1\right)^2 & 1 + t\sin(t) - t \end{bmatrix}. \tag{9} $$
However the original ODE is a rewritten form of a second order differential equation, so the second row of this exponential should be the derivative of the first row, however that is not the case. Namely taking the derivative of the first row gives,
$$ \frac{d}{dt}\left(e^{t\left(\sin(t) - 1\right)} \begin{bmatrix}1 + t - t\sin(t) & t\end{bmatrix}\right) = e^{t\left(\sin(t) - 1\right)} \begin{bmatrix}-t\left(\sin(t) - 1\right)\left(\sin(t) - 1 + t\cos(t)\right) & 1+t\sin(t)-t+t^2\cos(t)\end{bmatrix}. \tag{10} $$
So I suspect that in general the following is not true,
$$ \frac{d}{dt}e^{F(t)} = \left(\frac{d}{dt}F(t)\right)e^{F(t)}, \tag{11} $$
where $F(t)$ is some square matrix as a function of time, $t$.
The exponential of a matrix can be defined as
$$ e^{F(t)} = \sum_{n=0}^\infty \frac{\left(F(t)\right)^n}{n!} = I + F(t) + \frac{1}{2}\left(F(t)\right)^2 + \frac{1}{6}\left(F(t)\right)^3 + \cdots. $$
When taking the derivative of this infinite sum you get,
$$ \frac{d}{dt}e^{F(t)} = \dot{F}(t) + \frac{1}{2}\left(\dot{F}(t)F(t)+F(t)\dot{F}(t)\right) + \frac{1}{6}\left(\dot{F}(t)F(t)F(t)+F(t)\dot{F}(t)F(t)+F(t)F(t)\dot{F}(t)\right) + \cdots. $$
This is only equal to $\dot{F}(t)e^{F(t)}$ if $\dot{F}(t)F(t)=F(t)\dot{F}(t)$, however in general these matrices will not commute.