How would I go about computing this finite sum? How would I go about computing the sum
$$
\sum_{k=1}^{n} \dfrac{(-k^2+2k+1)2^k}{(k(k+1))^2}.
$$
I have tried partial fractions but have gotten stuck trying to find the coefficients. I decomposed it like this:
$$
\dfrac{2^k(-k^2+2k+1)}{(k(k+1))^2} = \frac{a_0}{k} + \frac{a_1}{k^2} + \frac{a_2}{k+1} + \frac{a_3}{(k+1)^2}
$$.

Hint:
Without the need for solving the coefficients:
$\dfrac{-k^2+2k+1}{k^2(k+1)^2} =\dfrac{k^2+2k+1-2k^2}{k^2(k+1)^2}=\dfrac{(k+1)^2}{k^2(k+1)^2}-\dfrac{2}{(k+1)^2}=\dfrac{1}{k^2}-\dfrac{2}{(k+1)^2}.$
Thus, the sum is reduced to
$$\sum_{k=1}^{n}\dfrac{2^k}{k^2}-\sum_{k=1}^{n}\dfrac{2^{k+1}}{(k+1)^2}.$$
And then note that
$$\sum_{k=1}^{n}\dfrac{2^{k+1}}{(k+1)^2}=\sum_{k=2}^{n+1}\dfrac{2^{k}}{k^2}=-2+\dfrac{2^{n+1}}{(n+1)^2}+\sum_{k=1}^{n}\dfrac{2^{k}}{k^2}.$$
The rest is for you to finish.
