the only variables are x and y, and their differentials. use whatever gets you the solution. if the question says max hieght, then find dy/dx=0, sub the solution into y.
its (n-r+1)/r * b/a. greatest coefficient occurs when Tr+1/Tr >1. just solve for n and the substitute into Tr+1.