=-0.1{(x^2-160x+80^2) - 80^2 +20}. Here 80^2 is added and subtracted to make x^2-160x into (x-80)^2 a complete square.

=-0.1{(x-80)^2 - 6380}. This is negative and so maximum when the quantity inside the bracket is least. That is when x-80 = 0. Or x = 80. And th1 maximum profit is = -(0.1){(x-80)^2-6380} when when x= 0. So max profit = -(0.1){(80-80^2-6380)} = 638.