In our last video, we studied systems
of linear differential equations.
Derivative of a vector
is a matrix times a vector.
And we studied the case where all
the eigenvalues of the matrix were real.
In this video, we're gonna study the case
where some of the eigenvalues are complex.
And actually, we're gonna do a 2x2 system
where both eigenvalues are complex.
So here's the system,
derivative of the fir—
And we're taking initial values 2, 4.
If you write it in matrix form, we're
saying derivative of x is 1, -1, 4, 1 x,
and the initial value of x is 2.
And we call the matrix A.
So as always, the first step
is to diagonalize A,
and we'll see that there's gonna be
the exact same procedure.
The only thing is that we're gonna
discover that the eigenvalues are complex.
And when you have a complex eigenvalue
and you exponentiate it,
you have to remember that e^((a + bi)t)
is (e^(at))(cos(bt) + isin(bt)).
So we're gonna have a bunch of
cosines and sines floating around,
and it's because of the
complex exponentials.
So step one, diagonalize the matrix.
We take the characteristic polynomial,
take λ times the identity minus the matrix
take the determinant, and lo and behold,
we get λ^2 - 2λ + 5.
What are the eigenvalues?
Well they're the roots,
get 'em from the quadratic formula.
(2 ± √-16)/2,
√-16 is 4i,
so (2 ± 4i)/2,
which is 1 ± 2i.
And then we need to find the eigenvectors.
We do it one eigenvalue at a time.
We always want to row reduce A - λI,
so when we do the eigenvalue 1 + 2i,
we're row reducing this matrix.
Now you notice that 2i times
the top row is the second row.
2i times -2i is 4,
2i times -1 is -2i.
So if we subtract 2i times the
first row from the second,
we get zeros at the bottom.
We divide the top row by -2i,
and we get this.
So our first equation is x_1 is (i/2)x_2.
The second equation is—well,
x_2 can be whatever it wants.
So our eigenvector must be
a multiple of &lt;i/2, 1&gt;.
And for convenience, we're gonna
take that multiple to be twice.
Just to get—we don't want
to deal with halves,
so let's clear out the denominators
and call &lt;i, 2&gt; our eigenvector.
We could do the same thing for 1 - 2i,
and the calculations are identical,
just with i replaced by -i
at every single step.
And so our second eigenvector is &lt;-i, 2&gt;.
Okay.
Now as always, we let our y vector
be the coordinates of our x vector
in the B basis.
So our change of basis matrix
is given by the two eigenvectors.
And its inverse, we use the usual
formula for the inverse of a 2x2.
And okay, it's got a 4i in the denominator
and it's got complex numbers in it,
but the same formulas as always work.
Next step is to write our
equations in terms of y.
And just as before, the
derivative of y_1 is (λ_1)(y_1),
and the derivative of y_2 is (λ_2)(y_2).
The only change is that λ_1
and λ_2 happen to be complex.
And what's the solution to those
differential equations?
Well, it's always e^(λt).
That's the definition of e^(λt).
e^(λt) is the solution to dy/dt = λy.
So we have this complex
exponential, and we have—
and if we want to understand it in terms
of sines and cosines, we expand it out.
e^(2it) is cos(2t) + isin(2t).
The e^(-2it) is cos(-2t)—
well that's the same as cos(2t)—
plus isin(-2t)—well that's -isin(2t).
And there we go.
And last, we go around our square.
Now, this is the same procedure as always.
We start with our initial value of x,
we apply p-inverse
to get our initial value of y,
we apply e^(Dt) to get
our final value of y,
and we apply p to get
our final value of x.
First step, well we multiply by p-inverse.
That's just arithmetic, and we get
something with i's in it.
You generally expect your
coefficients y to have i's in them.
Even if x started off as real,
the change of basis ma—
The eigenvalues and
eigenvectors are complex,
the change of basis matrix is complex,
so you get a complex y.
Now you take e to the—
You go from y(0) to y(t) by
multiplying each term by e^(λt).
And I'm gonna leave it in
terms of e^(2it) and e^(-2it)
instead of expanding it out
in terms of sines and cosines.
At least for this stage in the game.
And finally, we want to
figure out what x is,
and we take p times that,
so pull out the factor e^t,
and there's our answer.
Now, it'll take a bit of arithmetic
to turn that into something
that we can recognize.
So we multiply it out.
And okay, we've got 1's and i's
and complex exponentials
and it looks a little bit messy,
so let's walk it through.
We've got four terms in there.
(1 + i)e^(2it), you multiply it out,
and you get a real part,
and you get an imaginary part.
Now if you take (1 - i)e^(-2it),
you wind up with a—
See, this is the complex
conjugate of this.
This is the complex conjugate of this,
the answer is the complex conjugate
of the previous answer.
Real part is the same, the
imaginary part flipped sign.
So when you go up here, you get
something plus its complex conjugate,
so it comes out to be real.
The sum of these two terms
winds up being 2(cos(2t) - sin(2t)).
Now if you do the same thing for
the terms involved in x_2...
you multiply it all out and you again
get a real expression.
You can pause the video here and do
the arithmetic yourself if you want,
or you can just take my word for it,
and here it is.
You put it all together,
and you get that x is
(e^t) times 2cos(2t) - 2sin(2t)
and 4cos(2t) + 4sin(2t).
Our eigenvalues were 1 ± 2i,
and with those eigenvalues,
the 1 told us the growth rate.
It's e^(1t).
And the imaginary part told us
how fast we were rotating—
how fast we were oscillating.
It's 2i, so you have cos(2t) and sin(2t).
And finally, the answer is real.
Well it had to be real,
because at the very beginning,
we started off with a real
differential equation: dx/dt = Ax.
A was a real matrix,
x(0) was a real vector,
so x(t) has to be a real vector.
We use complex numbers
to compute the answer,
but the answer itself is
gonna wind up being real.
Now, what would happen if
we had a matrix that had both
real and complex eigenvalues?
Like suppose you had eigenvalues
1, 2, 3 + 5i, and 3 - 5i.
Remember, they always
come in conjugate pairs.
Well then you're gonna have one term
in your solution that goes as e^t,
another term that goes as e^(2t)—
and this is gonna be e^t times
the first eigenvector.
e^(2t) times the second eigenvector.
And you're gonna have an e^((3 + 5i)t)
times a third eigenvector,
and a e^((3 - 5i)t) times
a fourth eigenvector.
And when you unpack it,
you write e to this,
you're gonna wind up with some terms
involving e^(3t)cos(5t) and e^(3t)sin(5t).
Always, the real part tells you
how fast you grow,
the imaginary part tells you
how fast you oscillate.
