Answer:
Since triangle AMD is a right triangle with AM = 40 and DM = 30, we can use the Pythagorean theorem to find the length of AD:
Since ABCD is a rectangle, AD = BC. Therefore, BC = 50.
Now, since AB is parallel to DC and BC = AD = 50, we know that AB = DC = 50.
So, AB = 50.