f(x) = 3x + a
f(x2+x+2) = 3(x2+x+2) + a = 3x2 + 3x + (6+a)
f(3x-1) = 3(3x-a) + a = 9x - 2a
f(x2+x+2) - f(3x-1)
= 3x2 + 3x + 6 + a - 9x + 2a
= 3x2 - 6x + 6 + 3a
The roots are the values of x for which f(x) = 0:
0 = 3x2 - 6x + 6 + 3a
We use the quadratic formula to solve for x:
x = (-b/2a) ± (1/2a)√(b2-4ac)
Where a = 3, b = -6 and c = 6+3a. The roots will be real when the discriminant, the expression under the radical (b2-4ac), is ≥ 0:
(b2-4ac) ≥ 0
(-6)2-4(3)(6+3a) ≥ 0
36 -12(6+3a) ≥ 0
-12(6+3a) ≥ 36
6 + 3a ≤ -3 (Divided by -12, so we had the flip the inequality sign)
3a ≤ -9
a ≤ -3
The roots of f(x) will be real when a ≤ -3.