# Solution to the Two Squares Diagonally Inside a Rectangle Puzzle +-- {.image} [[TwoSquaresDiagonallyInsideaRectangle.png:pic]] > Two squares sit on the diagonal of the rectangle. The red sections of the diagonal are equal length. What fraction of the rectangle is shaded? =-- ## Solution by [[Similar Triangles]] +-- {.image} [[TwoSquaresDiagonallyInsideaRectangleLabelled.png:pic]] =-- Let $a$ be the length of a red segment and $b$ the length of a side of the square. The triangles labelled $A$ and $B$ are [[similar]], so the ratios $a : b$ and $b : 2 a + b$ are equal. This means that $b^2 = a(2 a + b) = 2 a^2 + a b$. This has solution $b = 2 a$ (the other possible solution is $b = -a$ but $a$ and $b$ are both lengths). The ratio of the lengths of the shorter sides of these triangles is then $1 : 2$. The diagonal of the rectangle is then $7 a$. Consider a half rectangle. This is then a right-angled triangle similar to the others so its shorter sides are in the ratio $1 : 2$. To compute its height (in order to then calculate its area) consider the following diagram in which triangles $A D C$ and $C D B$ are [[right-angled triangles]] with shorter sides of lengths in ratio $1 : 2$. +-- {.image} [[TwoToOneRATriangle.png:pic]] =-- Then the ratio of the lengths of $A D$ to $D B$ is $1 : 4$ so the ratio of $C D$ to $A B$ is $2 : 5$. So the height of the half rectangle is $\frac{14}{5} a$ and so its area is $7 a \times \frac{14}{5} a = \frac{98}{5} a^2$. The combined area of the blue squares is $2 \times (2 a)^2 = 8 a^2$. So the fraction of the rectangle that is shaded is $\frac{40}{98} = \frac{20}{49}$.