check the picture below.
bearing in mind that in a rectangle, both diagonals are the same length, therefore then,
[tex]\bf DF=EG\implies 3x-3=x+21\implies 2x=24
\\\\\\
x=\cfrac{24}{2}\implies x=12\\\\
-------------------------------\\\\
DF=3(12)-3\qquad \qquad \qquad \qquad EG=(12)+21[/tex]