1
00:00:00,500 --> 00:00:01,350
GILBERT STRANG: OK.
2
00:00:01,350 --> 00:00:07,780
This is our last look at the
first order linear differential
3
00:00:07,780 --> 00:00:12,190
equation that you see up here.
4
00:00:12,190 --> 00:00:17,180
The dy dt is ay, that's
the interest rate growing
5
00:00:17,180 --> 00:00:21,640
in the bank example.
6
00:00:21,640 --> 00:00:24,560
y is our total balance.
7
00:00:24,560 --> 00:00:29,780
And q of t is our
deposits or withdrawals.
8
00:00:29,780 --> 00:00:32,700
Only one change.
9
00:00:32,700 --> 00:00:37,200
We allow the interest rate
a to change with time.
10
00:00:37,200 --> 00:00:39,300
This we didn't see before.
11
00:00:39,300 --> 00:00:41,680
Now we will get a formula.
12
00:00:41,680 --> 00:00:46,120
It will be a formula we had
before when a was constant.
13
00:00:46,120 --> 00:00:47,680
And now we'll see it.
14
00:00:47,680 --> 00:00:52,450
It looks a little messier, but
the point is, it can be done.
15
00:00:52,450 --> 00:00:56,500
We can solve that
equation by a new way.
16
00:00:56,500 --> 00:00:59,220
So that's really
the other point.
17
00:00:59,220 --> 00:01:04,730
Everybody in the end likes
these integrating factors.
18
00:01:04,730 --> 00:01:07,800
And I will call it m.
19
00:01:07,800 --> 00:01:13,050
And let me show you what
it is and how it works.
20
00:01:13,050 --> 00:01:18,420
What it is is the solution
to the null equation,
21
00:01:18,420 --> 00:01:20,680
with a minus sign.
22
00:01:20,680 --> 00:01:26,830
With a minus sign. dM
dt equals minus a of tM.
23
00:01:26,830 --> 00:01:28,010
No source term.
24
00:01:28,010 --> 00:01:30,160
We can solve that equation.
25
00:01:30,160 --> 00:01:34,830
If a is constant-- and I'll keep
that case going because that's
26
00:01:34,830 --> 00:01:38,850
the one with simple,
recognizable formulas.
27
00:01:38,850 --> 00:01:42,900
If a is a constant, we're
looking for the function
28
00:01:42,900 --> 00:01:46,530
M whose derivative is minus aM.
29
00:01:46,530 --> 00:01:50,060
And that function is
e to the minus at.
30
00:01:52,700 --> 00:01:56,550
The derivative brings down
the minus a that we want.
31
00:01:56,550 --> 00:02:01,250
In case a is varying, we can
still to solve this equation.
32
00:02:01,250 --> 00:02:07,160
It will still be an
exponential of minus something.
33
00:02:07,160 --> 00:02:09,870
But what we have
to put here when
34
00:02:09,870 --> 00:02:13,560
I take the derivative of
M, the derivative of that
35
00:02:13,560 --> 00:02:15,000
will come down.
36
00:02:15,000 --> 00:02:17,690
So I want the
integral of a here.
37
00:02:17,690 --> 00:02:22,580
And then the derivative of
the integral is a minus a,
38
00:02:22,580 --> 00:02:25,160
coming down as it should.
39
00:02:25,160 --> 00:02:29,570
So I want minus
the integral of a.
40
00:02:32,220 --> 00:02:39,360
And can I introduce dummy
variables, say a of T dT,
41
00:02:39,360 --> 00:02:43,930
just to make the
notation look right.
42
00:02:43,930 --> 00:02:44,840
OK.
43
00:02:44,840 --> 00:02:48,840
You see that, again,
the derivative of M
44
00:02:48,840 --> 00:02:51,210
is always with an exponential.
45
00:02:51,210 --> 00:02:54,590
It's always the exponential
times the derivative
46
00:02:54,590 --> 00:02:56,240
of the exponent.
47
00:02:56,240 --> 00:03:00,320
And the derivative of
that exponent is minus a.
48
00:03:00,320 --> 00:03:03,430
Because by the fundamental
theorem of calculus,
49
00:03:03,430 --> 00:03:07,170
if I integrate a and take its
derivative, I get a again.
50
00:03:07,170 --> 00:03:09,650
And it's that a that I want.
51
00:03:09,650 --> 00:03:12,145
Now, why do I want this M?
52
00:03:12,145 --> 00:03:14,680
How does it work?
53
00:03:14,680 --> 00:03:18,026
Here's the reason M succeeds.
54
00:03:18,026 --> 00:03:22,170
Look at the derivative
of M times y.
55
00:03:25,600 --> 00:03:27,250
That's a product.
56
00:03:27,250 --> 00:03:29,490
So I'll use the product rule.
57
00:03:29,490 --> 00:03:36,730
I get the derivative
of y times M,
58
00:03:36,730 --> 00:03:42,900
and then I get the
derivative of M times y.
59
00:03:42,900 --> 00:03:46,600
But the derivative of
M is minus a of tM,
60
00:03:46,600 --> 00:03:54,760
so I better put the derivative
of M is minus a of tM times y.
61
00:03:58,100 --> 00:04:00,000
But what have I got here?
62
00:04:00,000 --> 00:04:04,300
Factor out an M and
that's just dy dt
63
00:04:04,300 --> 00:04:08,800
minus ay, dy dt minus ay is q.
64
00:04:08,800 --> 00:04:11,910
So when I factor out
the M, I just have q.
65
00:04:11,910 --> 00:04:15,170
All together, this is M times q.
66
00:04:18,320 --> 00:04:23,560
Look, my differential
equation couldn't look nicer.
67
00:04:23,560 --> 00:04:28,450
Multiplying by M
made it just tell us
68
00:04:28,450 --> 00:04:33,330
that a derivative is
a right-hand side.
69
00:04:33,330 --> 00:04:37,270
To solve that equation, we
just integrate both sides.
70
00:04:37,270 --> 00:04:41,070
So if you'll allow me to take
that step, integrate both sides
71
00:04:41,070 --> 00:04:44,940
and see what I've
got, that will give us
72
00:04:44,940 --> 00:04:49,250
the formula we know when
we're in the constant case,
73
00:04:49,250 --> 00:04:53,670
and the formula we've never
seen when t is varying.
74
00:04:53,670 --> 00:04:55,170
And then I'll do an example.
75
00:04:55,170 --> 00:04:58,030
Let me do an example right away.
76
00:04:58,030 --> 00:05:03,590
Suppose a of t, instead of
being constant, is growing.
77
00:05:03,590 --> 00:05:06,076
The economy is really
in hyperinflation.
78
00:05:09,290 --> 00:05:18,050
Take that example if a
of t is, let's say, 2t.
79
00:05:21,670 --> 00:05:26,470
Interest rate started
low and moves up,
80
00:05:26,470 --> 00:05:31,450
then growth is going to be
faster and faster as time
81
00:05:31,450 --> 00:05:32,510
goes on.
82
00:05:32,510 --> 00:05:38,250
And what will be
the integral of 2t?
83
00:05:38,250 --> 00:05:44,450
The integral of 2t is t
squared, so M, in that case,
84
00:05:44,450 --> 00:05:49,400
will be e to the
minus a t squared.
85
00:05:49,400 --> 00:05:52,050
Sorry, there's no a anymore.
86
00:05:52,050 --> 00:05:53,550
a is just the 2t.
87
00:05:53,550 --> 00:05:55,446
e to the minus t squared.
88
00:05:58,880 --> 00:06:01,590
With a minus sign,
it's dropping fast.
89
00:06:01,590 --> 00:06:04,360
In a minute, we'll
have a plus sign there
90
00:06:04,360 --> 00:06:06,600
and we'll see the growth.
91
00:06:06,600 --> 00:06:11,890
Do you see that this is the
integrating factor when a of t
92
00:06:11,890 --> 00:06:13,430
happens to be 2t?
93
00:06:13,430 --> 00:06:14,310
OK.
94
00:06:14,310 --> 00:06:18,180
Now I come back to this
equation and integrate
95
00:06:18,180 --> 00:06:21,430
both sides to get the answer.
96
00:06:21,430 --> 00:06:23,890
OK.
97
00:06:23,890 --> 00:06:24,390
All right.
98
00:06:24,390 --> 00:06:27,600
The integral of My,
of the derivative,
99
00:06:27,600 --> 00:06:29,940
the integral of the
derivative is just
100
00:06:29,940 --> 00:06:38,886
M of t y of t minus
M of 0 y of 0.
101
00:06:38,886 --> 00:06:41,190
That's the integral
on the left side.
102
00:06:41,190 --> 00:06:44,660
And on the right side,
I have the integral
103
00:06:44,660 --> 00:06:49,540
of M times q from 0 to t.
104
00:06:53,050 --> 00:06:58,980
And again, I'm going to
put in an integration
105
00:06:58,980 --> 00:07:06,340
variable different from t
just to keep things straight.
106
00:07:06,340 --> 00:07:07,860
OK.
107
00:07:07,860 --> 00:07:10,820
So now I've got a formula for y.
108
00:07:13,590 --> 00:07:18,385
It involves the M. Actually,
the y is multiplied by M,
109
00:07:18,385 --> 00:07:21,621
I better divide by-- first of
all, do we remember what M of 0
110
00:07:21,621 --> 00:07:22,120
is?
111
00:07:22,120 --> 00:07:24,380
That's the growth factor at 0.
112
00:07:24,380 --> 00:07:25,400
It's just 1.
113
00:07:25,400 --> 00:07:27,050
Nothing's happened.
114
00:07:27,050 --> 00:07:33,480
It's the exponential of 0 in
our formulas for M. M of 0 is 1.
115
00:07:33,480 --> 00:07:35,840
That's where M starts.
116
00:07:35,840 --> 00:07:37,230
So M of 0 is 1.
117
00:07:37,230 --> 00:07:39,550
I can remove that.
118
00:07:39,550 --> 00:07:40,600
OK.
119
00:07:40,600 --> 00:07:45,680
And now-- oh, let me put that on
the other side so this will be
120
00:07:45,680 --> 00:07:50,100
equals y of 0 plus that.
121
00:07:50,100 --> 00:07:52,910
OK.
122
00:07:52,910 --> 00:07:56,550
And now if I divide by
M, I have my answer.
123
00:07:56,550 --> 00:07:57,820
So those are the steps.
124
00:07:57,820 --> 00:08:00,566
Find the integrating factor.
125
00:08:00,566 --> 00:08:05,450
Do the integration,
which is now made easy
126
00:08:05,450 --> 00:08:10,760
because I have a perfect
derivative whose integral I
127
00:08:10,760 --> 00:08:12,530
just have to integrate.
128
00:08:12,530 --> 00:08:21,935
And then put in what M is, and
divide by it so that I get y.
129
00:08:21,935 --> 00:08:22,435
OK.
130
00:08:22,435 --> 00:08:27,400
So I'm dividing by M.
So what is 1 over M?
131
00:08:27,400 --> 00:08:34,970
Well, M has this minus
sign in the exponent.
132
00:08:34,970 --> 00:08:37,600
1 over M will have a plus sign.
133
00:08:37,600 --> 00:08:41,100
M here has e to the
minus t squared.
134
00:08:41,100 --> 00:08:44,710
1 over M will be e to
the plus t squared.
135
00:08:44,710 --> 00:08:50,440
So when I divide
by M, I get y of t.
136
00:08:50,440 --> 00:08:56,690
This will be 1 over M. That will
be e to the plus the integral
137
00:08:56,690 --> 00:09:02,900
of a of t dt y of 0.
138
00:09:02,900 --> 00:09:05,270
That's the null solution.
139
00:09:05,270 --> 00:09:09,220
That's the solution that's
growing out of y of 0.
140
00:09:09,220 --> 00:09:16,290
And now I have plus the integral
from 0 to t of-- remember,
141
00:09:16,290 --> 00:09:21,400
I'm dividing by M. And
that's e to the plus
142
00:09:21,400 --> 00:09:30,342
the integral from 0 to
s of a times q of s ds.
143
00:09:38,110 --> 00:09:38,610
OK.
144
00:09:38,610 --> 00:09:40,620
Oh, just a moment.
145
00:09:40,620 --> 00:09:44,870
I'm dividing by M
and I had an M there.
146
00:09:44,870 --> 00:09:45,850
Oh, wait a minute.
147
00:09:45,850 --> 00:09:47,580
I haven't got it right here.
148
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?
149
00:09:56,180 --> 00:10:02,670
So this was the
integral from 0 to s.
150
00:10:02,670 --> 00:10:07,370
This is an integral from 0 to t.
151
00:10:07,370 --> 00:10:12,090
And both are in the exponent.
152
00:10:12,090 --> 00:10:15,030
This is-- can I say it here?
153
00:10:15,030 --> 00:10:22,360
This is a e to the-- divided by
M is the integral from 0 to t.
154
00:10:22,360 --> 00:10:26,720
And then I'm multiplying by e
to the minus the integral from 0
155
00:10:26,720 --> 00:10:27,220
to s.
156
00:10:31,000 --> 00:10:33,810
The rule for
exponents is if I have
157
00:10:33,810 --> 00:10:38,040
a product of two exponentials,
I add the exponents.
158
00:10:38,040 --> 00:10:41,810
When I add this to
this, this knocks off
159
00:10:41,810 --> 00:10:44,010
the lower half of the integral.
160
00:10:44,010 --> 00:10:49,340
I'm left with the
integral from s to t of a.
161
00:10:49,340 --> 00:10:53,640
So this was an integral of
a minus an integral of a.
162
00:10:53,640 --> 00:10:56,110
Let me do our example.
163
00:10:56,110 --> 00:10:58,950
Our example up here.
164
00:10:58,950 --> 00:11:06,290
Example-- M of t will be--
when a is equal to 2t,
165
00:11:06,290 --> 00:11:09,170
this was the example
a equal to 2t.
166
00:11:13,000 --> 00:11:17,960
The first time we've been able
to deal with a varying interest
167
00:11:17,960 --> 00:11:18,790
rate.
168
00:11:18,790 --> 00:11:21,550
So the integral of
2t is t squared.
169
00:11:21,550 --> 00:11:25,700
From the-- is e
to the t squared.
170
00:11:25,700 --> 00:11:28,940
And I subtract the
lower limit, s squared.
171
00:11:28,940 --> 00:11:30,185
That's the growth factor.
172
00:11:33,520 --> 00:11:39,940
That's the growth factor
from time s to time t.
173
00:11:39,940 --> 00:11:43,570
When a was constant,
that exponent
174
00:11:43,570 --> 00:11:46,290
was just a times t minus s.
175
00:11:46,290 --> 00:11:48,880
That told us the time.
176
00:11:48,880 --> 00:11:53,090
But now, a is varying and
the growth factor between s
177
00:11:53,090 --> 00:11:56,380
and t is e to the t
squared minus s squared.
178
00:11:56,380 --> 00:12:00,620
So that's what goes in here.
179
00:12:03,600 --> 00:12:07,910
Let me-- that's
the growth factor.
180
00:12:07,910 --> 00:12:09,590
May I just put it in here?
181
00:12:09,590 --> 00:12:14,070
In this example, it's e to
the t squared minus s squared.
182
00:12:18,560 --> 00:12:21,900
Instead of e to the
a t minus s, I now
183
00:12:21,900 --> 00:12:24,100
have t squared minus
s squared, because I
184
00:12:24,100 --> 00:12:28,760
had an integral of a of t,
and a is not constant anymore.
185
00:12:28,760 --> 00:12:29,965
This is my example.
186
00:12:32,770 --> 00:12:37,020
And I don't know if
you like this formula.
187
00:12:37,020 --> 00:12:38,880
Can I just describe it again?
188
00:12:43,260 --> 00:12:45,480
This was an integral
from 0 to t,
189
00:12:45,480 --> 00:12:51,440
so that would be-- this part
would be e to the t squared.
190
00:12:51,440 --> 00:12:56,320
That's the growth factor that
multiplies the initial deposit.
191
00:12:56,320 --> 00:12:58,320
The growth factor
that multiplies
192
00:12:58,320 --> 00:13:04,230
the later deposit is e to the
t squared minus s squared.
193
00:13:04,230 --> 00:13:13,810
And we allow deposits all
the way from s equals 0 to t.
194
00:13:13,810 --> 00:13:16,830
So when we add those
up, we get that sum.
195
00:13:20,640 --> 00:13:23,870
We've solved an
equation that we hadn't
196
00:13:23,870 --> 00:13:26,070
been able to solve before.
197
00:13:26,070 --> 00:13:29,490
That's a small triumph in
differential equations.
198
00:13:29,490 --> 00:13:31,270
Small, admittedly.
199
00:13:31,270 --> 00:13:36,430
I'd rather move next to
non-linear equations, which
200
00:13:36,430 --> 00:13:38,100
we have not touched.
201
00:13:38,100 --> 00:13:40,780
And that's a big deal.
202
00:13:40,780 --> 00:13:42,600
Thank you.