You are right until you decided to take the second derivative:
f(x) = (3x+1)^2
f'(x) = 3(3x+1)^2*(3)
Now in order to get f''(x) you must use the product rule (not the triple product rule as constants hold over) thus:
f''(x) = (3)*(2(3x+1))*(3)*(3)
You do not have to but I choose to simplify so
f''(x)= 54(3x+1)