WEBVTT

00:00:02.632 --> 00:00:04.090
GILBERT STRANG:
This is a good time

00:00:04.090 --> 00:00:08.670
to do two by two matrices,
their eigenvalues,

00:00:08.670 --> 00:00:09.715
and their stability.

00:00:12.360 --> 00:00:16.470
Two by two eigenvalues
are the easiest

00:00:16.470 --> 00:00:19.390
to do, easiest to understand.

00:00:19.390 --> 00:00:23.930
Good to separate out the two
by two case from the later n

00:00:23.930 --> 00:00:25.980
by n eigenvalue problem.

00:00:28.610 --> 00:00:37.070
And of course, let me remember
the basic dogma of eigenvalues

00:00:37.070 --> 00:00:38.360
and eigenvectors.

00:00:38.360 --> 00:00:43.440
We're looking for a vector,
x, and a number, lambda,

00:00:43.440 --> 00:00:47.840
the eigenvalue, so
that Ax is lambda x.

00:00:47.840 --> 00:00:52.490
In other words, when
I multiply by A,

00:00:52.490 --> 00:00:56.820
that special vector x
does not change direction.

00:00:56.820 --> 00:01:01.540
It just changes length
by a factor lambda,

00:01:01.540 --> 00:01:03.290
which could be positive.

00:01:03.290 --> 00:01:05.040
It could be zero.

00:01:05.040 --> 00:01:06.500
Could be negative.

00:01:06.500 --> 00:01:08.240
Could be complex number.

00:01:08.240 --> 00:01:09.820
It's a number, though.

00:01:09.820 --> 00:01:15.150
So that's the key equation.

00:01:15.150 --> 00:01:17.990
Let me go toward its solution.

00:01:17.990 --> 00:01:22.670
So I want to move that
onto the left hand side.

00:01:22.670 --> 00:01:26.230
So I just write the
same equation this way.

00:01:26.230 --> 00:01:33.160
And now I see that this matrix
times the vector gives me 0.

00:01:33.160 --> 00:01:36.580
Now, when is that possible?

00:01:36.580 --> 00:01:39.780
That matrix can't be invertible.

00:01:39.780 --> 00:01:44.000
If it was invertible, the only
solution would be x equals 0.

00:01:44.000 --> 00:01:45.340
No good.

00:01:45.340 --> 00:01:50.370
So this matrix must be singular.

00:01:50.370 --> 00:01:52.370
It's determined it must be 0.

00:01:52.370 --> 00:01:56.740
And now we have an equation
for the eigenvalue lambda.

00:01:56.740 --> 00:02:00.830
So lambda is how much
we shift the matrix

00:02:00.830 --> 00:02:03.380
to make the determinant 0.

00:02:03.380 --> 00:02:07.220
We shift by lambda
times the identity

00:02:07.220 --> 00:02:10.789
to subtract that
from the diagonal.

00:02:10.789 --> 00:02:15.950
So can I begin with very
easy two by two matrix,

00:02:15.950 --> 00:02:21.450
the kind that we met first,
called a companion matrix.

00:02:21.450 --> 00:02:27.980
So we met this matrix when we
had a second order equation.

00:02:27.980 --> 00:02:34.790
So I started with the equation y
double prime plus By prime plus

00:02:34.790 --> 00:02:38.750
Cy equals, say, 0.

00:02:38.750 --> 00:02:43.150
So I started with one
second order equation.

00:02:43.150 --> 00:02:48.310
And then I introduced y
prime as a second unknown.

00:02:48.310 --> 00:02:52.250
So now I have a vector
unknown, y and y prime.

00:02:52.250 --> 00:02:56.610
And then, when I wrote
the equation down--

00:02:56.610 --> 00:03:01.930
I won't repeat that-- it led
us to a two by two matrix.

00:03:01.930 --> 00:03:05.910
Two equations for two
unknowns, y and y prime.

00:03:05.910 --> 00:03:10.410
So there is a two by two matrix
that we're interested in.

00:03:10.410 --> 00:03:14.880
But we really are going to be
interested in all two by twos.

