It's just algebra to find the missing "link" (k) to given equations, where k is the constant value.
Direct variation is simply y = k*x
Inverse is y = k/x
They'll always give you the values y and x first so you have to solve for constant k, then give you x in another question and you'll have...