Originally Posted by

**algorith** In doing least squares, I end up with a system of linear equations consisting of series that I have no idea how to eliminate. The system of linear equations consists of the following:

C*n + D*∑$\displaystyle Ai$ = ∑$\displaystyle Bi$

C*∑$\displaystyle Ai$ + D*∑$\displaystyle (Ai)^2$ = ∑$\displaystyle AiBi$

I need to solve for C and D. All series are from i = 1:n. My calculus is rusty so I don't quite recall how I can eliminate any of the series. Any help would be appreciated, thanks.