00:03:14.880 --> 00:03:20.330
So let me take that to be my
matrix A, my companion matrix.

00:03:20.330 --> 00:03:23.290
So I just want to
go through the steps

00:03:23.290 --> 00:03:25.550
of finding its eigenvalues.

00:03:25.550 --> 00:03:29.760
What are the eigenvalues
of that matrix?

00:03:29.760 --> 00:03:33.940
We just take the
matrix, subtract lambda

00:03:33.940 --> 00:03:39.490
from the diagonal, and
take the determinant.

00:03:39.490 --> 00:03:43.140
And when I take the determinant
of a two by two matrix,

00:03:43.140 --> 00:03:46.200
it's just that
times that, which is

00:03:46.200 --> 00:03:49.940
minus lambda times minus
lambda is lambda squared.

00:03:49.940 --> 00:03:52.300
This gives me a B lambda.

00:03:52.300 --> 00:03:55.180
And the other part
of the determinant

00:03:55.180 --> 00:03:59.380
is this product, minus C. But
it comes with a minus sign,

00:03:59.380 --> 00:04:04.920
so it's plus C. So there's my
equation for the eigenvalues

00:04:04.920 --> 00:04:09.490
of a companion matrix.

00:04:09.490 --> 00:04:14.340
And of course you see that's
exactly the same equation

00:04:14.340 --> 00:04:18.750
that we had for the exponent s.

00:04:18.750 --> 00:04:28.680
So lambda for the matrix case
is the same as s, s1 and s2

00:04:28.680 --> 00:04:35.300
for the single second
order equation.

00:04:35.300 --> 00:04:39.760
So this equation has
solutions e to the st

00:04:39.760 --> 00:04:46.010
when the matrix has the
eigenvalues lambda equal s.

00:04:46.010 --> 00:04:49.870
Those same s1 and s2.

00:04:49.870 --> 00:04:57.260
But now I move on to a
general two by two matrix.

00:04:57.260 --> 00:04:59.630
What are its eigenvalues?

00:04:59.630 --> 00:05:03.470
What does that equation looks
like for its two eigenvalues?

00:05:03.470 --> 00:05:07.280
So this will be a
special case of this.

00:05:07.280 --> 00:05:12.070
Here, I have a general
matrix, a, b, c, d.

00:05:12.070 --> 00:05:14.880
I've subtracted lambda
from the diagonal.

00:05:14.880 --> 00:05:16.750
I'm taking the determinant.

00:05:16.750 --> 00:05:19.950
That'll give me the
two eigenvalues.

00:05:19.950 --> 00:05:22.170
Let's do it.

00:05:22.170 --> 00:05:26.140
Minus lambda times minus
lambda is lambda squared.

00:05:26.140 --> 00:05:30.190
Then I have a minus lambda
d and a minus lambda a.

00:05:30.190 --> 00:05:34.900
So I have an a plus a d lambda.

00:05:34.900 --> 00:05:37.880
And then I have the part
that doesn't involve lambda.

00:05:37.880 --> 00:05:40.530
The part that doesn't
involve lambda

00:05:40.530 --> 00:05:44.450
is just the determinant
of a, b, c, d.

00:05:44.450 --> 00:05:47.660
It's just the ad
and the minus bc.

00:05:47.660 --> 00:05:53.160
So there's an ad and a
minus bc, and all that is 0.

00:05:56.700 --> 00:05:59.600
It's a quadratic
equation, second degree.

00:05:59.600 --> 00:06:02.750
A two by two matrix
has two eigenvalues,

00:06:02.750 --> 00:06:05.990
the two roots of that equation.

00:06:05.990 --> 00:06:10.120
I just want to understand
more and more and more

00:06:10.120 --> 00:06:13.410
about the connection of
the roots, lambda 1 lambda

00:06:13.410 --> 00:06:17.640
2, to the matrix a, b, c, d.

00:06:17.640 --> 00:06:22.610
If I know the two by two matrix,
this tells me the eigenvalues.

