31. In the diagram below, $A B C D$ is a quadrilateral such that $\angle A B C=$ $135^{\circ}$ and $\angle B C D=120^{\circ}$. Moreover, it is given that $A B=2 \sqrt{3} \mathrm{~cm}$, $B C=4-2 \sqrt{2} \mathrm{~cm}, C D=4 \sqrt{2} \mathrm{~cm}$ and $A D=x \mathrm{~cm}$. Find the value of $x^{2}-4 x$.
31. Answer: 20
First we let $\ell$ be the line which extends $B C$ in both directions. Let $E$ be the point on $\ell$ such that $A E$ is perpendicular to $\ell$. Similarly, we let $F$ be the point on $\ell$ such that $D F$ is perpendicular to $\ell$. Then, it is easy to see that $B E=A E=\sqrt{6}, C F=2 \sqrt{2}$ and $D F=2 \sqrt{6}$. Thus $E F=\sqrt{6}+4-2 \sqrt{2}+2 \sqrt{2}=4+\sqrt{6}$. Now we let $G$ be the point on $D F$ such that $A G$ is parallel to $\ell$. Then $A G=E F=4+\sqrt{6}$ and $D G=D F-G F=D F-A E=2 \sqrt{6}-\sqrt{6}=\sqrt{6}$. So for the right-angled triangle $A D G$, we have
$$
x=A D=\sqrt{A G^{2}+D G^{2}}=\sqrt{(4+\sqrt{6})^{2}+(\sqrt{6})^{2}}=\sqrt{28+8 \sqrt{6}}=2+2 \sqrt{6} \text {. }
$$

Thus, $x^{2}-4 x=(2+2 \sqrt{6})^{2}-8-8 \sqrt{6}=4+24+8 \sqrt{6}-8-8 \sqrt{6}=20$.