# 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?

## 2 Answers

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.$$

• 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$ ? I had already posted an answer – BCLC May 13 at 16:30
• @BCLC You are off by a sign for $Q,$ but my first answer before the edit had $P$ and $Q$ reversed. – Thomas Andrews May 13 at 16:33
• Thomas Andrews edited to $-Q$. wait so OP indeed DOES know about manipulation of summation and summands but is wondering how to get precisely $P$ and $Q$? Or doesn't know about manipulation? Or what? – BCLC May 13 at 16:50
• @BCLC I'd learned some of these properties, manipulation stuff, etc before, I just couldn't remember. To both of you, thanks for the help! – nkenschaft May 14 at 17:20
• Nah, see my profile. Quote: My answers recently can be classified as "overkill." I go in depth. @BCLC – Thomas Andrews May 14 at 19:45

$$\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$$.

• Typically, if $a$ is not specified, you want equality for all $a,$ or more abstractly, as abstract polynomials. – Thomas Andrews May 13 at 16:34
• @ThomasAndrews typically, if $a$ is not specified, then we should clarify with the source (instructor, textbook, etc) ? – BCLC May 15 at 11:25
• @ThomasAndrews Ah wait but you're (also) talking in general like polynomial in the ring sense, where we have all those polynomial vs polynomial function things? – BCLC May 15 at 11:26