Simply parametrizeParametrize the borders and look for the roots of the gradient in the interior of the function domain.
Moreover, analize the limits in the singularities. I did not make the details, but if the root of $(1+Cx)(1+Dy)$ are in $[0,A]\times[0,B]$, it is possible that an infite limit appears.