Computing the ratio is essentially a one-step process. That ratio is definitely not going to be a straight line. It will be a curve with various characteristics. Am I right in thinking that you now have a curve that is a function of two independent variables, and ? And you're trying to find the extrema of your new function over the rectangle , correct?