00:06:22.610 --> 00:06:28.710
So this will, being a quadratic
equation, have two roots.

00:06:31.510 --> 00:06:36.290
So if I factor this, this will
factor into lambda minus lambda

00:06:36.290 --> 00:06:40.980
1 times lambda minus lambda 2.

00:06:40.980 --> 00:06:43.710
And of course, if
the numbers are nice,

00:06:43.710 --> 00:06:48.270
then I can see what
lambda 1 and lambda 2 are.

00:06:48.270 --> 00:06:53.080
In that case, I find
the eigenvalues.

00:06:53.080 --> 00:06:57.210
If the numbers are not nice,
then lambda 1 and lambda 2

00:06:57.210 --> 00:07:01.460
come from the quadratic formula,
the minus b plus or minus

00:07:01.460 --> 00:07:05.350
square root of b
squared minus 4ac.

00:07:05.350 --> 00:07:09.590
The quadratic formula will solve
this equation, will tell me

00:07:09.590 --> 00:07:11.130
these two numbers.

00:07:11.130 --> 00:07:17.420
And if I multiply it out this
way, I see lambda squared.

00:07:17.420 --> 00:07:24.450
I see minus lambda times
lambda 1 and lambda 2.

00:07:27.180 --> 00:07:34.710
And then I see plus lambda
1 times lambda 2 equals 0.

00:07:37.270 --> 00:07:41.360
Here, I've written the
equation for the two lambdas.

00:07:41.360 --> 00:07:45.740
Here, I've written the equation
when I know the two lambdas.

00:07:45.740 --> 00:07:47.200
Why did I do this?

00:07:47.200 --> 00:07:50.710
I want to match this
with this and see

00:07:50.710 --> 00:07:57.720
that this number, whatever it
is, is the same as that number.

00:07:57.720 --> 00:08:01.130
They show up there, the
coefficient of minus lambda.

00:08:01.130 --> 00:08:09.380
So that's the first step,
that lambda 1 plus lambda 2

00:08:09.380 --> 00:08:12.020
is the same as a plus d.

00:08:15.400 --> 00:08:18.890
Just matching those
two equations.

00:08:18.890 --> 00:08:23.890
This is just like a general
fact about a quadratic equation.

00:08:23.890 --> 00:08:30.370
The sum of the roots is the
minus coefficient of lambda.

00:08:30.370 --> 00:08:35.679
And then the constant
term is the constant term.

00:08:35.679 --> 00:08:42.183
So lambda 1 times
lambda 2 is ad minus bc.

00:08:46.880 --> 00:08:53.850
These are facts about a two
by two matrix, a, b, c, d.

00:08:53.850 --> 00:08:55.650
The sum of the eigenvalues.

00:08:55.650 --> 00:08:57.670
So this is the sum
of the eigenvalues--

00:08:57.670 --> 00:09:01.790
so I'll put s-u-m to
indicate that I'm looking

00:09:01.790 --> 00:09:06.470
at the sum-- is that a plus d.

00:09:06.470 --> 00:09:09.420
A plus d are the
numbers on the diagonal.

00:09:09.420 --> 00:09:11.350
So that's a little special.

00:09:11.350 --> 00:09:13.950
When I add the
diagonal numbers, I

00:09:13.950 --> 00:09:19.590
get something called
the trace of the matrix.

00:09:23.210 --> 00:09:25.580
I'm introducing a word, trace.

00:09:25.580 --> 00:09:28.750
Trace is the add up
down the diagonal.

00:09:28.750 --> 00:09:30.240
And that matches a plus d.

00:09:30.740 --> 00:09:38.460
And this one is the product
of the eigenvalues lambda

00:09:38.460 --> 00:09:40.180
1 times lambda 2.

00:09:40.180 --> 00:09:41.650
So that's the product.

00:09:41.650 --> 00:09:46.110
And that's equal to
the determinant of a.

00:09:49.490 --> 00:09:53.890
I'm just making all the
neat connections that

00:09:53.890 --> 00:09:57.700
are special for a two by two.

00:09:57.700 --> 00:10:00.920
So that if I write
down some matrices,

