<s>[INST] Find height of a wall if at the beginning it exceeds $10$ meters and then $8$ meters When the foot of a staircase is $5$ meters from the base of a wall, it protrudes $10$ meters above the wall; and if it is $9$ meters from the base, it stands $8$ meters.
Find the height of the wall.


Using the Pythagorean theorem for the two situations I have
$$\begin{cases}(10-x)^2=5^2+y^2\\(8-x)^2=9^2+y^2,\end{cases}$$ where $x$ is the hypotenuse and $y$ is the height of the wall.
Solving that system of equations I have that $x=23$ and $y=\pm12$, but since a height is always positive, the solution is $\boxed{12~\text{meters}}$.
Is it correct?
I am not sure of the $x$ value because first it has a value but then it has another, so maybe we have to use $x_1$ and $x_2$, but then we have $3$ equations with $2$ variables, so it is not possible.
Thanks!
 [/INST] The hypotenuse is $x - 10$ and $x - 8$ where $x$ is the total length of the staircase with overhang and is the same for both.
\begin{cases}(x-10)^2=5^2+y^2\\(x-8)^2=9^2+y^2\end{cases}
$(x-8)^2 - (x-10)^2 = 56$
$(x^2 - 16x + 64)-(x^2 - 20x +100) = 56$
$4x -36 = 56$
$x = 23$
$y = \sqrt{13^2 - 5^2} = 12$
Also $y = \sqrt{15^2 - 9^2} = 12$
</s>