\(\dfrac{x^2 + 5x + a}{x^2 - 10x - 24} = \dfrac{x^2 + 5x + a}{(x - 12)(x + 2)}\)
If the fraction is equal to the quotient of two linear functions, then either (x - 12) or (x + 2) divides x^2 + 5x + a.
By factor theorem,
\(12^2 + 5\cdot 12 + a = 0\text{ or }(-2)^2 + 5(-2) + a = 0\\ a = -204 \text{ or }a = 6\)
Therefore \(S = \{-204, 6\}\). Sum of elements of S is -198.
Remarks: The statement of factor theorem is as follows.
Let \(p(x)\) be a polynomial such that \((x - a)\) divides \(p(x)\). Then \(p(a) = 0\).