How to divide ${2k^3+3k^2+k-2j^3+3j^2-j}$ with $(k+1-j)$? The question I had was calculating $$\displaystyle\frac{1}{k+1-j}\sum_{i=j}^k i^2$$ 
Because I didn't know how to do a variable change, I did
$$\frac{1}{k+1-j}\sum_{i=j}^k i^2 = \frac{1}{k+1-j}\left(\sum_{i=1}^k i^2 - \sum_{i=1}^{j-1} i^2\right) = \frac{2k^3+3k^2+k-2j^3+3j^2-j}{6(k+1-j)}$$ 
The solution given used variable change and was able to cancel out $(k+1-j)$ very easily. Finally the answer was $$\frac{2k^2 + 2j^2 + 2kj - j + k}{6}$$ I have verified that these two solutions are the same by multiplying the second one with $(k+1-j).$ 
My question is:  

How do you divide an expression like ${(2k^3+3k^2+k-2j^3+3j^2-j)}$ with $(k+1-j)$? Is it even worth it in this case to get the most simplified solution? 

 A: Try to write the polynomial in $k$ as a polynomial in $m=k+1$.
$2k^3+3k^2+k=\big[2(k+1)^3-2-6k-6k^2\big]+\big[3(k+1)^2-3-6k\big]+(k+1)-1\\=2(k+1)^3+3(k+1)^2+(k+1)-6(1+2k+k^2)\\=2m^3-3m^2+m$
Therefore, $2m^3-3m^2+m-2j^3+3j^2-j=2(m^3-j^3)-3(m^2-j^2)+m-j\\=(m-j)\big[2(m^2+j^2+mj)-3(m+j)+1\big]$
Divide by $k+1-j=m-j$ and back-substitute $m$ to get,
$$2(m^2+j^2+mj)-3(m+j)+1=2k^2+2j^2+2kj+k-j$$
A: making $k-j+1=m\to j=k-m+1$
and after substitution into 
$$
2 k^3 + 3 k^2 + k - 2 j^3 + 3 j^2 - j =m + 6 k m + 6 k^2 m - 3 m^2 - 6 k m^2 + 2 m^3
$$
A: You could use synthetic division fairly easily here.
First, we consider $2k^3+3k^2+k-2j^3+3j^2-j$ as a polynomial in $k,$ and write the $4$ coefficients $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\ & & & &\\\hline & & & &\end{array}$$ Next, we invert the coefficients of the divisor $k+1-j$ to get $-1k+j-1,$ and write the constant term in as $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & & &\\\hline & & & &\end{array}$$ We bring down the first term to get $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & & &\\\hline & 2 & & &\end{array}$$ Now, we multiply what we've just brought down by $j-1$ and write in the result as $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & 2j-2 & &\\\hline & 2 & & &\end{array}$$ Now, adding the numbers in that column gets us $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & 2j-2 & &\\\hline & 2 & 2j+1 & &\end{array}$$ Multiply that result by $j-1$ and write it in to get $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & 2j-2 & 2j^2-j-1 &\\\hline & 2 & 2j+1 & &\end{array}$$ Adding again gives us $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & 2j-2 & 2j^2-j-1 &\\\hline & 2 & 2j+1 & 2j^2-j &\end{array}$$ Multiplying again by $j-1$ and then adding once more, we get $$\begin{array}{c|cccc} & 2 & 3 & 1 &-2j^3+3j^2-j\\j-1 & & 2j-2 & 2j^2-j-1 & 2j^3-3j^2+j\\\hline & 2 & 2j+1 & 2j^2-j &0\end{array}$$ Translating back into terms of a polynomial in $k,$ this means that $$\frac{2k^3+3k^2+k-2j^3+3j^2-j}{k+1-j}=2k^2+(2j+1)k+2j^2-j+\frac{0}{k+1-j},$$ or more simply, $$\frac{2k^3+3k^2+k-2j^3+3j^2-j}{k+1-j}=2k^2+2j^2+2jk-j+k,$$ as desired.
