You don't need it to be one variable... you are trying to get it to be 2... then you take the derivative and find out when it equals 0. Then take those values and determine which one is minimum. I think you are going to fail your final. My junior year in highschool I was able to do this problem after one month of Calculus. I hope you don't plan on taking any more advanced math.