WEBVTT

00:00:00.500 --> 00:00:01.350
GILBERT STRANG: OK.

00:00:01.350 --> 00:00:07.780
This is our last look at the
first order linear differential

00:00:07.780 --> 00:00:12.190
equation that you see up here.

00:00:12.190 --> 00:00:17.180
The dy dt is ay, that's
the interest rate growing

00:00:17.180 --> 00:00:21.640
in the bank example.

00:00:21.640 --> 00:00:24.560
y is our total balance.

00:00:24.560 --> 00:00:29.780
And q of t is our
deposits or withdrawals.

00:00:29.780 --> 00:00:32.700
Only one change.

00:00:32.700 --> 00:00:37.200
We allow the interest rate
a to change with time.

00:00:37.200 --> 00:00:39.300
This we didn't see before.

00:00:39.300 --> 00:00:41.680
Now we will get a formula.

00:00:41.680 --> 00:00:46.120
It will be a formula we had
before when a was constant.

00:00:46.120 --> 00:00:47.680
And now we'll see it.

00:00:47.680 --> 00:00:52.450
It looks a little messier, but
the point is, it can be done.

00:00:52.450 --> 00:00:56.500
We can solve that
equation by a new way.

00:00:56.500 --> 00:00:59.220
So that's really
the other point.

00:00:59.220 --> 00:01:04.730
Everybody in the end likes
these integrating factors.

00:01:04.730 --> 00:01:07.800
And I will call it m.

00:01:07.800 --> 00:01:13.050
And let me show you what
it is and how it works.

00:01:13.050 --> 00:01:18.420
What it is is the solution
to the null equation,

00:01:18.420 --> 00:01:20.680
with a minus sign.

00:01:20.680 --> 00:01:26.830
With a minus sign. dM
dt equals minus a of tM.

00:01:26.830 --> 00:01:28.010
No source term.

00:01:28.010 --> 00:01:30.160
We can solve that equation.

00:01:30.160 --> 00:01:34.830
If a is constant-- and I'll keep
that case going because that's

00:01:34.830 --> 00:01:38.850
the one with simple,
recognizable formulas.

00:01:38.850 --> 00:01:42.900
If a is a constant, we're
looking for the function

00:01:42.900 --> 00:01:46.530
M whose derivative is minus aM.

00:01:46.530 --> 00:01:50.060
And that function is
e to the minus at.

00:01:52.700 --> 00:01:56.550
The derivative brings down
the minus a that we want.

00:01:56.550 --> 00:02:01.250
In case a is varying, we can
still to solve this equation.

00:02:01.250 --> 00:02:07.160
It will still be an
exponential of minus something.

00:02:07.160 --> 00:02:09.870
But what we have
to put here when

00:02:09.870 --> 00:02:13.560
I take the derivative of
M, the derivative of that

00:02:13.560 --> 00:02:15.000
will come down.

00:02:15.000 --> 00:02:17.690
So I want the
integral of a here.

00:02:17.690 --> 00:02:22.580
And then the derivative of
the integral is a minus a,

00:02:22.580 --> 00:02:25.160
coming down as it should.

00:02:25.160 --> 00:02:29.570
So I want minus
the integral of a.

00:02:32.220 --> 00:02:39.360
And can I introduce dummy
variables, say a of T dT,

00:02:39.360 --> 00:02:43.930
just to make the
notation look right.

00:02:43.930 --> 00:02:44.840
OK.

00:02:44.840 --> 00:02:48.840
You see that, again,
the derivative of M

00:02:48.840 --> 00:02:51.210
is always with an exponential.

00:02:51.210 --> 00:02:54.590
It's always the exponential
times the derivative

00:02:54.590 --> 00:02:56.240
of the exponent.

00:02:56.240 --> 00:03:00.320
And the derivative of
that exponent is minus a.

00:03:00.320 --> 00:03:03.430
Because by the fundamental
theorem of calculus,

00:03:03.430 --> 00:03:07.170
if I integrate a and take its
derivative, I get a again.

00:03:07.170 --> 00:03:09.650
And it's that a that I want.

00:03:09.650 --> 00:03:12.145
Now, why do I want this M?

