When f(x)=(p-1)x³+px²+qx+r is divided by (x+2) and (x-1) the remainder are -5 and4 respectively if (x+1) is factor of f(x),find the value of p,q and r hence factorise f(x) completely

f(x)=(p-1)x³+px²+qx+r

given: x+1 is a factor, so f(1) = 0
f(-1) = -p+1 + p - q + r = 0
q - r = 1 , #1 or q = r + 1

f(-2) = -8(p-1) + 4p - 2q + r = -5
-4p - 2q + r = -13 . #2

f(1) = p-1 + p + q + r = 4
2p + q + r = 5 , #3

subtract #2 from #3: 6p - 3q = 18
2p - q = 6

I will leave it up to you to solve and get
p=3, q=0, r= -1

f(x) = 2x^3 + 3x^2 - 1
= (x+1)(.......) , use either synthetic division or algebraic long division
to find the missing quadratic factor

let me know what you get