Simplifying $\sum _{k=-n}^n k^2 q^k$

How can we simplify $\sum _{k=-n}^n k^2 q^k$? Is there any nice expression?

-

If $q=1,\sum_{-n\le k\le n}k^2q^k=\sum_{-n\le k\le n}k^2=2\sum_{0\le k\le n}k^2$ as $(-t)^2=t^2$

So, $\sum_{-n\le k\le n}k^2q^k=2\frac{n(n+1)(2n+1)}6=\frac{n(n+1)(2n+1)}3$

If $q\ne 1,$ $$\sum _{k=-n}^n q^k=q^{-n} \frac{q^{2n+1}-1}{q-1}$$

Apply derivative wrt $q,$ $$\sum _{k=-n}^n kq^{k-1}=\frac{d\left(\frac{q^{n+1}-q^{-n}}{q-1}\right)}{dq}$$

Now multiply with $q,$ $$\sum _{k=-n}^n kq^{k}=q\frac{d\left(\frac{q^{n+1}-q^{-n}}{q-1}\right)}{dq}$$

Apply derivative wrt $q$ and multiply with $q$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9997435212135315, "perplexity": 513.6455820790279}, "config": {"markdown_headings": false, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-10/segments/1394010623118/warc/CC-MAIN-20140305091023-00055-ip-10-183-142-35.ec2.internal.warc.gz"}