I hope I understand your question correctly.
for every xkg of this compoud, ykg is defective. so they lose $20y for every x amount they produce and earn $100(x-y). so their profit is $100(x-y)-$20y. the next find the maximum point of the graph of P(x) by finding the stationary points