hey guys,
I was reading a calculus text book and I'm on the section of Riemann's integral, now the example my text uses is, to find the area under the curve f(x)=x²+1, now the book explains the solution like this

It's later simplified like this:


NOTE: The curve occurs between x = 0 and x = 3
Now the part that I don't understand is the part where the book tells you that the sum of the first n squares is equal to:

Is this a general formula that the author knows from previous experience or did he get this by simplifying any of the latter formulas? The reason I want to know this is because the formula is then written like this:

is replaced with n since if you add 1 n times you get n
So if it the author didn't get this from simplifying any of the latter formulas, what would have happened if we were looking at a different function (eg. f(x)=x³-2x)
I was reading a calculus text book and I'm on the section of Riemann's integral, now the example my text uses is, to find the area under the curve f(x)=x²+1, now the book explains the solution like this

It's later simplified like this:


NOTE: The curve occurs between x = 0 and x = 3
Now the part that I don't understand is the part where the book tells you that the sum of the first n squares is equal to:

Is this a general formula that the author knows from previous experience or did he get this by simplifying any of the latter formulas? The reason I want to know this is because the formula is then written like this:


So if it the author didn't get this from simplifying any of the latter formulas, what would have happened if we were looking at a different function (eg. f(x)=x³-2x)