X is partly constant and partly varies as Y when y=2, x=30, and when y=6, x=50

x = a+by

so,
a+2b = 30
a+6b = 50
b = 5, so a=20
x = 20 + 5y