deg r(x) < deg a(x).

so r(x) must be of degree 1.

b(x) is of degree 5, so q(x)a(x) must be of degree 5.

so we get q(x) of degree 3.

let q(x) = ax^3 + bx^2 + cx + d

and

r(x) = ex + f.

so we have

2x^5 - x^4 + 3x^3 - 2x + 1 = (x^2 - 2x + 4)(ax^3 + bx^2 + cx + d) + ex +f

Now equate the co-efficient of each power of x from LHS and RHS.

You will get 6 equations (linear0 and 6 variables. solve for a,b,c,d,e and f to get both polynomials.