`g(x) = x^2+qx+r = 0` with roots `alpha` and `beta`
So we can say;
`alpha+beta = -q`
`alphaxxbeta = r`
So the required answer is obtained.
There's kind of a cool way to solve it with less factoring, which is nice for people like me who aren't the quickest at finding factorizations.
Note that `f(x)-g(x)=(b-q)x+(c-r).` Then since `g(alpha)=g(beta)=0,` we have
So you can already see where the `b-q`and `c-r` terms come from in the answer (actually those terms were what led me to try subtracting the functions in the first place). Now multiply these (you have to do a little bit of factoring at times too) and use the fact that `alpha*beta=r` and `alpha+beta=-q,` and the answer just pops out. Since the question was already solved though, I'll leave the straightforward details of this to you.