How would one go about solving the problem below efficiently? If $$\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}\left(ka^{2}-k^{2}a\right)=P\cdot a^{2}+Q\cdot a$$compute P and Q.
I managed to solve it (albeit slowly) by solving for each term from k=1 to k=5 and adding them up, but that seems rather inefficient. I imagine there has to be a better way to solve this problem, and if so, could someone explain it?
 A: The coefficient of $a^2$ is $(1-2+3-4+5).$ The coefficient of $a$ is $-(1-4+9-16+25).$
If $5$ was replaced with $100,$ you might look for something faster.
You can prove by induction that:
$$1-2+3+\cdots -2n=-n\\
1-2+3-\cdots +(2n+1)=n+1\\
1-4+\cdots +(-1)^{n+1}n^2 =(-1)^{n+1}\frac{n(n+1)}2$$
This gives, since $n=5$ is odd:
$$3a-15$$
If you replace $5$ with $n$ then you get:
$$\sum_{k=1}^n (-1)^{k+1}(ka^2-k^2a)\\=(-1)^{n+1}\left(\left\lfloor \frac {n+1}2\right\rfloor a^2-\frac{n(n+1)}2a\right)$$

Trivial: $P$ is always a divisor of $Q.$
This is because when $n$ is even, $P=-\frac n2.$ When $n$ is odd, then $P=\frac{n+1}2.$
A: $$\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}\left(ka^{2}-k^{2}a\right)=P\cdot a^{2}+Q\cdot a$$
$$=[\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}(k)]a^{2}-[\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}(k^{2})]a=P\cdot a^{2}+Q\cdot a$$
Am I wrong in thinking that $\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}(k) = P$ and $\sum_{k=1}^{5}\left(-1\right)^{\left(k+1\right)}(k^{2}) = -Q$ ?
Maybe it depends on what $a,P,Q$ are. I believe that $3x^2+4x+7=Ax^2+Bx+C$ for all $x \in \mathbb R$ if and only if $3=A,4=B,7=C$.
