Most teachers would be okay if you left it as 40/7, but in case they’re picky, just enter it into a calculator. You should get around 5.714. Or you can use long division. Remember that 40 is the same thing as 40.000
You would distribute the 2x to the x and 1= 2x^2+2x then you would distribute the 1 to the x and 1= 1x+1 then you would add it all together to get 2x^2+3x+1