Closed form solution of $T(n) = 5T(n-1) + n^2$
How to find the closed form solution of this equation?


This is linear nonhomogeneous recurrence relation of the form $a_n = a_n^{h}+a_n^{p}$ where former expression in the right hand side is homogeneous solution while later one particular. Now, $a_n^p$ becomes $p_2n^2+p_1n+p_0$ whereas $a_n^h$ becomes $\alpha5^n$. Now solve them. 

Another straightforward approach is to recursively solve the equation as follows 
$$\begin{align*}
T(n) &amp;= 5\cdot T(n-1)+n^2 \\
     &amp;= 5[5\cdot T(n-2)+(n-1)^2]+n^2 \\
     &amp;= 5^2T(n-2)+5(n-1)^2 + n^2 \\ 
     &amp;= 5^3T(n-3)+5^2(n-2)^2 + 5(n-1)^2 + n^2 \\
     &amp; \vdots\\
     &amp;= \sum_{k=0}^{n-1}5^{n-k}\cdot k^2
\end{align*}$$


  Is there a repeatable pattern for solving this equation?


The very word recurrence implies pattern.