Here's a rough image (not to scale)
Note that angle PEB = angle CDP = 90°
And angle EPB = angle DPC
So triangles PEB and PDC are similar
And because BPE is a right triangle then BP is the hypotenuse = sqrt (20^2 + 30^2) = sqrt ( 1300) = 10sqrt (13)
Then
BE / BP = CD /CP and PE / BE = PD / CD
30/[10sqrt(13)] = CD /10 20 / 30 = PD / [30/sqrt (13)]
30/sqrt(13) = CD 20 / 30 = sqrt(13)* PD /30
PD = 20/sqrt(13)
Also angle PDC = angle CEA
And angle DCP = angle ACE
So triangles CEA and CDP are similar
So
AE / EC = PD / DC
AE / 30 = [20/sqrt(13)] / [30/sqrt (13) ]
AE / 30 = 20 / 30
AE = 20