Daniel B. answered 12/13/21
A retired computer professional to teach math, physics
I assume that you are being asked to calculate (f(x+h)-f(x))/h,
because it looks like your teacher is preparing you for the definition of derivative.
If your teacher does actually mean f(x+h)-f(x)/h then you can do that using the
same method.
Substitute the definition of f into the expression
(3(x+h)²+1 - (3x²+1))/h =
(3x² + 6xh + 3h² + 1 - 3x² - 1)/h =
(6xh + 3h²)/h =
6x + 3h