Create a profit function.
P(x)=R(x)-C(x)
Which is really just the difference of a revenue function minus a cost function. Though the revenue function will often be based upon a price and demand function as well :)
The you would just solve for when P(x)=0