[MUSIC]. We've already seen how difficult it is to integrate powers of sin. For example, what's the inner goal from 0 to power of a 2 of sin the 32nd power. Well it turns out that it's, what is this, 300540195 divided by 4294967296 times pi. But how would I ever that. That looks so random and yet there's more going on here. In fact, this ends up being 3 times 3 times 5 times 17 times 19 times 23 times 29 times 31 all over 2 to the 32nd power. What? All those numbers suggest something's going on here that could hardly be an accident. The goal of computing, the goal of numbers, the goal of everything that we're doing in this course isn't just answers. It's insight. So how can we gain some insight into why that integral works out like that. Specifically our question is why does it factor, so nicely? Right I mean there's no reason at least at this point for it to work out so nicely so why does it factor so nicely? Well to gain some insight into this lets use parts to examine the relationship between the integral of sin to the nth power and sin to the n minus second power. Well, let me write that down. To answer this question, of why it factors is what I want to do is figure out some sort of relationship. Between the interval from 0 to pi over 2 of sin to the nth power and the interval from 0 to pi over 2 to the n minus second power. We'll use parts. So lets start with this and I gotta pick a u and a dv. So I'll have a u be a sin to the n minus 1 and dv, which would be the rest of this, will just be sine x dx, so udv gives me this integrand. Now if that's u and that's dv, I gotta figure out what d, u, and v are supposed to be. Well, if dv is sin of x, then an antiderivative for that is minus cosine x and, if u is sin to the n minus 1, then du, we've gotta differentiate this, that'll be the chain rule. n minus 1 times sin to the n minus 2. And then times the derivative of this. What's the derivative of the inside? The derivative of sin is cosine, and then dx. Now we get a formular for parts. So this integral is u v. So sin, to the n minus 1, times cosine with a minus sin, evaluated at pi over 2 and 0. Minus the interval from 0 to pi over 2 of v du, which is well here's n minus 1 sin to the n minus 2 cosine squared dx and I've got a minus sin there on the v so I'll make that plus. Alright, now when I plug in pi over 2 that kills the cosine terms, and when I plug in 0, that kills the, the sin term. So this thing here is just 0, and that means this original integral is just the integral from 0 to pi over 2 of n minus 1 times sin to the n minus 2 x. And instead of, cosine square, there I'll right that as 1 minus sin squared x d x. Now I can expand this out. This is, really the difference between two integrals after I expand. It's n minus 1 times the integral from 0 to pi over 2 of sin to the n minus 2 x, then minus n minus 1 times the integral from 0 to pi over 2 of sin to the n minus 2 times sine squared. Is just sin to the nth power dx. And we can solve this. So, this is what I've got at this point. I've that the integral from 0 to pi over 2 of sin to the n x dx is equal to this, after I did parts. But now, I can add n minus 1 times the interval from 0 to pi over 2 sin to the nx dx to both sides. And what do I get, well I'll get n times the integral from 0 to pi over 2 sin to the n x dx is equal to. And on the other side I'll have n minus 1 the integral from 0 to pi over 2 sin to the n minus 2 xdx. And I can divide both sides by n. And if I divide both sides by n, alright, I find that the integral from 0 to pi over 2 of sin to the n xdx is n minus 1 over n times the integral from 0 to pi over 2 of sin to the n minus 2 xdx. So this formula is telling me how to compute the integral of sine to the nth power in terms of the integral of sin to the n minus second power. So I get started by knowing that the integral from 0 to to pi over 2 of sin to the 0 power of x dx. That's just the integral of 1 from 0 to pi over 2. Well that's just pi over 2. So, what's the integral of sine squared on the interval 0 to pi over 2. Well, using this formula, when n equals 2, I find that the integral from 0 to pi over 2 of sin squared x dx. This is when n equals 2, is 2 minus 1. Over 2, that's n minus 1 over n times the integral from 0 to pi over 2 of sin to the zeroth power. But I know what sin to the zeroth power is, it's just pi over 2. So this is 1 half 2 minus 1 over 2 times this which is pi over 2 which pi over 4. So the integral from 0 to power over 2 sin squared x is just pi over 4. What's the integral of sine to the fourth? Well, let's use this formula when n equals 4 so the integral from 0 to pi over 2 signed to the fourth x dx. That'll be 4 minus 1 over 4 times the integral from 0 to pi over 2 of sin squared xdx, and we just figured out what the integral of sin squared is right. This is 3 4th times pi over 4. What's the integral of sin to the 6th? So, that means I should look at this formula when n equals 6. So, the integral from 0 to pi over 2 of sin to the 6th x dx is, well if I put in n equals 6, I get 6 minus 1 over 6 times the integral from 0 to pi over 2 of sin to the 4th x dx, but I just figured that one out. So, this is 5 6th times, well here's the integral of sin to the 4th, times 3 4th times pi over 4. What's the integral of sin to the 8th? Well, that means I should use this formula when n equals 8. So, the integral from 0 to pi over 2 of sin to the 8th dx is, according to this when n equals 8, that's 8 minus 1 over 8 times the integral from 0 to pi over 2 of sin to the 6th x dx. And we just figured out sin to the 6th. This is 8 minus 1 over 8. That's 7 over 8 times the integral of sin to the 6th. Which is 5 6th times 3 4ths times pi over 4. Okay, okay, we're seeing a pattern. What's the integral of sin to the 32nd power? So, the integral from 0 to pi over 2 of sin to the 32nd power. Just following this pattern will be 31 over 32 times 29 over 30 times 27 over 28, and I'm going to keep on going until I get down to 5 over 6 times 3 over 4 and then finally times pi over 4. Now we can cancel like crazy. So this 3 and this 6 give me a 2. This 5 and this 10 give me a 2. This 7 and the 14 give me a 2. The 9 and the 18 gives me a 2. The 11 and the 22 gives me a 2. The 13 and the 26 gives me a 2. The 15 and the 30 gives me a 2. The 17 survives, all right. Let's see what else I can cancel. the 19 is going to survive. The 21, however, well the 21 is going to be killed by a 7 somewhere. I can find a 7 in in the 28, so this gives me a 4 and this 21 gives me a 3 leftover can I kill that 3 somehow? Yeah, that 3 can be killed by this 12 giving me 4 left over. So this is entirely gone now. the 23 is going to survive. What about the 25? Do I have any 5's? Well, we've got a 5 in this 20, that gives me a 4, and then I've got a 5 here which will end up surviving. I've got a 27 here. Do I have any 3's down here? Well I've got a 3 in this 24. I can make this this 24 into an 8, if I convert this 27 into a 9. the 29 is going to survive and the 31 is is going to survive. So in the numerator, what all do I have? Well, the numerator, I've got a 31, a 29. A 9, a 5, a 23, a 19, and a 17, and way over here, a pi. And in the denominator I've got a whole bunch of of 2's, right? How many 2's do I have? Well I've got 2 to what power? I've got five 2's there, another 2 here, two more 2's, a 2, three more 2's, another 2, two more 2's, another 2, four more 2's, one more 2, two more 2's, one more 2, three more 2's, one more two, and then here, another four 2's. And that's going to figure what are all of these number that I get when I add these things up and 5 plus 1 plus 2 plus 1 plus 3 plus 1 plus 2 plus 1 plus 4 plus 1 plus 2 plus 1 plus 3 plus 1 plus 4. That's 32 two's in the denominator. This was a triumph. I'm making a note here huge success.