4. Two squares $A B C D$ and $B E F G$ share the vertex $B$, with $E$ on the side $B C$ and $G$ on the side $A B$, as shown.
The length of $C G$ is $9 \mathrm{~cm}$ and the area of the shaded region is $47 \mathrm{~cm}^{2}$.
Calculate the perimeter of the shaded region.
Solution
Let the length of $B C$ be $x \mathrm{~cm}$.
Triangle $B C G$ is right-angled and $C G=9 \mathrm{~cm}$, so applying Pythagoras' Theorem we have $B G^{2}=9^{2}-x^{2}=81-x^{2}$.

The area of the shaded region $=$ the area of square $A B C D-$ the area of square $B E F G$.
Therefore $47=x^{2}-\left(81-x^{2}\right)$.
This simplifies to $47=x^{2}-81+x^{2}$.
Adding 81 to both sides and simplifying gives $128=2 x^{2}$.
So $x^{2}=64$.
Since $x$ represents a length, it cannot be negative, so $x=8$.
Since $E F=B G$ and $F G=E B$, the perimeter of the shaded region is equal to the perimeter of square $A B C D$, which is $4 \times 8$.
Therefore the perimeter is $32 \mathrm{~cm}$.