Three right-angled triangles have one equal leg, the other legs are 100 units larger in ascending order, and the hypotenuses increase by 30 and 40 units, respectively. Calculate the sides.
Let the common leg of the three triangles be $a$, and let the other leg of the middle triangle be $b$, and its hypotenuse $c$. Writing down the Pythagorean theorem for all three:

$$
\begin{aligned}
a^{2}+(b-100)^{2} & =(c-30)^{2} \\
a^{2}+b^{2} & =c^{2} \\
a^{2}+(b+100)^{2} & =(c+40)^{2}
\end{aligned}
$$

Subtracting (2) from (1) and (3), we get a linear system for $b$ and $c$:

$$
\begin{aligned}
-100(2 b-100) & =-30(2 c-30) \\
100(2 b+100) & =40(2 c+40)
\end{aligned}
$$

Adding these two equations:

$$
\begin{aligned}
2 \cdot 100^{2} & =20 c+30^{2}+40^{2} \\
c & =10 \cdot 100-45-80=875
\end{aligned}
$$

Substituting this value of $c$ into (4), and then substituting the values of $b$ and $c$ into (2), we get the values of $b$ and $a$: $b=308, a=819$. Therefore, the sides of the middle triangle are: $819,308,875$, the sides of the smaller triangle are: $819,208,845$, and the sides of the larger one are: $819,408,915$.
![](https://cdn.mathpix.com/cropped/2024_05_02_11642e4a18b4b3866760g-1.jpg?height=374&width=1216&top_left_y=995&top_left_x=450)

Remarks. 1. Since all four growth numbers $(100,100,30,40)$ are rational numbers, we expected to get a rational solution for $b$ and $c$, but it was not certain that we would get an integer value for $a$. However, a more pleasing, integer value was obtained for all three unknowns.

2. Generally, if the differences of the other legs are $p$ and $q$, and the hypotenuses of the smaller and larger triangles are $d$ and $e$, respectively, then the equations (1)-(3) become:

$$
\begin{aligned}
a^{2}+(b-p)^{2} & =d^{2} \\
a^{2}+b^{2} & =c^{2} \\
a^{2}+(b+q)^{2} & =e^{2}
\end{aligned}
$$

Subtracting (2') from (1') and (3'), we get:

$$
\begin{aligned}
-2 b p+p^{2} & =d^{2}-c^{2} \\
2 b q+q^{2} & =e^{2}-c^{2}
\end{aligned}
$$

If $p \neq q$, it is more convenient to add the first equation multiplied by $q$ to the second equation multiplied by $p$:

$$
p q(p+q)=d^{2} q+e^{2} p-c^{2}(p+q)
$$

This is Stewart's theorem, which determines the relationship between the lengths $p, q$ of two consecutive segments on a straight line, and the distances $c, d, e$ from the endpoints to an external point $P$.

Our derivation only applies to the case where the projection of $P$ does not fall on the segments, but it can be similarly proven even if the projection is on one of the segments.