the order for expanding is:
When you have { }, [ ], or ( ) first you do whats IN { }, then whats IN [ ] and whats IN ( )
When you have *, /, -, + you do first multiplication, then division then addition then subtraction.
So in your exercise you ddon'thave { } or [ ]. And you ddon'thave multiplication or division. You just have aadditionand ssubs traction But you cant add or ssubs tractbecause you have the variable "x". Then all you have to do is multiply between parenthesis, and finally the x outside the parenthesis.
multiply it out step-by-step (forget about foiling here).
first distribute x to x-5 to yield, x^2-5x. then take that number and distribute it to x^2+x+2, to get
x^4+x^3+2x^2- 5x^3-5x^2-10x... if you combine like terms you will see your answer.