$$T_n = 6T_{n-1} - 13T_{n-2} + 12T_{n-3} - 4T_{n-4} + 5n^2 + 3n + 2 + 2^n + n2^n$$
The characteristic polynomial is $x^4 - 6x^3 + 13x^2 - 12x + 4 = 0$, or $(x-2)^2 (x-1)^2 = 0$. Therefore the homogeneous solution looks like:
$$T_n = \alpha_1 2^n + \alpha_2 n 2^n + \alpha_3 (1)^n + \alpha_4 n (1)^n$$
The non-homogeneous components $5n^2 + 3n + 2 + 2^n + n2^n$ have some interference with this when we create our trial solution. We cannot assume trial solution $an^2 + bn + c + d2^n + en2^n$.
The $an^2$ term clashes with nothing.
$bn$ clashes with $\alpha_4 n (1)^n$.
The constant $c$ clashes with $\alpha_3 (1)^n$.
$d2^n$ clashes with $\alpha_1 2^n$.
$en2^n$ also clashes with $\alpha_2 n 2^n$.
The trial terms need to each be multiplied by factors of $n$ until nothing is colliding with anything in the homogeneous piece (nor colliding with other non-homogeneous terms).
I changed the trial solution to $an^2 + bn^3 + cn^4 + dn^2 2^n + en^3 2^n$.
But when I plug it into the non-homogeneous recurrence, I get an unsolvable system for some reason, according to Mathematica. Where did I go wrong?