00:03:12.145 --> 00:03:14.680
How does it work?

00:03:14.680 --> 00:03:18.026
Here's the reason M succeeds.

00:03:18.026 --> 00:03:22.170
Look at the derivative
of M times y.

00:03:25.600 --> 00:03:27.250
That's a product.

00:03:27.250 --> 00:03:29.490
So I'll use the product rule.

00:03:29.490 --> 00:03:36.730
I get the derivative
of y times M,

00:03:36.730 --> 00:03:42.900
and then I get the
derivative of M times y.

00:03:42.900 --> 00:03:46.600
But the derivative of
M is minus a of tM,

00:03:46.600 --> 00:03:54.760
so I better put the derivative
of M is minus a of tM times y.

00:03:58.100 --> 00:04:00.000
But what have I got here?

00:04:00.000 --> 00:04:04.300
Factor out an M and
that's just dy dt

00:04:04.300 --> 00:04:08.800
minus ay, dy dt minus ay is q.

00:04:08.800 --> 00:04:11.910
So when I factor out
the M, I just have q.

00:04:11.910 --> 00:04:15.170
All together, this is M times q.

00:04:18.320 --> 00:04:23.560
Look, my differential
equation couldn't look nicer.

00:04:23.560 --> 00:04:28.450
Multiplying by M
made it just tell us

00:04:28.450 --> 00:04:33.330
that a derivative is
a right-hand side.

00:04:33.330 --> 00:04:37.270
To solve that equation, we
just integrate both sides.

00:04:37.270 --> 00:04:41.070
So if you'll allow me to take
that step, integrate both sides

00:04:41.070 --> 00:04:44.940
and see what I've
got, that will give us

00:04:44.940 --> 00:04:49.250
the formula we know when
we're in the constant case,

00:04:49.250 --> 00:04:53.670
and the formula we've never
seen when t is varying.

00:04:53.670 --> 00:04:55.170
And then I'll do an example.

00:04:55.170 --> 00:04:58.030
Let me do an example right away.

00:04:58.030 --> 00:05:03.590
Suppose a of t, instead of
being constant, is growing.

00:05:03.590 --> 00:05:06.076
The economy is really
in hyperinflation.

00:05:09.290 --> 00:05:18.050
Take that example if a
of t is, let's say, 2t.

00:05:21.670 --> 00:05:26.470
Interest rate started
low and moves up,

00:05:26.470 --> 00:05:31.450
then growth is going to be
faster and faster as time

00:05:31.450 --> 00:05:32.510
goes on.

00:05:32.510 --> 00:05:38.250
And what will be
the integral of 2t?

00:05:38.250 --> 00:05:44.450
The integral of 2t is t
squared, so M, in that case,

00:05:44.450 --> 00:05:49.400
will be e to the
minus a t squared.

00:05:49.400 --> 00:05:52.050
Sorry, there's no a anymore.

00:05:52.050 --> 00:05:53.550
a is just the 2t.

00:05:53.550 --> 00:05:55.446
e to the minus t squared.

00:05:58.880 --> 00:06:01.590
With a minus sign,
it's dropping fast.

00:06:01.590 --> 00:06:04.360
In a minute, we'll
have a plus sign there

00:06:04.360 --> 00:06:06.600
and we'll see the growth.

00:06:06.600 --> 00:06:11.890
Do you see that this is the
integrating factor when a of t

00:06:11.890 --> 00:06:13.430
happens to be 2t?

00:06:13.430 --> 00:06:14.310
OK.

00:06:14.310 --> 00:06:18.180
Now I come back to this
equation and integrate

00:06:18.180 --> 00:06:21.430
both sides to get the answer.

00:06:21.430 --> 00:06:23.890
OK.

00:06:23.890 --> 00:06:24.390
All right.

00:06:24.390 --> 00:06:27.600
The integral of My,
of the derivative,

00:06:27.600 --> 00:06:29.940
the integral of the
derivative is just

00:06:29.940 --> 00:06:38.886
M of t y of t minus
M of 0 y of 0.

00:06:38.886 --> 00:06:41.190
That's the integral
on the left side.

