Question:
Find the sum to $n$ terms of the series whose $n^{\text {th }}$ terms is given by $n^{2}+2^{n}$
Solution:
$a_{n}=n^{2}+2^{n}$
$\therefore S_{n}=\sum_{k=1}^{n} k^{2}+2^{k}=\sum_{k=1}^{n} k^{2}+\sum_{k=1}^{n} 2^{k}$ (1)
Consider $\sum_{k=1}^{n} 2^{k}=2^{1}+2^{2}+2^{3}+\ldots$
The above series $2,2^{2}, 2^{3}, \ldots$ is a G.P. with both the first term and common ratio equal to 2 .
$\therefore \sum_{k=1}^{n} 2^{k}=\frac{(2)\left[(2)^{n}-1\right]}{2-1}=2\left(2^{n}-1\right)$ (2)
Therefore, from (1) and (2), we obtainÂ
$S_{n}=\sum_{k=1}^{n} k^{2}+2\left(2^{n}-1\right)=\frac{n(n+1)(2 n+1)}{6}+2\left(2^{n}-1\right)$