The linear system is easily solved generally by first calulating the MatrixExp. Then we can extract the real and imaginary parts.
Here we go
The complex matrix
A = {{0, 1}, {-2, -I}};
The matrix exp
At = MatrixExp[t A]
(* {{1/3 (2 Cos[t] + Cos[2 t] + I (2 Sin[t] - Sin[2 t])),
1/3 (I (-Cos[t] + Cos[2 t]) + Sin[t] + Sin[2 t])}, {1/
3 (2 I (Cos[t] - Cos[2 t]) - 2 (Sin[t] + Sin[2 t])),
1/3 (Cos[t] + 2 Cos[2 t] + I (Sin[t] - 2 Sin[2 t]))}} *)
In matrix form:
At // MatrixForm
$$\left(
\begin{array}{cc}
\frac{1}{3} (2 \text{Cos}[t]+\text{Cos}[2 t]+i (2 \text{Sin}[t]-\text{Sin}[2 t])) & \frac{1}{3} (i (-\text{Cos}[t]+\text{Cos}[2 t])+\text{Sin}[t]+\text{Sin}[2 t]) \\
\frac{1}{3} (2 i (\text{Cos}[t]-\text{Cos}[2 t])-2 (\text{Sin}[t]+\text{Sin}[2 t])) & \frac{1}{3} (\text{Cos}[t]+2 \text{Cos}[2 t]+i (\text{Sin}[t]-2 \text{Sin}[2 t])) \\
\end{array}
\right)$$
The general solution vector is (where a == x[0] and b = y[0] are two constants)
{x, y} = At.{a, b}
(* {1/3 a (2 Cos[t] + Cos[2 t] + I (2 Sin[t] - Sin[2 t])) +
1/3 b (I (-Cos[t] + Cos[2 t]) + Sin[t] + Sin[2 t]),
1/3 b (Cos[t] + 2 Cos[2 t] + I (Sin[t] - 2 Sin[2 t])) +
1/3 a (2 I (Cos[t] - Cos[2 t]) - 2 (Sin[t] + Sin[2 t]))} *)
Direct proof that {x,y}
solves the ODE
D[{x, y}, t] == A.{x, y} //Simplify
(* True *)
Ok.
Now we can calculate Re
and Im
of the matrix At
reAt = 1/2 ComplexExpand[At + Conjugate[At]];
reAt//MatrixForm
$\left(
\begin{array}{cc}
\frac{1}{2} \left(\frac{4 \text{Cos}[t]}{3}+\frac{2}{3} \text{Cos}[2 t]\right) & \frac{1}{2} \left(\frac{2 \text{Sin}[t]}{3}+\frac{2}{3} \text{Sin}[2 t]\right) \\
\frac{1}{2} \left(-\frac{4 \text{Sin}[t]}{3}-\frac{4}{3} \text{Sin}[2 t]\right) & \frac{1}{2} \left(\frac{2 \text{Cos}[t]}{3}+\frac{4}{3} \text{Cos}[2 t]\right) \\
\end{array}
\right)$
imAt = 1/(2 I) ComplexExpand[At - Conjugate[At]];
imAt//MatrixForm
$\left(
\begin{array}{cc}
\frac{1}{2} \left(\frac{4 \text{Sin}[t]}{3}-\frac{2}{3} \text{Sin}[2 t]\right) & \frac{1}{2} \left(-\frac{2 \text{Cos}[t]}{3}+\frac{2}{3} \text{Cos}[2 t]\right) \\
\frac{1}{2} \left(\frac{4 \text{Cos}[t]}{3}-\frac{4}{3} \text{Cos}[2 t]\right) & \frac{1}{2} \left(\frac{2 \text{Sin}[t]}{3}-\frac{4}{3} \text{Sin}[2 t]\right) \\
\end{array}
\right)$
Check the decomposition
At == reAt + I imAt // Simplify
(* True *)
Similarly you can decompose the solution vector {x,y}, which will result in slightly longer expressions in the case of complex initial values a and b.
Best regards,
Wolfgang
JordanDecomposition
andMatrixExp
for completeness $\endgroup$