M4. The squares on each side of a right-angled scalene triangle are constructed and three further line segments drawn from the corners of the squares to create a hexagon, as shown. The squares on these three further line segments are then constructed (outside the hexagon).
The combined area of the two equal-sized squares is $2018 \mathrm{~cm}^{2}$.
What is the total area of the six squares?
Solution
Label the lengths as in the diagram below. Note that $z=c$ since it is the hypotenuse of a right-angled triangle with sides $a$ and $b$. By chasing angles $\alpha=\pi-A$ and $\beta=\pi-B$. Hence $\cos \alpha=-\frac{a}{c}$ and $\cos \beta=-\frac{b}{c}$. We are told that $2 c^{2}=2018$ so $c^{2}=1009$.
We have $x^{2}=b^{2}+c^{2}-2 b c \cos \alpha=3 b^{2}+c^{2}$ by the cosine rule, and similarly $y^{2}=3 a^{2}+c^{2}$.
Now the sum of the six squares is
$$
a^{2}+b^{2}+c^{2}+\left(3 b^{2}+c^{2}\right)+\left(3 a^{2}+c^{2}\right)+c^{2}=4\left(a^{2}+b^{2}\right)+4 c^{2} .
$$

By Pythagoras, $a^{2}+b^{2}=c^{2}$ so the sum is $8 c^{2}$, which is 8072 .
Note that the cosine rule can be avoided by the construction shown. This
produces a right-angled triangle whose sides are $a$ and $2 b$ whose hypotenuse is
$x$.
It follows that $x^{2}=a^{2}+4 b^{2}$ and $y^{2}=b^{2}+4 a^{2}$.