i think there's some stuff missing from the question, the wording seems weird to me...

anyway, i guess the way to go is to minimize the cost. so we want to minimize the function:

so we find the critical points of the function and pick the one that is the local minimum. that will give you the for minimum cost, which will make our profit larger...