<s>[INST] Excircles of a right triangle 
Given a $\triangle ABC$ such that the $A$ excircle has a radius $r_A$ and the $B$ excircle has a radius $r_B$. Prove that if $r_A + r_B = AB$ then $\triangle ABC$ is a right triangle.

I called $D$ the point where the $A$ excircle touches the side $BC$, $E$ the point where the $B$ excircle touches the side $AC$ and $F$ the point where the $C$ excircle touches the side $AB$.
Then I noticed that $AE = BD$ and that in order to prove the given statement I need to show that $BF = r_B$ and $AF = r_A$ but I don't know how to use these facts.
 [/INST] The formula for the ex-radius is
$ r_A = \dfrac{ \Delta } {s - a} $
$ r_B = \dfrac{ \Delta }{ s- b} $
where $ \Delta $ is the area of the triangle, and $s = \frac{1}{2}(a + b + c) $
Given in the problem
$ r_A + r_B = AB = c $
Therefore,
$ \Delta \left( \dfrac{1}{s-a} + \dfrac{1}{s - b} \right) = c $
so that
$ \Delta ( 2 s - a - b ) = c (s - a)(s - b) $
But $2 s - a - b = c $, therefore
$ \Delta = (s - a)(s - b) $
From Heron's formula for the area,
$ \Delta = \sqrt{ s (s - a) (s - b)(s - c) }$
Therefore
$ s (s - a)(s - b) (s - c) = (s - a)^2 (s - b)^2 $
so that
$ s (s - c) = (s - a)(s - b) $
Expanding
$ s^2 - s c = s^2 - s (a + b) + a b $
Hence,
$ s (a + b - c) = a b $
But, $ s = \dfrac{1}{2}(a + b + c ) $
Therefore,
$ (a + b + c) (a + b - c) = 2 a b $
so that
$(a + b)^2 - c^2 = 2 a b $
And, from this,
$ a^2 + 2 a b + b^2 - c^2 = 2 a b $
Therefore,
$ c^2 = a^2 + b^2 $
Hence, $\triangle ABC $ is a right triangle at $C$.
</s>