If we set Px^2+6x+1 = x^2+x(x+Q)+1 = 3x^2-5-(x^2-6x+R/2) and expand all the sides we obtain:
Px^2+6x+1 = 2x^2 + Qx + 1 = 2x^2 + 6x-5 - R/2.
We may then set quadratic terms to be equal as: Px^2= 2x^2 which gives P=2, set the first order terms equal as: 6x=Qx which gives Q=6, and finally setting the constants equal as 1= -5 - R/2 which gives R=-12.