Draw two perpendicular to AB from the point D and C respectively.
Since AB∥CD,PMCD will be a rectangle.
From right triangle ADP
cos60∘=APAD
12=AP20
AP=10
Similarly from the right triangle BMC, we get BM=10 cm.
Now from the rectangle PMCD, we get CD=PM=20 cm.
AB=AP+PM+MB=10+20+10=40 cm.