I have come to a problem in a book on elementary mathematics that I don't understand the solution to. The problem has two parts :
a.) Factorize the expression $x^{4} + x^{2} + 1$
b.) Compute the value of the sum $\sum_{k=1}^{n} \frac{k}{k^{4} + k^{2} + 1}$ in terms of $n \in \mathbb{N}$.
I was able to perform part (a.) to get : \begin{equation} x^{4} + x^{2} + 1 = (x^{2} + x + 1)(x^{2} - x + 1) \end{equation} I wasn't able to do part (b.), but in the answer key the first part of the solution is : \begin{align} \frac{k}{k^{4} + k^{2} + 1} & = \frac{k}{(k^{2} + k + 1)(k^{2} - k + 1)} \\ & = \frac{1}{2} \left( \frac{1}{k^{2} -k + 1} - \frac{1}{k^{2}+k+1} \right) \end{align} I can see that the first transformation above comes from the answer to part (a.). I do not understand how they did the second transformation. Could someone show me how to go from the second expression to the third above ?
We can start from
$$ \frac{A}{k^{2} -k + 1} + \frac{B}{k^{2}+k+1}=\frac{A(k^{2}+k+1)+B(k^{2} -k + 1)}{(k^{2} -k + 1)(k^{2}+k+1)} = \frac{k}{(k^{2} + k + 1)(k^{2} - k + 1)} $$
from which we obtain $A=-B=\frac12$.