I'm going to challenge you Brady, do you remember some calculus from school days?
- (Brady: No I don't.) Good, okay. I- I think a lot
of Numberphile viewers will remember calculus - don't you? Good, yeah you remember calculus. But
I want to show you a calculus question and even if, Brady, you're not familiar enough I think
you'll be interested by the conclusion of it. Let's find out. We're going to do some integration
and we're going to integrate a familiar function; we've talked about trigonometry before,
but this time it's not just the integral of sin(x) it's the integral of sin (x)
multiplied by cosine(x) dx and that's with respect to x so it's just saying I'm using x
variables. And I'm using an indifferent integral for the sake of whether or not you remember this
stuff - I'm not putting limits in, we'll talk more about what difference that makes at the end.
That's the question, it's an absolutely standard looking question from sort of A level exam sort of
difficulty. If any viewers want to try it before I talk more about it I think now is a good time.
In what's becoming a theme for me I want to do this in more than one way;
because if you do things in more than one way you should find that the answers tally up and
then you have more confidence in the answers and you might get insights as I've maybe talked about
in other places. But let's do method 1 to start. Method 1 for me here is using a trigonometric fact
which is the idea that sin of double of an angle - this is just the sin function with two of a
thing - there's this identity to say it's the same as two lots of sin(x)cos(x). And trigonometric
identities let you transform trigonometry into other types of trigonometry. And this
one is obviously useful in our case, we've got sin(x)cos(x) on one side so we can turn it into
something else. If I just write this a half sin(2x) then I've got exactly what I had in my integration
earlier. Very quickly I'm going to get sloppy in my notation and stop writing these brackets - I
hope you don't get offended. - (I'm cool with it) - I'm glad. Okay so my integration can turn into this
so I'm actually going to label this as I so I can always refer- that's my original question. If I get
I equals a number or a expression I'm done. So I equals the integral; changing that for this is a
half sin(2x). And I'm sure some viewers will have tried this method: I could take the half out the
front and this is the bit that maybe you remember but I can integrate sin(x) - the integral of sin is
negative cos or negative cosine. But I've got to do a couple of things, I've got the 2x here and
this is where you have to sort of think about the chain rule. It's going to be something to do with
cosine 2x with a negative sign, but if I differentiate that which is the inverse
process you end up with a 2, so I need a half. That is not an integration sign anymore, those
square brackets mean I've done the integration. So tidying this up I'm going to write negative
a quarter cosine(2x). And before anyone shouts at me all A level students will remember to add
a + C because when you integrate you have a constant coming up - more on that later. That's
method 1 and there's not a lot of insight, that feels like it's just the answer to the question.
The punchline comes when we try another method. Method 2: there's a neat method for this one, you
can realize that uh sin and cosine differentiate to each other which is kind of the inverse of what
we're doing but if you spot a situation where you've got two a product or two things and one
of them is the differential of the other there's a neat shortcut, so that's what I'm going to exploit
in this one. I'm going to notice that if I rewrote this as the integral of sin(x) times cosine(x) to
the power 1 - which feels completely pointless, I mean you know that's the same thing, but a lot
of A level students will get used to the fact that if you've got a bracket with any power up
here and you've got the differential of what's inside on the outside there's a neat shortcut. So
you can try an integration by just integrating this bracket and raising the power by 1, which
would mean writing cosine(x) squared - I'm going to write y equals here. And I can check whether
this is what- I've written the word try, I don't think that's the answer, but if I differentiate
that it should go back to where we started so that's a way of sort of naively integrating
things, you you try and answer and check if it differentiates back. So if you differentiate
this one, the 2 comes down the front and you get cosine(x) to the one and then you've got
to do the chain rule, multiply the differential of the insides so I multiply that by negative sin(x). Tidying
that up you get negative 2 sin(x)cos(x) which I invite you to compare with our original thing;
it's pretty close, it's just a negative 2 out. So actually If I multiply this by negative a half
that will track through and compensate. So all of that- so I'm pretty sure that that is the integral,
let me write I equals negative a half cosine(x) squared + C. First observation - how's your memory?
(It's different) - It's different. So which one's correct? Well we're not done yet, before we
answer which one's correct I want to show you at least one more method if that's ok? Third one is very similar,
I'm going to do it much quicker, it's almost the mirror of the second one. So let's just separate
them but it's going to be very close, the idea being that sin and cosine differentiate to each
other so I picked cosine to try for this one knowing that the chain rule thing I did here
would give me close to what I want. I can do the other way around, so I could try y equals sin(x)
squared. And if I differentiate that you get 2 sin(x) to the power 1 and then multiply by the
differential of what's inside, which is cosine(x). This is even neater, so this is just 2 sin(x)cos(x)
which is very like what I wanted, it's just got a factor of 2 out. So that means if I put a half
here it would have worked exactly. So that means the integral is a half sin(x) squared + C.
Which is different. I'm making a big sigh out of this because I think you've got the point
by now, is that these methods are all valid, I've checked them, but they do seem to be
giving me different answers which we will need to resolve because there should be one answer.
Let's do one more before we resolve it. - (Can't those answers be the same?) - You tell me - (I don't know, maybe)
(they're the same thing.) - Is sin(x) the same as cosine(x)? - (Well I'd imagine not; but I don't)
(know what C is and there's halves and that minuses and-) - It's a pleasure working with you
Brady, you are asking the right questions about the right things. And let's answer them in good time.
Method 4 - this is my favourite one, I like this one. Let's set up the question again
just in case everyone's forgotten. This time we've got sin(x) times cos (x), it's a it's
a product multiplication, but there's a rule in integration called integration by parts which
quite often deals with products. So integration by parts, just to remind everyone, the integral
of a thing which is something times something else you can rewrite. If you think of the product
as something that's been differentiated and something that hasn't then you can rewrite
it as an integral of uv subtract the integral of du/dx v. That's non-trivial formula and it's
not obvious why that works but the point is that you can take an integration of two things
uh which are difficult and turn into something which doesn't need integrating and something
which is kind of the other way around. So the thing that was differentiated is now integrated and the
thing was not differentiated is now differentiated. And if you can arrange for that to make your life
simpler this is a good way through an integration question. And that was your lesson of integration
by parts over, we're going to use it. I'm going to call this one u and this one dv/dx - so that's
sort of matching up with this idea here. Which means I have to get the other versions of it, so
u equals sin(x) and then differentiating that gives me cosine(x). dv/dx equals cosine(x) and
integrating that would be v equals integral of cos is sin(x). So this is my little table, I can use all
these things over here. So I becomes uv - that's sin times sin so sin(x) times sin(x) is sin squared (x).
I'm now using some notation which everybody uses by the way; before I was writing uh sin(x)
in brackets squared, which no one argues with but no one writes. This is terrible notation but I'm
going to deal with it and if you want to talk to me about why it's terrible notation write polite
emails to me. Only polite ones! It confuses with function notation- anyway that's the uv bit and
then subtract, following this formula, the integral of du that's a cosine(x) times v which is sin(x).
Now does this look familiar Brady? - (That's what- that's I again isn't it?) - Yeah, it's just written the other
way around but multiplication could happen either way around. So it feels like we've
gone in circles and we're like, well we haven't made anything easier, I still don't know how to
integrate that, except if I write it as I I've got a formula here that I equals sin squared x minus I.
And they don't cancel out; if I add I to both sides I get 2I equals sin squared x
and I equals half sin squared x. But I did forget a + C that should have happened up here somewhere.
Half sin squared x? This was method 4. And I like it because the integration
by parts feels like a magic formula but you get this neat cancellation.
The trouble is it's not the same as the other answers so: it's the same as that one,
and there's my notation issue, that's what that means. It's not the same as that one,
and it's not the same as that one and- - (Majority rules? Go with-) - So so only one can be right,
correct, although you did ask about astute question earlier, do you remember what you asked?
(We don't know the value of C.) - Yeah so C is a consonant and when you're doing an indefinite integration you have
to leave it as an unknown constant, unless you put limits on it which means you're calculating an
area you don't know what that constant is. But these answers do look different. So by way of reconciling
them let's sort out whether majority should rule and only one of them is correct or if there's
something else going on - and it's probably time we get GeoGebra out to have a look at these functions
if that's okay? - (All right) - So- I mean let's look at the original function we're trying to integrate
but first of all: sin(x) times cosine(x) looks like that. Actually looks like a sin wave, that's
not a coincidence, in fact the first method we did turned it into sin of 2x - it's a sin wave
with twice the speed. Doesn't really matter what it looks like although you should draw functions if
you're going to integrate them I think. The first answer we got I'm going to flip back to Method 1,
negative a quarter cos 2x, I'm going to plot that on the screen. I'm actually going to hide
the original function. Negative a quarter times cosine of 2x. That is what the answer should look
like apparently, according to method 1. Method 2 got us negative a half cos squared x, let's plot that
one. If they're the same answer they should be the same function right? So negative a half cos
x and I'm going to put that in Brackets and square it - because notation gets confusing, we've already
been through this. What's nice is it looks the same pattern but it's not the same function, it's
shifted. Let's do the other one which - to cut a long story short - a half sin(x) squared.
(I think I know what's going to happen here.) - You think you know what's going to happen? I think most people
know what's going to happen and they're kicking themselves if they didn't get it immediately
because integration- oh look it's the same function but shifted. And the last one actually got us the
same answer. So the point is these are not the same answers. And if you forgot to write
+ C at the end; and + C at the end and + C at the end on all of them they would be different
functions but that + C means, if you add a constant on the end of a function, what happens?
It just shifts up or down. Really salutory lesson, when you're doing integration don't forget the
+ C because you will be wrong. These answers are not the same unless you take into account they're the
same barring a shift up or down. - (So they were kind of the same.) - They are kind of the same, and that's- the reason
I like this is that the the same question which is relatively easy for A level standard things
does turn out to what- have- what looks like three different answers and reminds you that they would
be different if you forget the + C. And if you ask a computer to integrate this computers can do
it - I'll show you what happens. You feel like it it can't plump for all three at once, it's got to pick
one. Luckily GeoGebra will do some integration so integral- integral of sin(x)cosine(x)
it's actually given me this last one here, half sin squared x. So it's plump for the
last one, the majority rule in fact, the one we got twice, but something else has happened. And
this is really subtle and I'm really glad that GeoGebra does this: it's also made this little C bit
at the bottom and it's hidden it, that blue thing means it's not visible. But if I uh
make it visible it means it's made a little slider up here and saying, it doesn't know what
C1 is, because if you change it the graph shifts up and down. So built into this piece of software
is the saying, if you ask for an integral that's indefinite it can only give you an answer up to
a constant. And what's a relief is if you do the maths on this you get three looking different
answers but they are the same as long as you're add the + C. - (Which technique would a school student)
(have used do you think?) - I think the- what they call the double angle formula which is the first
one we did, turning sin(x)cos(x) into sin of 2x is the best recommendation I'd give to
an a-level student that's a 18 year old because it's neat um and it's a good lesson knowing trig
identity because they help you turn complicated things into simpler things you can work with.
Having said that I really like the integration by parts thing because it's that nice sepa-
self-referential thing; you think you're not making any progress and then it all drops out.
And the other method is good too, because uh it's not obvious but when you actually do that method
it's quite quick. So I've dodged your question I think haven't I? - (The thing I take away from this)
(is C really covers your butt doesn't it?) - Yeah. And maybe the important- understanding what you're
doing when integrating, if you don't have limits on integration you're finding an area under a
function without telling anybody where you're going to start counting area from. So it's like
drawing- colouring in under these graphs but you're not saying where's the start point. It
could be the origin, it could be somewhere else, and that's why when you do an indefinite integration
you are generating AN area function not THE area function because there is more than one and it's
only different by a C. There you go, that was your A level integration lesson Brady. We've
pretty much covered all available techniques of integration in that so uh exam next week. - (I'm ready)
I seem to recall I was pretty good at calculus in high school, but now I remember
absolutely nothing, it's like a foreign language to me. If you'd like to refresh your memory or learn
from scratch well there's nowhere better than today's episode sponsor, Brilliant. Rather than just
watching or reading, you interact with these online courses and lessons. The absolute best way to get
something wired into your brain or rewired into your brain is using stuff like this. I love all
these sliders and gizmos, gives me a better feel for what I'm doing. So whatever your age or skill
set Brilliant is going to have something for you. And by the way you can get 20% off their premium
subscription by going to brilliant.org/numberphile. Check them out, maybe like me you can recapture
some long lost knowledge. There will be a link in the video description.
...definitely do the number 20...
Could we for example work our way up? Can do 1? Can we do 2? Turns out 2 is really easy.
You can see these two triangles makes 1.