Could all those line segment be integers? Can a right triangle be inscribed in a square in the manner shown in figure, such that the lenght of every line segment is an integer?
I tried to solve this system but I'm stucked.
$$\begin{cases}
s^2 + a^2 = y^2 \\ 
b^2 + c^2 = x^2 \\
d^2 + s^2 = z^2 \\
x^2 + y^2 = z^2 \\
a + b = s \\
c + d = s \\
2s^2 = as + cb + xy + ds \\
sc= ab 
\end{cases}
$$

 A: Unfortunately, not all of the line segments can have integer lengths. Assume instead that they are all integers. Next, consider your diagram with a few points labeled, as shown below:

Since $\measuredangle EGF + \measuredangle JGH = 90^{\circ}$, then $\measuredangle FEG = \measuredangle JGH$, so $\triangle EFG \sim \triangle GHJ$ (as your $sc = ab$ equation indicates from \eqref{eq1A} below). Thus, also using $a + b = s \; \to \; a = s - b$, for some positive rational $k$, we have
$$\frac{b}{s} = \frac{c}{a} = \frac{x}{y} = k \; \to \; b = ks, \; a = (1-k)s, \; x = ky \tag{1}\label{eq1A}$$
We get by using the Pythagorean theorem with $\triangle EFG$ that
$$a^2 + s^2 = y^2 \; \to \; ((1-k)^2 + 1)s^2 = y^2 \; \to \; (1-k)^2 + 1 = \left(\frac{y}{s}\right)^2 \tag{2}\label{eq2A}$$
Similarly, using \eqref{eq1A} and the Pythagorean theorem with $\triangle EGJ$ gives
$$x^2 + y^2 = z^2 \; \to \; (k^2 + 1)y^2 = z^2  \; \to \; k^2 + 1 = \left(\frac{z}{y}\right)^2 \tag{3}\label{eq3A}$$
With $k$ being a positive rational, then $k = \frac{q}{p}$, with $q$ and $p$ being coprime positive integers. Using this, plus that a rational square equal to an integer must be a perfect square, then multiplying both sides of \eqref{eq2A} by $p^2$ gives, for some positive integer $m$, that
$$(p-q)^2 + p^2 = \left(\frac{yp}{s}\right)^2 = m^2 \tag{4}\label{eq4A}$$
and also multiplying both sides of \eqref{eq3A} by $p^2$ results in, for some positive integer $n$, that
$$q^2 + p^2 = \left(\frac{zp}{y}\right)^2 = n^2 \tag{5}\label{eq5A}$$
However, as proven in Can $(q,p)$ and $(p-q,p)$ be legs of a Pythagorean Triple, there are no positive integer solutions for $q$ and $p$ in \eqref{eq4A} and \eqref{eq5A}. This contradiction shows that at least one of the line segment lengths is not an integer.
