AB=9a BC=12a AC=42

I don't understand how to work this out if I don't have say 3y+1.

If the points are in a aline, then I expect

AB + BC = Ac

So,

9a + 12a = 42
21a = 42
a = 2

Now you can figure out the lengths AB and BC