00:10:00.920 --> 00:10:02.780
we could look at
them immediately.

00:10:02.780 --> 00:10:05.920
Let me write down a matrix.

00:10:05.920 --> 00:10:07.630
Suppose I write
down that matrix.

00:10:14.140 --> 00:10:25.320
Oh, let me make them
0, 1-- well, 0, 4-- ah,

00:10:25.320 --> 00:10:27.170
let me improve this a little.

00:10:27.170 --> 00:10:30.481
2, 4, 4, 9.

00:10:30.481 --> 00:10:32.351
2, 4, 4, 2 would be even easier.

00:10:32.351 --> 00:10:32.850
Sorry.

00:10:36.420 --> 00:10:38.810
I look at that matrix.

00:10:38.810 --> 00:10:42.730
I see immediately the two
eigenvalues of that matrix

00:10:42.730 --> 00:10:44.646
add to 4.

00:10:44.646 --> 00:10:46.200
2 plus 2 is 4.

00:10:46.200 --> 00:10:48.400
I took the trace.

00:10:48.400 --> 00:10:51.440
The two eigenvalues of
that matrix multiply

00:10:51.440 --> 00:10:58.110
to the determinant, which is 2
times 2 is 4 minus 16 minus 12.

00:10:58.110 --> 00:11:03.350
So the sum here for
that matrix would be 4.

00:11:03.350 --> 00:11:06.860
The determinant of that
matrix would be 4 minus 16

00:11:06.860 --> 00:11:08.760
is minus 12.

00:11:08.760 --> 00:11:15.980
And maybe I can come up with the
two numbers that have add to 4

00:11:15.980 --> 00:11:17.750
and multiply to minus 12.

00:11:17.750 --> 00:11:22.285
I think, actually, that
they are six and minus 2.

00:11:22.285 --> 00:11:28.370
I think that the eigenvalues
here are 6 and minus 2

00:11:28.370 --> 00:11:31.500
because those add
up to 4, the trace,

00:11:31.500 --> 00:11:35.630
and they multiply 6 times
minus 2 is minus 12.

00:11:35.630 --> 00:11:38.550
That's the determinant.

00:11:38.550 --> 00:11:41.790
Two by two matrices,
you have a good chance

00:11:41.790 --> 00:11:44.590
at seeing exactly what happens.

00:11:44.590 --> 00:11:53.630
Now, my interest today for
this video is to use all this,

00:11:53.630 --> 00:11:58.220
use the eigenvalues,
to decide stability.

00:11:58.220 --> 00:12:02.540
Stability means that the
differential equation

00:12:02.540 --> 00:12:05.700
has solutions that go to 0.

00:12:05.700 --> 00:12:11.110
And we remember
the solutions are

00:12:11.110 --> 00:12:16.330
e to the st, which is the
same as e to the lambda t.

00:12:16.330 --> 00:12:20.520
The s and the lambda both
come from that same equation

00:12:20.520 --> 00:12:27.770
in the case of a second order
equation reduced to a companion

00:12:27.770 --> 00:12:28.890
matrix.

00:12:28.890 --> 00:12:37.560
So I'm interested in when
are the eigenvalues negative.

00:12:37.560 --> 00:12:39.740
When are the
eigenvalues negative?

00:12:39.740 --> 00:12:42.500
Or if they're
complex numbers, when

00:12:42.500 --> 00:12:44.720
are their real parts negative.

00:12:44.720 --> 00:12:51.400
So can we remember trace, the
sum, product, the determinant.

00:12:51.400 --> 00:12:54.820
And answer the
stability questions.

00:12:54.820 --> 00:12:55.995
So I'm ready for stability.

00:12:59.620 --> 00:13:04.090
So stability means
either lambda 1 negative

00:13:04.090 --> 00:13:07.710
and lambda 2 negative.

00:13:07.710 --> 00:13:09.145
This is in the real case.

00:13:11.840 --> 00:13:21.270
Or in the complex case,
lambda equals some real part

00:13:21.270 --> 00:13:25.690
plus and minus some
imaginary part.

