1
00:00:00,916 --> 00:00:06,280
This'll be the second half of my lectures
on integration.

2
00:00:06,280 --> 00:00:08,981
So last time we just talked a little bit
about

3
00:00:08,981 --> 00:00:13,154
what integration was, the problem it was
trying to solve.

4
00:00:13,154 --> 00:00:16,265
we talked about the fundamental theorem of
calculus, which

5
00:00:16,265 --> 00:00:19,471
is a tool that lets us actually evaluate
definite integrals.

6
00:00:21,012 --> 00:00:23,460
one over a little bit of application of

7
00:00:23,460 --> 00:00:26,588
integrals and then I started talking about
techniques

8
00:00:26,588 --> 00:00:27,660
of integration.

9
00:00:27,660 --> 00:00:32,082
So I cover something called integration by
parts which was just the product all

10
00:00:32,082 --> 00:00:35,030
backwards and then something called
integration by

11
00:00:35,030 --> 00:00:37,911
substitution or the substitution method
which was

12
00:00:37,911 --> 00:00:44,508
just the general kind of running backwards
Today I'm going to do one more technique

13
00:00:44,508 --> 00:00:47,388
of integration called completing the
square for

14
00:00:47,388 --> 00:00:49,400
those of you who are taking 461.

15
00:00:49,400 --> 00:00:51,608
You're going to use this when we try to

16
00:00:51,608 --> 00:00:53,816
transform a normal distribution into

17
00:00:53,816 --> 00:00:56,730
something called the log normal
distribution.

18
00:00:56,730 --> 00:00:59,355
And then I'm going to talk about

19
00:00:59,355 --> 00:01:05,345
differentiating definite integrals so a
function can

20
00:01:05,345 --> 00:01:11,230
have, could be defined with integral and
having the variable in the limit.

21
00:01:11,230 --> 00:01:13,980
So in that case you n actually think of
that as a, a function you can

22
00:01:13,980 --> 00:01:14,430
[INAUDIBLE]

23
00:01:14,430 --> 00:01:16,190
the derivative off.

24
00:01:16,190 --> 00:01:20,478
I'll talk about improper integrals so
these are either integrals of functions

25
00:01:20,478 --> 00:01:23,850
that take infinite values in either the x
or, or y direction.

26
00:01:25,030 --> 00:01:28,115
And the, differentiating improper
integrals.

27
00:01:28,115 --> 00:01:34,480
Okay, So, I'm going to get started with my
completing the square.

28
00:01:34,480 --> 00:01:36,520
And I'll, I'll introduce this just by
trying

29
00:01:36,520 --> 00:01:39,370
to remind everybody of something called
the Quadratic Formula.

30
00:01:41,510 --> 00:01:43,600
And so, a quadratic function.

31
00:01:43,600 --> 00:01:48,280
Is just a function, it's a polynomial of
degree two, so it's a times x

32
00:01:48,280 --> 00:01:52,770
squared plus b times x plus c, or a b and
c are real valued constants.

33
00:01:54,850 --> 00:01:58,550
And we have to add the extra condition
that a is not equal to zero.

34
00:01:58,550 --> 00:02:00,110
Because if it were equal to zero this

35
00:02:00,110 --> 00:02:02,090
would just be a linear function, bx plus
c.

36
00:02:05,990 --> 00:02:10,939
And suppose I'm interested in finding the
value or values

37
00:02:10,939 --> 00:02:15,331
of x that make my quadratic function equal
to zero.

38
00:02:15,331 --> 00:02:20,227
I think everybody remembers from high
school algebra the

39
00:02:20,227 --> 00:02:25,531
quadratic formula, so it's x is equal to
minus b plus or minus

40
00:02:25,531 --> 00:02:31,039
the square root of b squared minus 4 ac
all over 2 a, and that's

41
00:02:31,039 --> 00:02:33,997
going to give you the, the values of x

42
00:02:33,997 --> 00:02:38,180
that will make this function be equal to
zero.

43
00:02:38,180 --> 00:02:43,822
And the way we actually come up with this
formula is the same technique

44
00:02:43,822 --> 00:02:48,385
that we will use in integration for
completing the square.

