Draw a picture. Draw one leg, say the 9cm leg, of the right triangle horizontal and one leg vertical. If the height of the rectangle is x then the little right triangle above the rectangle has height 9- x. If the width of the rectangle is y, then the width of that little triangle is y. That little triangle is similar to the entire right triangle so $\frac{9-x}{y}= \frac{9}{8}$. Use that to get y as a function of x. Now you can write the area of the rectangle, xy, as a function of x alone.