TITLE: How to solve this recurrence $K(n)=2K(n-1)-K(n-2)+C$?
QUESTION [7 upvotes]: The recurrence is $K(n)=2K(n-1)-K(n-2)+C$ where $C$ is a constant.
What I have tried is substituting $2K(n-1)$ as we do in fibonnacical recurrences. It didn't gave me a fruitful expression! 
Can someone help in solving it? 
Not a homework problem.

REPLY [10 votes]: The other answers are way too complicated for this particular problem.
They're useful in more general cases, but they're completely overkill here.
\begin{align*}
K(n) &= 2 K(n - 1) - K(n - 2) + C  \\
K(n) - K(n - 1) &= K(n - 1) - K(n - 2) + C
\end{align*}
Just look at this equation for a few seconds.
It's literally telling you that the difference between successive elements increases by $C$ every step.
So... just go ahead and count how many times you add $C$ to the difference $K(1) - K(0)$:
$$K(n) = K(0) + \sum_{k=1}^{n} K(1) - K(0) + (k - 1) C$$
Notice you don't need any linear algebra, eigenvectors, or other higher-level math for this problem. It's just algebraic manipulation.
I'll leave the last step of simplifying the summation to you.
Edit:
or I'll just do it for you myself, since you seem to think it leads to another recurrence...
\begin{align*}
K(n) &= K(0) + n(K(1) - K(0)) + C\sum_{k=1}^{n} (k-1)  \\
&= K(0) + n(K(1) - K(0)) + C \frac{n(n-1)}{2}
\end{align*}