1) 40x-5x^2=x^2-8x
40x-5x^2-x^2+8x=0
48x-6x^2=0
6x*(8-x)=0
x*(8-x)=0
x=0
x=8
2) x^2*(x-9)-2(9-x)=0
x^2*(x-9)-2*(-(x-9))=0
x^2*(x-9)+2(x-9)=0
(x-9)*(x^2+2)=0
x-9=0
x^2+2=0
x=9