If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Algebra (all content)

### Course: Algebra (all content)>Unit 18

Lesson 11: Sum of n squares

# Sum of n squares (part 2)

What is the sum of the first n squares, 1 + 4 + 9 + 16 + ... + n²? In this video we find one possible formula for this sum. Created by Sal Khan.

## Want to join the conversation?

• How do you know that if the difference of the differences is constant, that you have a 3rd order polynomial? • I think that it has something to do with the derivative of a function and how f(x) changes when x is increased by 1.
For example when f(x) = m*x + b its first derivative is a constant and when you increase x by 1, f(x) increases by a constant (m).
An equation in the form f(x) = a*x^2 + b*x + c its second derivative (or the derivative of its derivative) is a constant.
So, if you have an equation where its third derivative is a constant or as x increases by 1 f(x) increases by a square then f(x) should be in the form a*x^3 + b*x^2 + c*x + d
• , Shouldn't it be the first n+1 squares since we're starting at 0 or do most people start at 1 so it's the first n squares? If the latter, why is Sal starting at 0? • Why can we assume that the formula is a cubic? Shouldn't it be verified by induction? • this maybe a silly question but why sum goes from 0 to n, and not from 1 to n? • Hey, when solving this system of equations, is it ok to use a matrix of 3 by 3 with all the coefficients of each equation and solving it in RREF form/ identity matrix of 3 by 3?

If so, which method would be an advantage of the other? • I think you mean what I'd call an augmented matrix:
1 1 1 1
8 4 2 5
27 9 3 14
Yes?
(sorry they aren't aligned nice and neat, haven't researched how to make it do ht in the comments)
You can do it that way. Sal appears to be covering it in a way for people who don't know/remember much Linear Algebra.

At two colleges I've attended sequences and series don't get covered until second semester of Calc. Linear Algebra required Calc I, but Calc II did not require Linear Algebra. It is possible they wouldn't recall from the dark days of High School algebra how to use a matrix to solve.

Personally I find the augmented matrix better since it solves for all three values at the same time. Both work, so which is better is somewhat subjective.
• Trying to come up with an equations where all possible permutations/combinations of numbers 1 through 10 that add up to 10 without repeating the combination? Have not been able to solve this.
(1 vote) • I am assuming you mean integers, because if you include decimals there are infinitely many ways to do this. I am also assuming you mean to use each number only once. If you are allowed to use a digit more than once, then there will be far more possibilities than mentioned here.

Rather than trying to do this in one single step, with one formula, it is better to break it into more manageable pieces.
Do it in sets of how many numbers you are adding. The most you'll have is 4 because the only way to sum to 10 with those integers is 1+2+3+4.
So, with 1 addend, there is only one way: 10 = 10
With 2 addends, you have 1+9, 2+8. etc.
With 3 addends, you have a bit more difficulty, start with 1 and then find sets of two numbers that add to 9. Then use 2 and find two digits that add to 8, then 3 plus two digits that add to 7, and finally 4 plus two numbers that sum to 6. You won't need to do 5 through 10 because either you will have already used that set of numbers (in the cases of 5 through 7) or there won't be any (in the cases of 8 through 10).

You'll need to sort the list because you may have some repeats.

Again, if you are allowed to reuse an integer, then there will be far more than these.
• What happens in the polynomial if n is a non-integer value, such as 0.5? Is the domain of n restricted in this, and how would one represent that restriction?

Thanks! • I thought the formula was (n*(n+1)*(2n+1))/6.
Does it have to do with the fact that Sal started at 0 but (n*(n+1)*(2n+1))/6 starts at 1? • Does i always have to be 0 in order for this formula to work?
(1 vote) • Sal says at the end you can multiply all the way to 100 using that formula , but wouldn't it be a fraction cause 1/3*100^3 it's gonna be 1,000,000 divided by 3
(1 vote) • The entire formula is 1/3*n^3 + 1/2*n^2 + 1/6*n

Though it may be true that each of these terms might turn out to be a number with fractional part. But when all these terms are added together, even a bunch of fractions can add up to a whole number.
This is the case when n = 100. We would get 1000000/3 + 10000/2 + 100/6. It is true that the first and last terms are fractional when simplified. But they add up to a whole number. And we get a final answer as 338350.