So I need to calculate an estimated variance, the info given to me is:

A sample of 140 bags of flour. The masses of x grams of the contents are summarized by

and

I need to find the mean and estimated variance. The mean is simple 140(x - 500) = -266; mean = 498.3 But how the heck do I figure out

Someone suggested :

But unfortunately I dont even know how to solve the above equations, I did google and read this :

A-level Mathematics/FP1/Summation of Series - Wikibooks, collection of open-content textbooks
But It doesnt apply here since we're dealing with a random variable xi? Right? How do I simplify the second and third summations on the left

I dont need the answer, I just a hint or maybe how to solve summations like this? Could someone point me in the right direction?

(Im studying for my A levels on my own =S)