We have : (a+b)^2 = a^2 + 2ab + b^2.
So, we can see here : the first term (3x) is a, the second term (a) is b.
For it to be expanded as such, the second term in the bracket must be equal to a^2 when it is squared.
Therefore, the missing term is a.
Recheck : (3x + a)^2 = (3x)^2 + 2.3x.a + a^2 = 9x^2 + 6ax + a^2.