How to find closed form solution of linear recursion using recursive tree method
Expanding the recursion, we get
$$
\begin{align*}
T(n) &amp;= 3n + T(n-1) \\ &amp;= 3n + 3(n-1) + T(n-2) \\ &amp;= 3n + 3(n-1) + 3(n-2) + T(n-3) \\ &amp;= \cdots \\ &amp;= 3n + 3(n-1) + 3(n-2) + \cdots + 3(2) + T(1) \\ &amp;=
3n + 3(n-1) + 3(n-2) + \cdots + 3(2) + 1.
\end{align*}
$$
Therefore
$$
T(n) = 1 + \sum_{m=2}^n 3m.
$$
You take it from here.