Question: Sum simplification

I would like to simplify (automatically...) a sum containing constant terms, as in the trivial one:

Sum((A*x[i]+B)^2, i = 1 .. n) = A^2*(sum(x[i]^2, i = 1 .. n))+2*A*B*(sum(x[i], i = 1 .. n))+n*B^2

I can reach this result easily enough by:

- Using the "student" package

- Then expressing the sum underits inert form (Sum(...))

- Expanding it

- Taking its value.

Now the "student" package is "deprecated".... How can I do this without it?

 

Please Wait...