Problem 1 · Shaded areas in a square
Geometry: two shaded regions and a right triangle with legs 4 and 5.
Integer answer, at most 4 digitsSome segments have been drawn inside a square as shown in the figure, so that a right triangle with legs 4 cm and 5 cm is formed. What is the total area of the two shaded regions?

Reasoned solution
Key idea: the total shaded area is exactly the area of the right triangle with legs 4 and 5, whatever the size of the square. We show it with coordinates.
Place the square of side $s$ with vertices $T_L=(0,0)$, $T_R=(s,0)$, $B_R=(s,s)$, $B_L=(0,s)$ ($y$-axis pointing down). Let $P=(0,p)$ be the point on the left side and $Q=(q,s)$ the one on the bottom side. The two drawn lines are $PB_R$ and $QT_R$, meeting at $R$.
Step 1 — perpendicularity forces $q=p$. The direction vectors are $\vec{u}=(s,\,s-p)$ and $\vec{v}=(s-q,\,-s)$. Imposing $\vec{u}\cdot\vec{v}=0$:
Step 2 — distances to $R$. Write $w = s-p$ and $D = s^2+w^2$. Solving for the intersection gives
Step 3 — the two shaded areas. The top triangle has vertices $T_L$, $P$, $T_R$ and area $\dfrac{sp}{2}$. A direct computation gives, for the bottom triangle $Q\,B_R\,R$, the area $\dfrac{s\,w^{3}}{2D}$. Adding:
That is, the total shaded area is always half the product of the two legs: