You can put this solution on YOUR website! Maybe you need to practice the FOIL technique.
Remember: when you expand the (x+y)^2 term you get 3 terms (x^2,xy,y^2).
f(x)=3x^2+1
f(a+3)=3(a+3)^2+1
f(a+3)=3(a^2+6a+9)+1
f(a+3)=3a^2+18a+27+1
f(a+3)=3a^2+18a+28