When does a right triangle with integral perimeter and area have rational sides?
First find the sides a and b in terms of area $A$ and perimeter $P$.
$A = ab/2 $, so $ab = 2A$.
$\begin{array}{rl}\\ P &= a+b+\sqrt {a^2+b^2}\\ \text{so}\\ a^2+b^2 &=(P-(a+b))^2\\ &=P^2-2P(a+b)+(a+b)^2\\ &=P^2-2P(a+b)+a^2+2ab+b^2\\ &=P^2-2P(a+b)+a^2+4A+b^2\\ \text{so}\\ 2P(a+b) &=P^2+4A\\ \text{or}\\ a+b &=(P^2+4A)/(2P)\\ \end{array} $
so $a$ and $b$ are the roots of
$x^2-(P^2+4A)x/(2P)+2A = 0\\ \text{or}\\ x^2-(P/2+2A/P)x+2A = 0 $
The discriminant $d$ satisfies
$\begin{array}\\ d^2 &=(P/2+2A/P)^2-8A\\ &=P^2/4+2A+(2A/P)^2-8A\\ &=(P/2)^2-6A+(2A/P)^2\\ &=\dfrac{P^4-24AP^2+16A^2}{4P^2}\\ &=\dfrac{D^2}{4P^2}\\ \text{so}\\ a, b &=(P/2+2A/P \pm d)/2\\ &=(P/2+2A/P \pm D/(2P))/2\\ &=P/4+A/P \pm D/(4P)\\ &=(P^2+4A \pm D)/(4P)\\ \end{array} $
Therefore $P^4-24AP^2+16A^2$ must be a square, but I don't know how to solve this.
Its discriminant is $24^2-4\cdot 16 =576-64 =512$ which seems significant.
Also $P^4-24AP^2+16A^2 =(P^2-12A)^2-144A^2+16A^2 =(P^2-12A)^2-128A^2 $ so we want this to be a square. Again, I don't know how to do this.
Your turn.