00:13:25.690 --> 00:13:29.190
Then we want the real
part to be negative.

00:13:29.190 --> 00:13:34.490
Real part of a lambda,
which is a, should be 0.

00:13:34.490 --> 00:13:36.460
So that's our requirement.

00:13:36.460 --> 00:13:38.750
If the eigenvalues
are complex, we

00:13:38.750 --> 00:13:42.010
get a pair of them
and the real part

00:13:42.010 --> 00:13:46.990
should be 0 so that e to the--
the point about this negative a

00:13:46.990 --> 00:13:52.020
is that e to the
at will go to 0.

00:13:52.020 --> 00:13:53.910
The point about these
negative lambdas

00:13:53.910 --> 00:13:58.650
is that e to the
lambda t will go to 0.

00:13:58.650 --> 00:14:01.630
This is stability.

00:14:01.630 --> 00:14:11.030
So my question is, what's the
test on the matrix that decides

00:14:11.030 --> 00:14:13.360
this about the eigenvalues?

00:14:15.980 --> 00:14:18.340
Can we look at
the matrix-- maybe

00:14:18.340 --> 00:14:21.580
we don't have to find
those eigenvalues.

00:14:21.580 --> 00:14:23.330
Maybe we can use the fact.

00:14:23.330 --> 00:14:27.340
Again, the fact is that
lambda 1 plus lambda 2

00:14:27.340 --> 00:14:36.790
is the trace and lambda 1 times
lambda 2 is the determinant.

00:14:36.790 --> 00:14:40.580
And we can read those
numbers off from the matrix.

00:14:40.580 --> 00:14:42.950
Then there's a
quadratic equation.

00:14:42.950 --> 00:14:47.690
But if we only want to
know information like

00:14:47.690 --> 00:14:50.560
are the eigenvalues negative?

00:14:50.560 --> 00:14:53.360
Are their real parts negative?

00:14:53.360 --> 00:14:57.490
We can get that information
from these numbers

00:14:57.490 --> 00:15:03.110
without going to
finding the eigenvalues

00:15:03.110 --> 00:15:05.110
from that quadratic equation.

00:15:05.110 --> 00:15:08.740
Wouldn't be that hard to do,
but we don't have to do it.

00:15:08.740 --> 00:15:13.430
So suppose we have two
negative eigenvalues.

00:15:13.430 --> 00:15:21.630
Then certainly, this would mean
the trace would be negative.

00:15:21.630 --> 00:15:25.110
Because the trace is the
sum of the eigenvalues.

00:15:25.110 --> 00:15:29.320
If those are both negative,
trace is negative.

00:15:29.320 --> 00:15:33.470
So we can check about the
trace just right away.

00:15:33.470 --> 00:15:35.530
What about the determinant?

00:15:35.530 --> 00:15:38.660
If that's negative
and that's negative,

00:15:38.660 --> 00:15:42.090
then multiplying those will
give a positive number.

00:15:42.090 --> 00:15:44.600
So the determinant
should be positive.

00:15:44.600 --> 00:15:47.320
So trace less than 0.

00:15:47.320 --> 00:15:50.680
Determinant greater than 0.

00:15:50.680 --> 00:15:53.550
That is the stability test.

00:15:53.550 --> 00:15:55.250
That's the stability test.

00:15:57.610 --> 00:15:58.110
Stable.

00:16:01.590 --> 00:16:06.230
The two by two matrix A, B,
C, D, if its trace is negative

00:16:06.230 --> 00:16:09.780
and its determinant is
positive, is stable.

00:16:09.780 --> 00:16:11.190
That's the test.

00:16:11.190 --> 00:16:16.690
And actually, it works also
if lambda comes out complex

00:16:16.690 --> 00:16:24.280
because lambda 1 plus lambda
2-- lambda 1 is a plus i omega.

00:16:24.280 --> 00:16:26.840
Lambda 2 is a minus omega.

00:16:26.840 --> 00:16:30.130
The sum is just 2a.