45
00:02:48,385 --> 00:02:52,295
So suppose I want to solve my quadratic
function, I use

46
00:02:52,295 --> 00:02:56,205
this notation to say I'm setting it equal
to zero so its

47
00:02:56,205 --> 00:03:01,560
not defined to be equal to zero, its me
I'm choosing a certain level and now

48
00:03:01,560 --> 00:03:06,915
once I've done that these x's aren't
vairable anymore, they are sort of

49
00:03:06,915 --> 00:03:12,252
fixed numbers.
And I want to find out what they are.

50
00:03:12,252 --> 00:03:16,170
So the first thing I'm going to do is just
divide every term by a.

51
00:03:16,170 --> 00:03:18,640
So I multiply both sides of this by one
over a,

52
00:03:18,640 --> 00:03:21,630
and I'm allowed to do that because one of
my conditions

53
00:03:21,630 --> 00:03:24,690
on my quadratic function was the a is not
equal to zero.

54
00:03:24,690 --> 00:03:28,170
So as long as a is not equal to zero, I
can divide by a.

55
00:03:28,170 --> 00:03:31,730
And so I get this new form.
So it doesn't look too exciting yet.

56
00:03:33,290 --> 00:03:35,080
And then what I'm going to try and do.

57
00:03:35,080 --> 00:03:40,530
So this is sort of the, the meat and
potatoes of completing the square.

58
00:03:41,880 --> 00:03:47,090
I want to add zero to this.
But I want to choose a particularly

59
00:03:47,090 --> 00:03:54,325
smart choice of zero.
So I'm going to, first of all,

60
00:03:54,325 --> 00:04:01,060
write b over a as 2 times b over 2 a.
So, that should be still b over a.

61
00:04:01,060 --> 00:04:06,766
And then I want to add something here, and
I want to subtract something over here.

62
00:04:06,766 --> 00:04:11,130
And I want to choose the thing that I'm
going to add over here.

63
00:04:11,130 --> 00:04:12,306
So that the first

64
00:04:12,306 --> 00:04:17,290
three terms can be written as x plus
something squared.

65
00:04:17,290 --> 00:04:24,370
So lets just look really quickly at, what
I would want to have so that the

66
00:04:24,370 --> 00:04:31,820
something is going to be b over 2 a and so
if I look at x plus b over 2 a squared.

67
00:04:31,820 --> 00:04:34,250
Well on the first term.

68
00:04:34,250 --> 00:04:37,385
So I I use a trick to remind myself called
foil, which is first,

69
00:04:37,385 --> 00:04:39,250
outer, inner, last.

70
00:04:39,250 --> 00:04:44,030
So the first two terms are going to be x
times x, which gives me x squared.

71
00:04:44,030 --> 00:04:47,620
And then I'm going to have outer, so x
times b over 2 a.

72
00:04:47,620 --> 00:04:52,440
And then inner, b over 2 a times x so
that's why I get two of these guys.

73
00:04:52,440 --> 00:04:55,280
And then last will just be the last term
squared.

74
00:04:57,730 --> 00:05:00,990
So this is what I'm going to choose for my
blank here.

75
00:05:00,990 --> 00:05:04,656
And so my intelligent value of 0 is going
to be b

76
00:05:04,656 --> 00:05:09,390
squared over 4 a squared minus b squared
over 4 a squared.

77
00:05:09,390 --> 00:05:12,700
So I'm going to, oops, stick that into
these blanks here.

78
00:05:18,040 --> 00:05:22,360
And now these first three terms that I
have here, I can

79
00:05:22,360 --> 00:05:27,250
replace that by x plus b over two a, that
quantity squared.

80
00:05:31,870 --> 00:05:34,558
And I've done two things in this line, so
I'm also going to

81
00:05:34,558 --> 00:05:37,499
move these last two terms to the other
side of the equals sign.

82
00:05:46,360 --> 00:05:48,430
Oh, and, what, I must have done a little
bit more here.

83
00:05:48,430 --> 00:05:53,578
Okay, I also multiplied the c over a by 4
a over

84
00:05:53,578 --> 00:05:58,594
4 a so that's where this 4, oops 4 a c
over a

