AB intersects the circumference in a point M. The line, which passes through M and is parallel to CD, intersects the circumference in a point N. Because ∠MDC=90∘, the segment MC passes through the centre of the circle, which means that ∠MNC=90∘, we conclude that the quadrangle MDCN is a rectangle. The points P and E, A and B are symmetric with axis of symmetry same as for the rectangle MDCN which passes through O and is parallel to DC and MN. It follows that AP=EB. From CD=CE+ED, MD=PE=AE−AP=AE−EB and because ∠MDC is a right-angled triangle we obtain that

d2=MD2+CD2=(AE−EB)2+(CE+ED)2==AE2+EB2−2⋅AE⋅EB+CE2+ED2+2⋅CE⋅ED……(1).
∠BAC=∠BDC because they are angles over the same arc BC. From the similarity of the triangles ΔAEC∼ΔBED we obtain AE:CE=ED:BE or AE⋅EB=CE⋅ED…(2). If we substitute (2) in (1) we get
AE2+BE2+CE2+DE2=d2.