00:16:30.130 --> 00:16:32.500
And we want that to be negative.

00:16:32.500 --> 00:16:35.530
So again, trace negative.

00:16:35.530 --> 00:16:40.830
Trace negative even if the roots
are real or if they're complex.

00:16:40.830 --> 00:16:44.970
That still tells us that the
sum of the roots is negative

00:16:44.970 --> 00:16:47.450
and the determinant also works.

00:16:47.450 --> 00:16:53.980
If a plus i omega times a
minus i omega-- in this case,

00:16:53.980 --> 00:16:58.140
lambda 1 times lambda 2--
if I multiply those numbers,

00:16:58.140 --> 00:17:02.750
I get a squared
plus omega squared.

00:17:02.750 --> 00:17:04.260
With a plus.

00:17:04.260 --> 00:17:06.079
So that would be positive.

00:17:06.079 --> 00:17:09.089
And we're good.

00:17:09.089 --> 00:17:16.890
So my conclusion is this
is the test for stability.

00:17:16.890 --> 00:17:19.020
And I can apply it
to a few matrices.

00:17:19.020 --> 00:17:21.990
I wrote down a few matrices.

00:17:21.990 --> 00:17:26.880
Can I just look at that test--
can you look at that test--

00:17:26.880 --> 00:17:28.950
and just apply it to see.

00:17:31.980 --> 00:17:34.170
So here's an example.

00:17:34.170 --> 00:17:41.130
Say minus 2, minus 1, 3, and 4.

00:17:41.130 --> 00:17:42.740
Is that any good?

00:17:42.740 --> 00:17:45.470
The trace is minus 3.

00:17:45.470 --> 00:17:46.690
That's good.

00:17:46.690 --> 00:17:50.190
The determinant is
2 minus 12 minus 10.

00:17:50.190 --> 00:17:51.710
That's bad.

00:17:51.710 --> 00:17:52.850
That's bad.

00:17:52.850 --> 00:17:55.650
So that would be unstable.

00:17:58.460 --> 00:18:00.120
That has a negative determinant.

00:18:00.120 --> 00:18:01.570
Unstable.

00:18:01.570 --> 00:18:03.500
So I'll put an x through that.

00:18:03.500 --> 00:18:04.840
Unstable.

00:18:04.840 --> 00:18:07.210
Let me take a stable one.

00:18:07.210 --> 00:18:13.170
Stable one, I'm going to want
like minus 5, and 1, let's say.

00:18:13.170 --> 00:18:14.620
That's OK.

00:18:14.620 --> 00:18:16.350
The trace is negative.

00:18:16.350 --> 00:18:17.710
Minus 4.

00:18:17.710 --> 00:18:21.250
And now I want to make
the determinant positive.

00:18:21.250 --> 00:18:27.360
So maybe I better put
like 6 and minus 7.

00:18:27.360 --> 00:18:28.940
Just picking numbers.

00:18:28.940 --> 00:18:36.550
So now the determinant
is minus 5 plus 42.

00:18:36.550 --> 00:18:38.620
A big positive number.

00:18:38.620 --> 00:18:41.310
And the determinant
test is passed.

00:18:41.310 --> 00:18:43.330
So that is OK.

00:18:43.330 --> 00:18:44.490
That one would be stable.

00:18:47.420 --> 00:18:52.500
If this was my matrix
A, then the solutions

00:18:52.500 --> 00:19:01.450
to dy dt equal Ay, y prime equal
Ay is my differential equation.

00:19:01.450 --> 00:19:06.610
The two solutions which
would track the eigenvectors

00:19:06.610 --> 00:19:09.580
would have negative lambdas.

00:19:09.580 --> 00:19:13.120
Negative lambdas because
the trace is negative

00:19:13.120 --> 00:19:15.590
and the determinant is positive.

00:19:15.590 --> 00:19:18.510
Passes the stability
test and the solutions

00:19:18.510 --> 00:19:21.960
would go to minus infinity.

00:19:21.960 --> 00:19:23.900
That's two by twos.

00:19:23.900 --> 00:19:25.650
Thank you.