TITLE: Proof by the substitution method that if $T(n) = T(n - 1) + \Theta(n)$ then $T(n)=\Theta(n^2)$
QUESTION [5 upvotes]: How to prove by the substitution method that if $T(n) = T(n - 1) + \Theta(n)$ then $T(n)=\Theta(n^2)$?

I've tried the following and got stuck
$$
\begin{align}
T(n) &= T(n - 1) + \Theta(n) \\
     &= d(n - 1)^2 + cn \\
     &= d(n^2 - 2n + 1) + cn \\
     &= dn^2 - 2dn + d + cn .... \\
\end{align}$$
Any ideas?
Thanks for your time and effort!

REPLY [4 votes]: Steven has essentially given you the answer (with one minor error). Here's how one might arrive at it. I'll do one half of the derivation; the other half is the same, but you'd interchange most of the $\le$ and $\ge$ and replace every big-O with big-$\Omega$.
You know that $T(n) = T(n-1)+\Theta(n)$ so you know that $T(n) = T(n-1)+O(n)$ and so there is a $c>0$ such that 
$$T(n)\le T(n-1)+cn
$$
for all $n$ sufficiently large. We're been handed our guess, namely that $T(n)=O(n^2)$ so our guess will be that $T(n)\le kn^2$ for some $k>0$ and all $n$ sufficiently large. In the discovery phase, we'll try to find a $k$ in terms of the $c$ we have.
For our $k$ we have
$$
\begin{align}
T(n)&\le T(n-1)+cn\\
    &\le k(n-1)^2+cn
\end{align}
$$
and we require that $T(n)\le k(n-1)^2+cn\le kn^2$. We have this chain of results
$$
\begin{align}
k(n-1)^2+cn&\le kn^2\\
k(n^2-2n+1)+cn&\le kn^2\\
kn^2-2kn+k+cn&\le kn^2\\
-2kn+k+cn&\le 0\\
k(1-2n)&\le-cn\\
k(2n-1)&\ge cn\\
k&\ge \frac{cn}{2n-1}
\end{align}
$$
so since the largest value of $n/(2n-1)$ for $n\ge 1$ is $1$, any $k\ge c$ will work. Let's see that this does indeed work with $k=c$.
$$
\begin{align}
T(n)&\le T(n-1) +cn &\text{given}\\
    &\le c(n-1)^2+cn &\text{by assumption}\\
    &=cn^2-2cn+c+cn\\
    &=cn^2-cn+c\\
    &=c(n^2-n+1)\le cn^2 &\text{ta daa!}
\end{align}
$$ 
as long as $n\ge 1$, so indeed $T(n)=O(n^2)$. As I said, the other direction is immediate.