You can lots of ideas for this sort of summation from the answers to this very similar question: https://math.stackexchange.com/questions/30732
– jorikiMar 23 '24 at 09:03
By the way, you can get displayed equations by enclosing them in double instead of single dollar signs.
– jorikiMar 23 '24 at 09:03
Hint.
$$
\sum_{k=1}^nk^2x^k=x\frac{d}{dx}\left(x\frac{d}{dx}\sum_{k=1}^nx^k\right)
$$
– GonçaloMar 23 '24 at 09:13
Hi, welcome to Math SE. Alternative to @Gonçalo's hint: try the Ansatz $(An^2+Bn+C)3^n+Dn^2+En+F$. You can get all but one of the coefficients from the change under $n\mapsto n-1$.
– J.G.Mar 23 '24 at 09:14