00:06:41.190 --> 00:06:44.660
And on the right side,
I have the integral

00:06:44.660 --> 00:06:49.540
of M times q from 0 to t.

00:06:53.050 --> 00:06:58.980
And again, I'm going to
put in an integration

00:06:58.980 --> 00:07:06.340
variable different from t
just to keep things straight.

00:07:06.340 --> 00:07:07.860
OK.

00:07:07.860 --> 00:07:10.820
So now I've got a formula for y.

00:07:13.590 --> 00:07:18.385
It involves the M. Actually,
the y is multiplied by M,

00:07:18.385 --> 00:07:21.621
I better divide by-- first of
all, do we remember what M of 0

00:07:21.621 --> 00:07:22.120
is?

00:07:22.120 --> 00:07:24.380
That's the growth factor at 0.

00:07:24.380 --> 00:07:25.400
It's just 1.

00:07:25.400 --> 00:07:27.050
Nothing's happened.

00:07:27.050 --> 00:07:33.480
It's the exponential of 0 in
our formulas for M. M of 0 is 1.

00:07:33.480 --> 00:07:35.840
That's where M starts.

00:07:35.840 --> 00:07:37.230
So M of 0 is 1.

00:07:37.230 --> 00:07:39.550
I can remove that.

00:07:39.550 --> 00:07:40.600
OK.

00:07:40.600 --> 00:07:45.680
And now-- oh, let me put that on
the other side so this will be

00:07:45.680 --> 00:07:50.100
equals y of 0 plus that.

00:07:50.100 --> 00:07:52.910
OK.

00:07:52.910 --> 00:07:56.550
And now if I divide by
M, I have my answer.

00:07:56.550 --> 00:07:57.820
So those are the steps.

00:07:57.820 --> 00:08:00.566
Find the integrating factor.

00:08:00.566 --> 00:08:05.450
Do the integration,
which is now made easy

00:08:05.450 --> 00:08:10.760
because I have a perfect
derivative whose integral I

00:08:10.760 --> 00:08:12.530
just have to integrate.

00:08:12.530 --> 00:08:21.935
And then put in what M is, and
divide by it so that I get y.

00:08:21.935 --> 00:08:22.435
OK.

00:08:22.435 --> 00:08:27.400
So I'm dividing by M.
So what is 1 over M?

00:08:27.400 --> 00:08:34.970
Well, M has this minus
sign in the exponent.

00:08:34.970 --> 00:08:37.600
1 over M will have a plus sign.

00:08:37.600 --> 00:08:41.100
M here has e to the
minus t squared.

00:08:41.100 --> 00:08:44.710
1 over M will be e to
the plus t squared.

00:08:44.710 --> 00:08:50.440
So when I divide
by M, I get y of t.

00:08:50.440 --> 00:08:56.690
This will be 1 over M. That will
be e to the plus the integral

00:08:56.690 --> 00:09:02.900
of a of t dt y of 0.

00:09:02.900 --> 00:09:05.270
That's the null solution.

00:09:05.270 --> 00:09:09.220
That's the solution that's
growing out of y of 0.

00:09:09.220 --> 00:09:16.290
And now I have plus the integral
from 0 to t of-- remember,

00:09:16.290 --> 00:09:21.400
I'm dividing by M. And
that's e to the plus

00:09:21.400 --> 00:09:30.342
the integral from 0 to
s of a times q of s ds.

00:09:38.110 --> 00:09:38.610
OK.

00:09:38.610 --> 00:09:40.620
Oh, just a moment.

00:09:40.620 --> 00:09:44.870
I'm dividing by M
and I had an M there.

00:09:44.870 --> 00:09:45.850
Oh, wait a minute.

00:09:45.850 --> 00:09:47.580
I haven't got it right here.

00:09:47.580 --> 00:09:53.590
So I want to know what is M at
time s divided by M at time t?

00:09:56.180 --> 00:10:02.670
So this was the
integral from 0 to s.

00:10:02.670 --> 00:10:07.370
This is an integral from 0 to t.

00:10:07.370 --> 00:10:12.090
And both are in the exponent.

00:10:12.090 --> 00:10:15.030
This is-- can I say it here?

