# Consistent Results for MatrixExp, DSolve and Eigensystem

I have the system

$$Y' = \begin{pmatrix} -4 & 4 \\ -8 & 4 \end{pmatrix}Y$$ Using DSolve

   DSolve[{x'[t] == -4x[t]+4 y[t], y'[t] == -8x[t] + 4y[t]},{x,y},t]


Produces

$$x = c_2 \sin (4 t)+c_1 (\cos (4 t)-\sin (4 t)) \\y = c_2 (\sin (4 t)+\cos (4 t))-2 c_1 \sin (4 t)$$

Finding the Fundamental Matrix, $$e^{A t}$$, using MatrixExp as

   MatrixExp[{{-4t,4t},{-8t,4t}}]


Produces

$$\left( \begin{array}{cc} \cos (4 t)-\sin (4 t) & \sin (4 t) \\ -2 \sin (4 t) & \sin (4 t)+\cos (4 t) \\ \end{array} \right)$$

Notice how that perfectly aligns with the DSolve result.

If I use Eigensystem

    Eigensystem[{{-4, 4}, {-8, 4}}]


This produces

$$\lambda_i = \pm 4i, v_1 = (1 \pm i, 2)$$

That is a correct result, but I am wondering if we can coax the eigenvectors to be a in a form that can produce the previous two results from the imaginary to real conversion using Euler's Formula.

$$e^{4 i t} = (\cos 4 t + i \sin 4t)\begin{pmatrix} 1 - i \\ 2 \end{pmatrix}$$

Is there a way to peer in to how Mathematica calculated the previous results and make the eigenvectors (since they are not unique) be in a form that I can use this expansion to generate either of the previous two forms?

The Idea is, that you have to introduce constants A, B for every individual term too. You'll then recognize the solution to be obtainable, if you set A=Conjugate[B]. Afterwards its just getting the right expression for the constants to match the exact same solution as the one from above.

As is shown in this example:

(
(A + B*I)*Exp[4 I*t]*{1 - I, 2} +
(A - B*I)*Exp[-4 I*t]*{1 + I, 2}
) /. {A -> C[2]/4, B -> C[1]/2 - C[2]/4} // ExpToTrig // Simplify


{C[1] Cos[4 t] + (-C[1] + C[2]) Sin[4 t], C[2] Cos[4 t] + (-2 C[1] + C[2]) Sin[4 t]}

• Interesting. Is there some way to automate finding $A$ and $B$?
– Moo
Apr 20, 2021 at 3:31
• Well, I found it by solving the resulting expression with the DSolve result for A and B. To automated that might be hard since there is no real target to optimize it to. Apr 20, 2021 at 9:41