Another way to do it is prove (which you probably already have) inductively the formula for the sum of squares and cubes:
$$
1^{2}+\ldots+n^{2} = \frac{n(n+1)(2n+1)}{6}\\
1^{3}+\ldots+n^{3} = \frac{n^{2}(n+1)^{2}}{4}
$$
and then note that the sum that you have $(1^{2}2+\ldots+n^{2}(n+1))$ is actually the sum of the first n squares and n cubes. Then, you have:
$$
12(1^{2}2+\ldots+n^{2}(n+1)) = 12(\frac{n(n+1)(2n+1)}{6} + \frac{n^{2}(n+1)^{2}}{4}) \\
=n(n+1)(3n(n+1)+2(2n+1)) = n(n+1)(3n^{2}+7n+2)
$$
So you're missing the factor of $n+2$. To finish then, you just do
$$
(n+2)(an+b)=(3n^{2}+7n+2),
$$
open it up and realize that $a=3$ and $b=1$.