Explanation:
since AD is an altitude (height) of ABC, the angle at D must be 90° (that is the definition of an altitude or height).
so,
90 = x² + 6x + 18
72 = x² + 6x
0 = x² + 6x - 72
the general solution to such a quadratic equation
ax² + bx + c = 0
is
x = (-b ± sqrt(b² - 4ac))/(2a)
in our case
x = (-6 ± sqrt(6² - 4×1×-72))/(2×1) =
= (-6 ± sqrt(36 + 288))/2 = (-6 ± sqrt(324))/2 =
= (-6 ± 18)/2 = -3 ± 9
x1 = -3 + 9 = 6
x2 = -3 - 9 = -12
so, the 2 solutions are
x = 6
x = -12