Remember that a and b are constants.
Since the corners of the rectangle are on the ellipse, the "x" and "y" in xy must satisfy . As Unknown008 said, a and b are constants not variables. You can either write or differentiate xy with respect to x: y+ xy'= 0, and get y' by differentiating implicitely.