This is driving me crazy, I thought this would be quite straightforward, but it doesn't appear to be, I have:

$$(1-\beta x)(-\beta x)^2 + \beta x(1-\beta x)^2$$
Divide by $(1-\beta x)$ and we get, 

$$(-\beta x)^ 2+ \beta x(1-\beta x)$$

Then divide by $\beta x$

$$\beta x + (1-\beta x)$$

But the answer is $(1-\beta x)\beta x$

Thanks