(a) 5 cm, 3 cm

Let ABCD be the given trapezoid, whose base angles ∠A and ∠B equal 40° and 50°. Also mid-line EF = 4 cm.
Extend AD and BC to meet at P.
Now in ΔAPB,
∠APB = 180° – (40° + 50°) = 90°
Also, ΔABP ~ ΔDCP
⇒ \(\frac{AB}{DC}\) = \(\frac{AP}{DP}\) = \(\frac{BP}{CP}\) ....(i)
Let Q and R be the mid-points of DC and AB respectively.
∴ DC = 2DQ and AB = 2AR
∴ From (i)
\(\frac{AB}{DC}\) = \(\frac{AP}{DP}\) = \(\frac{BP}{CP}\) ⇒ \(\frac{2\,AR}{2\,DQ}\) = \(\frac{AP}{DP}\) = \(\frac{BP}{CP}\)
⇒ \(\frac{AR}{DQ}\) = \(\frac{AP}{DP}\) = \(\frac{BP}{CP}\)
⇒ ∆PDQ and ∆PAR are similar ⇒ P, Q, R are collinear. Now, as ∆APB and ∆DPC are right angled ∆s

AR = RB = PR and DQ = QC = PQ.
[If D is the mid-pt. of hyp. AC, then BD = AD = CD]
∴ \(\frac{AB}{2}\) - \(\frac{DC}{2}\) = AR – DQ = PR – PQ = QR = 1
⇒ AB – CD = 2 ....(i)
Also, \(\frac{AB+CD}{2}\) = 4 ⇒ AB + CD = 8 ...(ii)
Solving (i) and (ii) simultaneously, we get
AB = 5 and CD = 3.