Solving inhomogeneous recursion using quadratic particular solution
Given:

$a(n) = a(n-1) + 5n^2 + 2n + 4$

We hypothesise that because the difference is quadratic, $a(n)$ is cubic. In particular:

$a(n) = a_3 n^3 + a_2 n^2 + a_1 n + a_0$

So:

$a_3 n^3 + a_2 n^2 + a_1 n + a_0 = a_3 (n-1)^3 + a_2 (n-1)^2 + a_1 (n-1) + a_0 + 5n^2 + 2n + 4$

$\Rightarrow 3 a_3 n^2 + (-3 a_3 + 2 a_2) n + (a_3 - a_2 + a_1) = 5n^2 + 2n + 4$

This must be true for all $n$. Therefore:

$3 a_3 = 5$

$-3 a_3 + 2 a_2 = 2$

$a_3 - a_2 + a_1 = 4$

Note that $a_0$ doesn't appear in these equations, so this is effectively a linear system, three equations in three unknowns. The unique solution is:

$a_3 = \frac{5}{3}$

$a_2 = \frac{7}{2}$

$a_1 = \frac{35}{6}$

And so:

$a(n) = \frac{5}{3} n^3 + \frac{7}{2} n^2 + \frac{35}{6} n + a_0$

is a solution to the recurrence equation for any $a_0$.