A quadratic in vertex form reads as
(x - a)² + b
where (a, b) is the vertex.
To get the given quadratic in this form, complete the square:
x² - 6x - 40 = x² - 6x + 9 - 49 = (x - 3)² - 49
Or, work backwards by expanding the vertex form and solving for a and b :
(x - a)² + b = x² - 2ax + a² + b
So if
x² - 6x - 40 = x² - 2ax + a² + b,
then
-2a = -6 → a = 3
a² + b = -40 → b = -49