<s>[INST] 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}
$$.
 [/INST] Observe that
$$\dfrac{(-k^2+2k+1)2^k}{(k(k+1))^2}= \dfrac{-2^{k+1}}{(k+1)^2}+\dfrac{2^k}{k^2}.$$
Then take sum as $k$ varies from $1$ to $n$.
$$\sum_{k=1}^n \dfrac{-2^{k+1}}{(k+1)^2}+\dfrac{2^k}{k^2}=\sum_{k=1}^n \dfrac{-2^{k+1}}{(k+1)^2}+\sum_{k=1}^n \dfrac{2^k}{k^2}$$
This being an alternate sum of elements of same type, you are left with $$2-\dfrac{2^{n+1}}{(n+1)^2}$$
</s>