My dilemma isn't so much how to do synthetic division or how to write the results into the given form.I don't understand the answer that is given in the answer key for this problem.Obviously,I don't want to simply know the answer,I want to understand it.So,for this problem I'm supposed to write the function f(x)=(x-k)q(x)-r,and show that f(k)=r.

The squares are just confusing me.Thanks for taking a look.