Explanation:
it is a right-angled triangle.
so, Pythagoras applies.
c² = a² + b²
c is the Hypotenuse (the side opposite of the 90° angle), a and b are the legs.
so, in our case
(x + 4)² = x² + (x + 1)²
x² + 8x + 16 = x² + x² + 2x + 1 = 2x² + 2x + 1
6x + 15 = x²
0 = x² - 6x - 15
a quadratic equation
ax² + bx + c = 0
has the general solution
x = (-b ± sqrt(b² - 4ac))/(2a)
in our case
a = 1
b = -6
c = -15
x = (6 ± sqrt((-6)² - 4×1×-15))/(2×1) =
= (6 ± sqrt(36 + 60))/2 =
= (6 ± sqrt(96))/2 =
= (6 ± sqrt(16×6))/2 =
= (6 ± 4×sqrt(6))/2 = 3 ± 2×sqrt(6)
x1 = 3 + 2×sqrt(6) = 7.898979486... ≈ 7.9
x2 = 3 - 2×sqrt(6) = -1.898979486... ≈ -1.9
a negative value for x would give us negative side lengths, which does not make any sense.
so, x1 is our only solution.
that means
x = 7.9
x + 1 = 8.9
x + 4 = 11.9