85
00:05:58,594 --> 00:06:03,650
squared comes from what, what did I do.

86
00:06:07,260 --> 00:06:07,760
Think.

87
00:06:10,570 --> 00:06:15,080
And so then I'm going to take the square
root of both sides, so I get x

88
00:06:15,080 --> 00:06:19,590
plus b over 2 a is equal to and, we're
going to end up with two

89
00:06:19,590 --> 00:06:23,444
solutions now because, providing that this
value here

90
00:06:23,444 --> 00:06:25,986
is greater than zero I'm going to end

91
00:06:25,986 --> 00:06:28,528
up with a positive value of the square

92
00:06:28,528 --> 00:06:31,660
root and a negative value of the square
root.

93
00:06:35,090 --> 00:06:38,782
And then the rest of it is just isolating
the x and making it look

94
00:06:38,782 --> 00:06:42,800
pretty so I'll just move the b over two a
to the other side and then.

95
00:06:44,620 --> 00:06:47,740
A square root of a fraction, I can think
of that as a square root

96
00:06:47,740 --> 00:06:50,980
of the top divided by the square root of
the bottom so I'll just go

97
00:06:50,980 --> 00:06:54,520
ahead and do the square root of the bottom
because 4 a squared has a

98
00:06:54,520 --> 00:06:56,440
nice square root and it also happens to

99
00:06:56,440 --> 00:06:59,860
be the same denominator as a half-up
frontier.

100
00:06:59,860 --> 00:07:05,906
And so that gives me the Quadratic
Formula, so X is equal

101
00:07:05,906 --> 00:07:10,760
to minus b plus or minus the square root
of b squared minus 4 a c all over 2 a.

102
00:07:14,220 --> 00:07:17,650
So now let's look at I've sort of taken
the important

103
00:07:17,650 --> 00:07:21,842
part out of the integral you're going to
have to, to solve.

104
00:07:21,842 --> 00:07:24,254
In 461 when I ask you to find the expected

105
00:07:24,254 --> 00:07:27,478
value and the variance of a log normal
random variable.

106
00:07:27,478 --> 00:07:33,394
So, I want to compute the integral from
zero to infinity of e to the, so

107
00:07:33,394 --> 00:07:39,616
it's a minus fraction here, and then I
have log of y minus Mu, that whole

108
00:07:39,616 --> 00:07:43,800
quantity squared Divided by two sigma
squared.

109
00:07:45,110 --> 00:07:48,580
And here, mu and sigma are going to be
real valued constants.

110
00:07:49,682 --> 00:07:51,190
you can think of them as just the

111
00:07:51,190 --> 00:07:54,460
mean and the standard deviation of a
statistical distribution.

112
00:07:57,150 --> 00:08:03,130
So, I'm going to use my integration by
substitution trick from, from last time.

113
00:08:04,730 --> 00:08:07,538
And this thing, the log of y minus mu,
that

114
00:08:07,538 --> 00:08:12,790
looks like something I wouldn't be
particularly happy to have.

115
00:08:12,790 --> 00:08:17,530
So I'd like to get rid of that and just
replace it by a single value u.

116
00:08:23,070 --> 00:08:26,710
So if I do that then I can solve for y in
terms

117
00:08:26,710 --> 00:08:30,290
of u, and I get e to the u times e to the
mu.

118
00:08:34,560 --> 00:08:40,034
And then if I take the derivative of y, I
just end up with

119
00:08:40,034 --> 00:08:45,389
y du, which is, I'll put that as my value
of y, but in

120
00:08:45,389 --> 00:08:50,860
this particular case it's going to cancel
out nicely.

121
00:08:58,460 --> 00:09:00,180
So now I make my substitution.

122
00:09:01,220 --> 00:09:02,872
So lat time I told you for definite

123
00:09:02,872 --> 00:09:05,390
integrals, I can also change the limits
here.

124
00:09:05,390 --> 00:09:07,997
So this is going to be a case where
probably

125
00:09:07,997 --> 00:09:10,950
be nicer if you the limits just into u.

126
00:09:10,950 --> 00:09:14,037
Rather than remember that this is u equals
something, and

