y varies directly as x can be expressed as:
y = kx, where k is the constant of variation
y = -9 when x = 3, so can plug those into determine k:
-9 = k*3 so k = -3
so can now expression relationship as
y= -3x
To find value of x when y = 18, plug 18 in for value of y and solve for x:
18 = -3x
x = -6