[music] What do we get if we add up a bunch of perfect squares? Say, the first k perfect squares. What I'm asking for is a formula for this sum. The sum of n squared as n goes from 1 to k, right? So 1 squared, plus 2 squared, plus 3 squared, plus dot, dot, dot, right? And so on, until I get to k squared. What do I get if I add up the first k? Perfect squares. Quite shockingly, the resulting formula ends up looking really nice. This ends up being equal to k times k plus 1 times 2 k plus 1 All over 6. Really? Well, we can try it for some specific value. All right. What if I do the sum and go from 1 to 4 of N squared. That's 1 squared plus 2 squared plus 3 squared plus 4 squared. That's 1 plus 4 plus 9 plus 16. 4 and 16 make 20. 1 and 9 make 10. 20 plus 10 is 30. So the sum of the first four perfect squares is 30. Is that really what this formula's giving? Well let's check it out. So I'm going to put in 4 for K, 4 times 4 plus 1. Times 2 times 4 plus1 all over 6. What's that? Well that's 4 times 5 times 2 times 4 plus 1 is 9 divided by 6. 6 is 2 times 3, so the 2 kills part of the 4 and part of the 9 to give me 2 times 5 times 3. And yeah, I mean, 5 times 3 is 15, twice 15 is 30. It really works, at least for the value 4. Of course, this isn't a proof in general. So how am I going to verify that, that statement is true? Well, one argument is a geometric argument, really a proof by picture. So here's a geometric or a diagrammatic way of writing down 1 squared plus 2 squared plus 3 squared plus 4 squared. Now I know there's 30 dots here, right. But I'm trying to draw a diagram that suggests a general pattern. Ok. So let's try to add up. These, these four numbers. I'm going to use this device here. What is this? Well, what I've done here is I've taken 3 copies of these k squares, alright. So here's 1 square plus 2 square plus 3 squares plus 4 squares. Here's another 1 squared plus 2 squared plus 3 squared plus 4 squared, and in the middle I sort of mixed it up a little bit. I've taken the lower lefthand corner dot, which is red, and I've lined them up vertically here. I've taken the next, sort of three long L shape which I've drawn in blue here, and I've straightened them out and placed those three here. I've taken the two five long orange L's and straightened them out here, and then here at the top I've got one long brown L comprised of seven dots, and I've straightened that out right here at the top. So what's happened here? Right, I have taken three copies of my sums of squares, right so I've got three copies of all these squares. One set is down here, one sets down here, and the other set is mixed in the middle. And now I can figure out how big a rectangle this is . Well the bottom here this is a k by k square, k by k square and these are built out of the corners that are just 1 dot. So there's a whole bottom side is made up of 2 K plus 1 dots, k plus 1 plus k or 2 k plus 1. What about along the other side? Well along the other side, I've got one dot plus two dots plus three dots plus four dots and of course, this is just a specific picture. So in general, it will be 1 plus 2 plus 3 plus 4 until I get to k. So I have to figure out how tall this rectangle is, but I in fact know a formula for 1 plus 2 plus 3 plus 4 up through k, alright. We figured that out already. It's k times k plus 1 over 2. So I've taken three copies and built them into a rectangle who's base is 2k plus 1, and which is k times k plus 1 over 2 tall. So that means that this sum, which is what I'm trying to compute, must be. Well its the, the height of this rectangle times the width of this rectangle divided by 3, since I used three copies of, of these squares to build the big rectangle. So I ended up dividing by 3. And this is in fact the formula that we had, right? The original formula was K times K times 2 K plus 1 times 2 K plus 1 all over 6. But that's just a rearranged version of this formula. There are other geometric arguments as well. Other proofs by picture that you could give. And there are other geometric arguments too. Here's another way to get at this sum of squares formula. I could right down my sum of squares as something built out of little tiny cubelets. Right? Here I've got one cube. Underneath I've got 2 squared cubes right, but this is a 2 by 2 by 1 block. Underneath I've got nine little cubes, right. It's a 3 by 3 by 1 block. And underneath that I've got 16 cubes, a 4 by 4 by 1 block, right. And I can imagine that this thing is k high. I take six copies of this pyramid. You know, fit them together. Flip one over and so forth. Until I end up with a K by K plus 1 by 2K plus 1 box. Right? And that box must be comprise of K times K plus 1 times 2K plus 1 little tiny cubes. And since I used six copies of this thing. Well that means the number of cubes in this thing. Which is the sum of 1 squared plus 2 squared plus until I get to k squared. Right? That sum must be k times k plus 1 time 2k plus 1 divided by 6. And here, we've given geometric arguments for this particular sum. But in the future we're also going to see some algebraic arguments. Right? But we're going to wait on those a little bit. For the time being, this particular quality will be very helpful when we start doing some calculations of, Riemann sum.