Annuity that pays $t^2$ at time $t$ in arrears annually. I am asked to show that such an annuity for $n$ years will be expressed as,

$$\frac{2(Ia)_{\bar n|} - a_{\bar n|}-n^2u^{n+1}}{1-u}$$

where $u=\frac{1}{1+i}$ and $i$ is the annual effective interest rate.
So essentially the sum
$u+4u^2+9u^3+...+nu^n$. My idea was $u+(2u^2+2u^2)+(3u^3+3u^3+3u^3)+...$ and make a series of annuities which we are familiar with e.g. Increasing annuity, immediate annuity, but this only made it super complicated. But I can't think of any other way that might lead to solving this.
Any help? Does anyone know how to prove this?
Thanks a lot

Answer:
Let us denote such an annuity as $\bar S$.
Then $$\bar S = u + 4u^2 + 9u^3 +\cdots +n^2u^n \tag{1}$$
Now multiply (1) by u ,
$$u\bar S = u^2 + 4u^3 + 9u^4 +\cdots +n^2u^{n+1} \tag{2}$$
Substract (1)-(2),
$$(1-u)\bar S = u+3u^2+5u^3+7u^4+\cdots+(2n-1)u^n - n^2u^{n+1}$$
$$(1-u)\bar S = (2u-u)+(4u^2-u^2)+(6u^3-u^3)+\cdots+(2nu^n-u^n)  - n^2u^{n+1}$$
$$ (1-u)\bar S = 2(u+2u^2+3u^3+\cdots+nu^n)-(u+u^2+u^3+\cdots+u^n)-n^2u^{n+1}$$ 
The terms in the first bracket constitute an increasing annuuity with P = 1 and D = 1 and the terms in the next bracket constitute an immediate annuity.  Thus if you rearrange terms, you get
$$(1-u)\bar S = 2(Ia)_{\bar n|} - a_{\bar n|}-n^2u^{n+1}$$
$$\bar S = \frac{2(Ia)_{\bar n|} - a_{\bar n|}-n^2u^{n+1}}{1-u}$$