127
00:09:14,037 --> 00:09:16,120
then try and switch back to y at the end.

128
00:09:17,370 --> 00:09:19,260
And so it turns out if the mu doesn't

129
00:09:19,260 --> 00:09:22,330
really matter, since I'm going from zero
to infinity.

130
00:09:23,476 --> 00:09:28,720
if I, if I have log of zero, that's
going to be minus infinity.

131
00:09:28,720 --> 00:09:32,620
And if I have log of infinity, that's
going to be plus infinity.

132
00:09:32,620 --> 00:09:35,600
So the limits on u are going to be minus
infinity to infinity.

133
00:09:35,600 --> 00:09:38,960
And then I go ahead and substitute in
everything

134
00:09:38,960 --> 00:09:43,310
that I worked out in the, the, second
bullet-point here.

135
00:09:45,750 --> 00:09:46,940
And then replace

136
00:09:50,410 --> 00:09:52,066
My y by e to the u e to the Mu and

137
00:09:52,066 --> 00:09:56,098
now one of the, the nice things that's
going to happen remember Mu is

138
00:09:56,098 --> 00:09:59,698
a constant so I can, that's just scaling
my integral so one

139
00:09:59,698 --> 00:10:04,060
of my properties allows me to pull that
outside of the integral sign.

140
00:10:07,850 --> 00:10:13,746
And so now I end up with e to the Mu, e to
the Mu integral

141
00:10:13,746 --> 00:10:19,240
and I have e to some power of u times e to
the u.

142
00:10:19,240 --> 00:10:21,160
So really whats going to end up happening
here.

143
00:10:22,260 --> 00:10:26,079
If I have e to a power times e to a power
I

144
00:10:26,079 --> 00:10:29,330
can also think of that as e to the sum of
those two powers.

145
00:10:32,580 --> 00:10:35,810
So, I'm going to pause for a second and
say take a look at the intergrand.

146
00:10:35,810 --> 00:10:37,460
So, inter-grand is just this thing.

147
00:10:37,460 --> 00:10:45,297
It's the function that I'm integrating.

148
00:10:45,297 --> 00:10:51,407
And so if I give them both a common
denominator then I can go ahead and do the

149
00:10:51,407 --> 00:10:55,073
sum and now I'm starting to see something
sort

150
00:10:55,073 --> 00:10:57,987
of like what I had, when I was looking

151
00:10:57,987 --> 00:11:03,063
at the completing the square when i was,
so the same problem that

152
00:11:03,063 --> 00:11:08,212
I needed the solve when I wanted to solve
a quadratic equation.

153
00:11:08,212 --> 00:11:13,732
And so here, it turns out that the,

154
00:11:13,732 --> 00:11:18,516
the intelligent value to add is

155
00:11:18,516 --> 00:11:23,484
sigma to the fourth and then I can

156
00:11:23,484 --> 00:11:28,918
write this in this form here.
And

157
00:11:28,918 --> 00:11:34,750
this thing here is just going

158
00:11:34,750 --> 00:11:40,585
to be u minus sigma squared.

159
00:11:40,585 --> 00:11:44,550
So I have u minus.
Sorry, not e minus sigma squared.

160
00:11:44,550 --> 00:11:47,060
I have to say that twice.
So it's u minus sigma squared.

161
00:11:48,190 --> 00:11:48,582
And that

162
00:11:48,582 --> 00:11:51,158
whole quantity is squared as well so that
if you, if you

163
00:11:51,158 --> 00:11:54,800
expanded this out you just get the thing
that's in parentheses here.

164
00:11:59,290 --> 00:12:04,815
And so now I have, so here when I had Two

165
00:12:04,815 --> 00:12:08,715
functions raise to an exponent multiplied
together so e to one

166
00:12:08,715 --> 00:12:11,565
power times e to another power I was able
to add

167
00:12:11,565 --> 00:12:16,530
those powers together and just write it as
a single exponential.

168
00:12:16,530 --> 00:12:18,660
And now I'm just going to do the same
thing but backwards.

169
00:12:19,730 --> 00:12:24,460
So I'm integrating with respect to you.
So that means this Sigma

