Well, I'd use a second degree equation,
ax²+bx+c
And then profit P of increase in price would basically be the product between
(i) 300 + 20x,
which is how many products you're going to sell for a given decrease in price, and
(ii) 60 - x
which is the new price. (Though keep in mind that, to get profit you'ld have to subtract 40 of (ii) otherwise you'ld assume that the product is free to produce).
So: (i) * (ii)
Rest is up to you, but the easiest way is to use derivatives, whom you may or may not be familiar with...