"If x - a is a factor of polynomial P(x), then a is a factor of the constant term of the polynomial." - Confused with proof I have recently started learning about polynomials. I've been able to grasp polynomial long division algorithm and the remainder and factor theorems and also a few other common-sense theorems about polynomials. There's just one property of polynomials I don't quite understand the proof of. 
The property:  "If x - a is a factor of polynomial P(x), then a is a factor of the constant term of the polynomial."
There are 2 proofs that I've seen so far that prove this theorem. The first proof I understand and makes complete sense to me. In my view, I think proof 1 is easier to understand.
Proof 1: 
Proof 2:

The second proof is the one I don't understand. More specifically, the part that I don't understand is how:

Can someone please carefully explain how those two expressions are equal to each other? I just don't see how those expressions are equal. I can't find any common factors that have been taken out or what logic has been used to rewrite the expression in that way.

@DomTurner Just to amplify my comment under the question. You have $P(x)=p_nx^n+\dots+p_0$ and $Q(x)=q_{n-1}x^{n-1}+\dots+q_0$. So the 2nd proof should have $$(x-a)Q(x)=xQ(x)-aQ(x)=$$ $$q_{n-1}x^n+q_{n-2}x^{n-1}+\dots+q_1x^2+q_0x-a(q_{n-1}x^{n-1}+\dots+q_0)$$ $$=q_{n-1}x^n+(q_{n-2}-aq_{n-1})x^{n-1}+(q_{n-3}-aq_{n-2})x^{n-2}+\dots+(q_0-aq_1)x-aq_0$$ At that point there is a serious typo in your source because it missed out all those $q_i$ by putting $(q_i-a)x^{i+1}$ for each term instead of $(q_i-aq_{i+1})x^{i+1}$. But it doesn't affect the important point which is that the constant term is $aq_0$.
Of course, you are correct that when one is struggling to learn something, typos in a trusted source make things much more difficult.