170
00:12:24,460 --> 00:12:28,945
to the fourth over two sigma squared,
that's just going to be a constant number.

171
00:12:28,945 --> 00:12:35,749
So I'm going to rewrite this as e to the
minus quantity u minus sigma squared,

172
00:12:35,749 --> 00:12:43,200
squared divided by two sigma squared times
e to the sigma squared over two.

173
00:12:43,200 --> 00:12:45,267
But now this is just another number that I
could

174
00:12:45,267 --> 00:12:47,460
bring outside of my integral sign if I
wanted to.

175
00:12:50,610 --> 00:12:56,210
So let's go back now that, now that I have
this little intermediate result.

176
00:12:56,210 --> 00:12:58,440
And look at the function I'm trying to
integrate again.

177
00:13:00,840 --> 00:13:06,073
So I can replace the inter-grand now with

178
00:13:06,073 --> 00:13:11,050
this function that I've this
transformation of it that I've, so all

179
00:13:11,050 --> 00:13:15,930
I've done is taken what used to be there
and replaced it with this value.

180
00:13:17,510 --> 00:13:21,210
And now I can also bring this, this part
of the product out in

181
00:13:21,210 --> 00:13:26,020
front of the integral sign because it, it
doesn't depend on you any more as,

182
00:13:26,020 --> 00:13:28,314
as far as I'm concerned its just a, a

183
00:13:28,314 --> 00:13:31,290
scalar quantity so I can write it like
this.

184
00:13:31,290 --> 00:13:35,890
So now I have e to the Mu times sigma
squared over 2.

185
00:13:35,890 --> 00:13:38,390
Integral from minus infinity to infinity.

186
00:13:40,850 --> 00:13:43,880
And then, sooner or later, you're going to
learn to recognize this form.

187
00:13:43,880 --> 00:13:46,730
Here, I just had to make a hint.

188
00:13:46,730 --> 00:13:49,910
Sort of one of the problems with
mathematics, it's all sort of intertwined.

189
00:13:49,910 --> 00:13:52,440
So when you try to put it in order, so
that I can give them

190
00:13:52,440 --> 00:13:54,695
in sequential lectures, eventually you
want to

191
00:13:54,695 --> 00:13:57,860
use something that you haven't talked
about yet.

192
00:13:57,860 --> 00:13:59,940
And so I stuck that in a little gray box
here.

193
00:14:01,720 --> 00:14:05,861
But it turns out that this integral, so if
I have e

194
00:14:05,861 --> 00:14:11,850
to the u minus something, so it doesn't
matter what number is there.

195
00:14:11,850 --> 00:14:15,036
In this particular case it happens to be
sigma squared, which is

196
00:14:15,036 --> 00:14:18,870
the same value down here, but that's just
because I was lucky.

197
00:14:18,870 --> 00:14:21,536
So if I have e to the minus, and then my

198
00:14:21,536 --> 00:14:28,650
variable u minus something, that quantity
squared, divided by two sigma squared.

199
00:14:28,650 --> 00:14:31,770
This is something called the normal
density function.

200
00:14:32,954 --> 00:14:36,149
if I integrate that from minus infinity to
infinity,

201
00:14:36,149 --> 00:14:39,010
we get the square root of two pi sigma.

202
00:14:39,010 --> 00:14:41,386
And then so this is something in, in
fourth week,

203
00:14:41,386 --> 00:14:44,580
we'll, we'll talk about how to actually
evaluate this integral.

204
00:14:46,530 --> 00:14:50,534
But if I look back up here that's exactly
the integral I have on

205
00:14:50,534 --> 00:14:54,570
the right hand side so I can just replace
that with 2 pi sigma.

206
00:14:57,200 --> 00:15:02,279
So I end up with 2 pi sigma e to the u
plus sigma squared over 2.

207
00:15:04,010 --> 00:15:07,628
So, that probably doesn't seem like the
most useful example, until you get to

208
00:15:07,628 --> 00:15:11,270
the homework in 461, where you have to do
this again for the first time.

209
00:15:11,270 --> 00:15:13,760
And then I think you'll find these two
slides very, very useful.