00:10:15.030 --> 00:10:22.360
This is a e to the-- divided by
M is the integral from 0 to t.

00:10:22.360 --> 00:10:26.720
And then I'm multiplying by e
to the minus the integral from 0

00:10:26.720 --> 00:10:27.220
to s.

00:10:31.000 --> 00:10:33.810
The rule for
exponents is if I have

00:10:33.810 --> 00:10:38.040
a product of two exponentials,
I add the exponents.

00:10:38.040 --> 00:10:41.810
When I add this to
this, this knocks off

00:10:41.810 --> 00:10:44.010
the lower half of the integral.

00:10:44.010 --> 00:10:49.340
I'm left with the
integral from s to t of a.

00:10:49.340 --> 00:10:53.640
So this was an integral of
a minus an integral of a.

00:10:53.640 --> 00:10:56.110
Let me do our example.

00:10:56.110 --> 00:10:58.950
Our example up here.

00:10:58.950 --> 00:11:06.290
Example-- M of t will be--
when a is equal to 2t,

00:11:06.290 --> 00:11:09.170
this was the example
a equal to 2t.

00:11:13.000 --> 00:11:17.960
The first time we've been able
to deal with a varying interest

00:11:17.960 --> 00:11:18.790
rate.

00:11:18.790 --> 00:11:21.550
So the integral of
2t is t squared.

00:11:21.550 --> 00:11:25.700
From the-- is e
to the t squared.

00:11:25.700 --> 00:11:28.940
And I subtract the
lower limit, s squared.

00:11:28.940 --> 00:11:30.185
That's the growth factor.

00:11:33.520 --> 00:11:39.940
That's the growth factor
from time s to time t.

00:11:39.940 --> 00:11:43.570
When a was constant,
that exponent

00:11:43.570 --> 00:11:46.290
was just a times t minus s.

00:11:46.290 --> 00:11:48.880
That told us the time.

00:11:48.880 --> 00:11:53.090
But now, a is varying and
the growth factor between s

00:11:53.090 --> 00:11:56.380
and t is e to the t
squared minus s squared.

00:11:56.380 --> 00:12:00.620
So that's what goes in here.

00:12:03.600 --> 00:12:07.910
Let me-- that's
the growth factor.

00:12:07.910 --> 00:12:09.590
May I just put it in here?

00:12:09.590 --> 00:12:14.070
In this example, it's e to
the t squared minus s squared.

00:12:18.560 --> 00:12:21.900
Instead of e to the
a t minus s, I now

00:12:21.900 --> 00:12:24.100
have t squared minus
s squared, because I

00:12:24.100 --> 00:12:28.760
had an integral of a of t,
and a is not constant anymore.

00:12:28.760 --> 00:12:29.965
This is my example.

00:12:32.770 --> 00:12:37.020
And I don't know if
you like this formula.

00:12:37.020 --> 00:12:38.880
Can I just describe it again?

00:12:43.260 --> 00:12:45.480
This was an integral
from 0 to t,

00:12:45.480 --> 00:12:51.440
so that would be-- this part
would be e to the t squared.

00:12:51.440 --> 00:12:56.320
That's the growth factor that
multiplies the initial deposit.

00:12:56.320 --> 00:12:58.320
The growth factor
that multiplies

00:12:58.320 --> 00:13:04.230
the later deposit is e to the
t squared minus s squared.

00:13:04.230 --> 00:13:13.810
And we allow deposits all
the way from s equals 0 to t.

00:13:13.810 --> 00:13:16.830
So when we add those
up, we get that sum.

00:13:20.640 --> 00:13:23.870
We've solved an
equation that we hadn't

00:13:23.870 --> 00:13:26.070
been able to solve before.

00:13:26.070 --> 00:13:29.490
That's a small triumph in
differential equations.

00:13:29.490 --> 00:13:31.270
Small, admittedly.

00:13:31.270 --> 00:13:36.430
I'd rather move next to
non-linear equations, which

00:13:36.430 --> 00:13:38.100
we have not touched.

00:13:38.100 --> 00:13:40.780
And that's a big deal.

00:13:40.780 --> 00:13:42.600
Thank you.