# Determining a closed-form solution for the following sum

I have the following summation: $$\sum_{i=0}^n\left(6in + n(8n+2)\right).$$ Evaluating I get \begin{align*} 6n\left(\frac{n(n+1)}{2}\right) + n(8n+2) = 3n(n(n+1)) + n(8n+2)\\ &=3n^2(n+1) + n(8n+2)\\ &=3n^3 + 3n^2 + 8n^2 + 2n\\ &=3n^3 + 11n^2 + 2n. \end{align*}

Is this correct?

-
Are you starting with $$\left(\sum_{i=0}^{n}6in\right)+n(8n+2)$$ or $$\sum_{i=0}^{n}\left(6in+n(8n+2)\right)?$$ –  Isaac Mar 3 '11 at 22:04
the second one. –  Krysten Mar 3 '11 at 22:05
I know that what you want is the value of the sum, but isn't $\sum_{i=0}^n\left(6in + n(8n+2)\right)$ a closed form? –  TCM Mar 4 '11 at 1:44

Your first step is wrong.

$$\sum_{i=0}^{n} (6in + n(8n+2)) = \sum_{i=0}^{n} (6in) + \sum_{i=0}^{n} n(8n+2)$$

You wrote

$$\sum_{i=0}^{n} (6in) = 6n \sum_{i=0}^{n} i = 6n^2(n+1)/2$$

but missed this one:

$$\sum_{i=0}^{n} n(8n+2) = n(8n+2) \sum_{i=0}^n 1 = n(n+1)(8n+2)$$

and wrote

$$n(8n+2)$$

@Kry: I have edited the answer to clarify it a bit. Since $n$ is independent of $i$, you can take it out of the $\sum$. –  Aryabhata Mar 3 '11 at 22:19